{"blocked":null,"files":[{"fork":"giorgoschionas/amm-challenge","branch":"main","path":"contracts/src/Strategy.sol","commit":"61ba5df13771e35a9887e51994d3eeb5edc4fade","sha256":"6fd32f2c52b2460046eb1b7fc133531f62e27404fd8efaa8633907691988a19d","url":"https://raw.githubusercontent.com/giorgoschionas/amm-challenge/61ba5df13771e35a9887e51994d3eeb5edc4fade/contracts/src/Strategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'Optimal_25bps' validated successfully!","d32":-211.30950957688987,"oog":0,"gas32":{"max_ok":22592,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":328862,"ok":328862,"max_ok_gas":22592,"sum_ok_gas":7419917752,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":392497,"ok":392497,"max_ok_gas":22592,"sum_ok_gas":8855792996,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":331.0556659786426},{"fork":"piotrostr/amm-challenge","branch":"rustify","path":"contracts/src/BoundedExpStrategy.sol","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","sha256":"21d7bc25a3c5c953f5711b58be2842c62e55e304d773261e729efc6a58d2593a","url":"https://raw.githubusercontent.com/piotrostr/amm-challenge/35b9625f7e3aa57a07627f530240b69e1761e702/contracts/src/BoundedExpStrategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'BoundedExp' validated successfully!","d32":-184.64722111063622,"oog":0,"gas32":{"max_ok":72761,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":312360,"ok":312360,"max_ok_gas":22592,"sum_ok_gas":7047790740,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":44030,"sum_ok_gas":1408960,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":356074,"ok":356074,"max_ok_gas":72761,"sum_ok_gas":13783525984,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21543,"sum_ok_gas":689376,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":357.71795444489624},{"fork":"piotrostr/amm-challenge","branch":"rustify","path":"contracts/src/DecayVolStrategy.sol","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","sha256":"fc5ea1e0b30d853b50a640d79fd6ee146bdae7bd7a2f10714ddb596fbd8f2386","url":"https://raw.githubusercontent.com/piotrostr/amm-challenge/35b9625f7e3aa57a07627f530240b69e1761e702/contracts/src/DecayVolStrategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'DecayVol' validated successfully!","d32":-89.43336058428642,"oog":0,"gas32":{"max_ok":94622,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":341493,"ok":341493,"max_ok_gas":22592,"sum_ok_gas":7705288308,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":44039,"sum_ok_gas":1409248,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":305806,"ok":305806,"max_ok_gas":94622,"sum_ok_gas":13042181666,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21546,"sum_ok_gas":689472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":452.931814971246},{"fork":"piotrostr/amm-challenge","branch":"rustify","path":"contracts/src/ExpVolStrategy.sol","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","sha256":"864423ee8cc5dcbff1be42741629d5f5134569214cd021772e68800344fa7749","url":"https://raw.githubusercontent.com/piotrostr/amm-challenge/35b9625f7e3aa57a07627f530240b69e1761e702/contracts/src/ExpVolStrategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'ExpVol' validated successfully!","d32":-125.08296147951972,"oog":0,"gas32":{"max_ok":72718,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":315053,"ok":315053,"max_ok_gas":22592,"sum_ok_gas":7108714912,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":44039,"sum_ok_gas":1409248,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":329250,"ok":329250,"max_ok_gas":72718,"sum_ok_gas":12735109044,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21546,"sum_ok_gas":689472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":417.28221407601274},{"fork":"piotrostr/amm-challenge","branch":"rustify","path":"contracts/src/FastVolStrategy.sol","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","sha256":"420f6586b8f316fffdc0cfcc3a75011895d869f0e824c650dea9534f091dc3a1","url":"https://raw.githubusercontent.com/piotrostr/amm-challenge/35b9625f7e3aa57a07627f530240b69e1761e702/contracts/src/FastVolStrategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'FastVol' validated successfully!","d32":-73.06669609922187,"oog":0,"gas32":{"max_ok":72516,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":357550,"ok":357550,"max_ok_gas":22592,"sum_ok_gas":8067641120,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":44054,"sum_ok_gas":1409728,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":271146,"ok":271146,"max_ok_gas":72516,"sum_ok_gas":10432975406,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21546,"sum_ok_gas":689472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":469.2984794563106},{"fork":"piotrostr/amm-challenge","branch":"rustify","path":"contracts/src/SqVolStrategy.sol","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","sha256":"1a9e8ba24931986c398505555b576c185129cd750ed5c9c40673db5eb61a07c2","url":"https://raw.githubusercontent.com/piotrostr/amm-challenge/35b9625f7e3aa57a07627f530240b69e1761e702/contracts/src/SqVolStrategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'SqVol' validated successfully!","d32":-57.76054828775166,"oog":0,"gas32":{"max_ok":82949,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":361438,"ok":361438,"max_ok_gas":22592,"sum_ok_gas":8155282916,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":44039,"sum_ok_gas":1409248,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":293771,"ok":293771,"max_ok_gas":82949,"sum_ok_gas":14261382775,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21546,"sum_ok_gas":689472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":484.6046272677808},{"fork":"atvinicius/amm-challenge","branch":"main","path":"strategy_submission.sol","commit":"78752c17e06b3f4b5d304291e29642f13693c2d7","sha256":"c6a8136443126776fb5a32ecc16be78539d40671481ae8b87a16bb84738bdfd6","url":"https://raw.githubusercontent.com/atvinicius/amm-challenge/78752c17e06b3f4b5d304291e29642f13693c2d7/strategy_submission.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'Rookie Edge' validated successfully!","d32":-7.8071924836431545,"oog":0,"gas32":{"max_ok":128165,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":334276,"ok":334276,"max_ok_gas":22592,"sum_ok_gas":7542284804,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":185532,"sum_ok_gas":5937024,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":356082,"ok":356082,"max_ok_gas":128165,"sum_ok_gas":26921337140,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21530,"sum_ok_gas":688960,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":534.5579830718893},{"fork":"alexanderzliu/amm-challenge","branch":"main","path":"my_strategy.sol","commit":"e15b10d2193387e14b863342adacf9508821b471","sha256":"72e777f283b5a9f4cb64670902d47a339907dbd810fb3fdaaf364fbb6c441fb1","url":"https://raw.githubusercontent.com/alexanderzliu/amm-challenge/e15b10d2193387e14b863342adacf9508821b471/my_strategy.sol","valid":true,"validation":"Validating strategy...\nCompiling strategy...\nStrategy 'DirContrarian' validated successfully!","d32":-38.21946996444158,"oog":0,"gas32":{"max_ok":33390,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":368619,"ok":368619,"max_ok_gas":22592,"sum_ok_gas":8317270152,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":66012,"sum_ok_gas":2112384,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":300195,"ok":300195,"max_ok_gas":33390,"sum_ok_gas":9934765988,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21543,"sum_ok_gas":689376,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"runtime_valid32":true,"mean_edge32":504.14570559109086}],"top3":[{"sha256":"c6a8136443126776fb5a32ecc16be78539d40671481ae8b87a16bb84738bdfd6","url":"https://raw.githubusercontent.com/atvinicius/amm-challenge/78752c17e06b3f4b5d304291e29642f13693c2d7/strategy_submission.sol","fork":"atvinicius/amm-challenge","branch":"main","path":"strategy_submission.sol","paired":{"n":256,"mean_diff":-7.564545284368279,"se":0.10280381194003085,"worst":[{"seed":901068,"d":-13.586148595762893},{"seed":901033,"d":-12.085894160903536},{"seed":901200,"d":-11.735979786892926},{"seed":901217,"d":-11.315180298133555},{"seed":901070,"d":-11.221952660071224}]},"retail_edge_delta":{"mean":1.0408719011457876,"se":0.07694585092171627},"arb_edge_delta":{"mean":-8.60541718551407,"se":0.08617217772840877},"reconciliation_max_abs":1.1013412404281553e-13,"gas":{"max_ok":150946,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":21796,"sum_ok_gas":5579776,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":2670116,"ok":2670116,"max_ok_gas":22592,"sum_ok_gas":60245807584,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":256,"ok":256,"max_ok_gas":21526,"sum_ok_gas":5510656,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":185532,"sum_ok_gas":47496192,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":2850454,"ok":2850454,"max_ok_gas":150946,"sum_ok_gas":215464788358,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":256,"ok":256,"max_ok_gas":21530,"sum_ok_gas":5511680,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"valid":true,"mechanism":"It explicitly discounts the common fee by 1 bp per empty step after the first, capped at 6 bps, to regain flow after inactivity. It updates a single implied-fair-price EMA only on the first print of a step, and uses an additive stale-price shift derived from toxicity EMA rather than RS2's posterior-blended price gap. Most of its sigma, flow, activity and toxicity construction overlaps RS2, so it supplies an idle re-entry mechanism rather than a wholly new fee family.","mean_edge":526.1706139549234,"paired_differences":[-7.994572328182585,-5.180954726957452,-6.442082072705944,-9.982429771847478,-10.15438407556968,-7.982601016008061,-8.870683941432048,-10.27835489433096,-7.822041093427288,-7.613683909102008,-5.650264312178933,-9.977395917493709,-6.951263888145036,-6.453166890759576,-7.207057416010798,-10.140976956461373,-6.38435516317395,-4.480293974096639,-5.7569734303898485,-7.398279803421076,-5.808679563955138,-8.482240551421228,-8.633092991706462,-5.830614574995366,-7.249849087990867,-6.5333583278676315,-5.257063872257277,-8.94554500706306,-9.207832570197468,-6.753322495616658,-5.6081076101118015,-5.56730889486721,-7.135020907744888,-12.085894160903536,-10.170634403916097,-5.03255397348903,-6.312203398436338,-8.240853320658005,-2.4330113099683786,-8.7863081770941,-5.9970578370828775,-7.816322388653873,-7.227639552039534,-6.613459786204885,-6.01461495404601,-7.532633954222888,-5.485866493185654,-5.786830915487144,-10.040255514695218,-7.110867752710078,-7.269412705948071,-5.169546226352736,-6.1728244735789985,-7.589473631625424,-9.894066062501565,-6.854759832504669,-7.389867639877821,-7.028730249519583,-8.291148243444809,-8.010277955308197,-5.653929435527459,-6.717216867865659,-7.8665313902957905,-10.906170000352972,-5.323062904134645,-6.592519730170352,-6.492345292387256,-8.721341116113535,-13.586148595762893,-8.40537891293161,-11.221952660071224,-8.62096067846852,-6.338204740670108,-8.355152775838292,-6.634485800239418,-8.363604056446661,-4.947631880251151,-4.595247374401993,-8.658408210089988,-9.337415074137994,-5.787830079660068,-6.49097256780999,-8.452363712507236,-8.139846565963353,-7.3431571997574,-6.796763381732944,-7.033771883448253,-11.118167643248796,-7.114853153871479,-9.850300207500368,-8.193944125549763,-8.668258841323677,-6.748837184322838,-8.818907096082285,-7.550503488296442,-8.96577750582776,-8.92718162804124,-7.253129921446373,-8.248062957568322,-5.507235949221013,-7.276263614078971,-8.033444696412744,-7.093827224562119,-4.809496551052973,-9.494642959218368,-4.979878269320011,-8.050311282869586,-7.663559899823895,-9.186364622414771,-3.962220766670214,-7.241237879144251,-9.021180766398402,-10.58999224839647,-9.520654197565477,-9.114881335958842,-5.846880640981169,-8.799502327841822,-8.523208179408755,-6.67019744174786,-8.075036722913865,-7.817227972803948,-6.182637516797627,-8.472532306195149,-4.279020155785759,-8.769828512306162,-8.250745436748616,-9.647972057891195,-9.186689250498432,-5.6039485545943535,-7.56973677083721,-4.11728331315021,-8.029660315947353,-8.17084636970435,-8.55454377641695,-6.086381615846506,-5.249143946817981,-9.127581655817835,-8.444890511945914,-8.960155740269556,-9.55593462938441,-8.165286535032465,-4.740425070916899,-9.126063969259576,-6.044788753037892,-8.818246933250919,-7.037867601478524,-6.983511197073085,-10.17170258368202,-8.505300907141134,-8.041100996571004,-8.31072132270009,-6.6826177732535825,-9.712172048048785,-8.42907764919073,-7.351559646453325,-6.709659107700418,-7.809559476513073,-8.546070118689329,-6.435749287946578,-5.360277135965646,-7.439491893534978,-8.943990088164355,-6.232130841998071,-5.691325861519886,-9.586227895747982,-6.216461976426331,-6.650985704889649,-5.991980911529595,-8.750752489599563,-5.798449674289827,-5.93500130648215,-8.329668992897211,-7.324880468221295,-4.18601785347073,-6.085512926615593,-6.380744221297505,-8.282883783047453,-6.174868431690356,-9.14297627558841,-7.47313216288245,-5.903990041707289,-9.425462036244085,-6.314429912960122,-6.811790845452606,-6.963449818236768,-10.04834408256204,-6.727510298361835,-9.63032989502949,-6.048317837890522,-3.602973830688029,-7.43591248771537,-6.52081356848754,-7.177366694055536,-7.235466903644465,-7.563463610486451,-8.237068116433306,-9.487420812316032,-11.204710353960763,-7.479886070206248,-7.480376461278638,-11.735979786892926,-6.8074166121309645,-6.577897036216143,-6.414488568854665,-7.670555034128938,-7.6090420513070285,-8.972700885928361,-6.642795058933871,-8.230443495821305,-11.011887768517795,-8.351335973270693,-7.575634574385049,-7.460854335074998,-8.647890837212344,-9.78150382579031,-7.159314986279924,-8.819009553774663,-11.315180298133555,-5.780970686093497,-9.902886003682454,-8.201016507842382,-8.954252836281569,-7.760771366434312,-8.0571830037577,-5.396181025133387,-5.167190705865096,-9.179724941525876,-6.270329238062686,-7.4417808954013935,-7.505626269086349,-7.35117083774287,-7.1832406819979155,-6.624830509295521,-4.041890603783656,-8.058589802773668,-7.756932534509417,-7.3599520137906325,-7.0084126321886515,-7.203261901942142,-8.477341642885847,-7.108945998471654,-7.02125491712377,-7.19313006036441,-7.963297962527122,-7.689678697699435,-9.988521773015123,-5.706930013161696,-8.210171473213904,-7.048881986415779,-7.8208402855833015,-7.885685809392214,-6.711262620354432,-7.128213544783932,-6.586687046378302,-6.969617170026254,-8.656598988699727]},{"sha256":"72e777f283b5a9f4cb64670902d47a339907dbd810fb3fdaaf364fbb6c441fb1","url":"https://raw.githubusercontent.com/alexanderzliu/amm-challenge/e15b10d2193387e14b863342adacf9508821b471/my_strategy.sol","fork":"alexanderzliu/amm-challenge","branch":"main","path":"my_strategy.sol","paired":{"n":256,"mean_diff":-37.80519812576226,"se":0.48798082588454106,"worst":[{"seed":901007,"d":-89.9750791729058},{"seed":901133,"d":-65.2488747753315},{"seed":901237,"d":-54.506268330745},{"seed":901234,"d":-53.38891380643065},{"seed":901048,"d":-53.08658292345922}]},"retail_edge_delta":{"mean":-17.869436881664,"se":0.3101739004428344},"arb_edge_delta":{"mean":-19.935761244098263,"se":0.3611690450603702},"reconciliation_max_abs":9.947598300641403e-14,"gas":{"max_ok":33390,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":21796,"sum_ok_gas":5579776,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":2940880,"ok":2940880,"max_ok_gas":22592,"sum_ok_gas":66355944752,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":256,"ok":256,"max_ok_gas":21526,"sum_ok_gas":5510656,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":66012,"sum_ok_gas":16899072,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":2402656,"ok":2402656,"max_ok_gas":33390,"sum_ok_gas":79510231977,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":256,"ok":256,"max_ok_gas":21543,"sum_ok_gas":5515008,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"valid":true,"mechanism":"It spikes only the fee opposite the latest trade direction using a linear-plus-quadratic reserve-size signal above a 24 bps floor. The same-direction fee decays by eight ninths per trade, while the opposite fee retains the maximum of its decayed value and the new spike. This explicit directional hysteresis replaces RS2's estimated fair-price lean and volatility, flow and toxicity fee construction.","mean_edge":495.9299611135294,"paired_differences":[-43.49419239561166,-41.495517770849574,-44.068008833168165,-39.71720202880522,-27.93482624696776,-46.12041485873965,-26.357112654125388,-89.9750791729058,-40.37237186550965,-29.632938955689553,-47.80152243403154,-46.437797994205994,-27.33034433295228,-33.09226411042056,-47.138787570710974,-36.98692092414967,-37.33163853236243,-43.07068819469839,-39.56311091799398,-30.022029282459016,-32.120204635032394,-43.41451405502664,-39.380808077524875,-31.033839627106374,-30.40125416289004,-40.494075517020974,-39.840825414644996,-36.73152417376582,-26.32861057122045,-41.64866988298809,-46.050786617976314,-43.359652270023275,-38.892271762893756,-49.1546855240324,-43.065250502100525,-34.41589273237457,-33.06955650313364,-28.524295214074243,-40.625136069191626,-29.276820840729727,-26.203639403367674,-32.47908088694578,-47.08068675974272,-36.93711837037034,-38.32635580843686,-29.398547297948255,-43.15597515020386,-44.58400790802136,-53.08658292345922,-39.78214667985617,-35.109592002262275,-35.75989588198598,-43.193000649764485,-37.931026884049345,-43.013378458670104,-36.81294889887823,-36.94332197082349,-30.682221427075774,-42.20108293465876,-47.276986469698386,-27.62916834250325,-42.90098075476317,-35.900367356425136,-45.163522560700585,-42.670652201276994,-42.895068579394206,-35.62544817697369,-43.99956046590637,-33.88868521490065,-44.14289866229194,-27.314046189435203,-35.493589858583846,-44.756035740202776,-28.00507698851459,-49.64104231028978,-34.98545887960802,-39.21937162186941,-40.12776386231974,-43.03849207374742,-46.08267712238444,-34.05493681083698,-32.33237444161364,-30.731405715915855,-41.468420699790954,-32.893117531918335,-29.266516025594967,-38.126548725308,-23.016151085817853,-25.51794869694379,-49.21810967518718,-35.558856115119,-27.12267252675025,-36.78683090662804,-32.11202514517646,-33.84782835735251,-39.31072252235106,-39.76238241198644,-30.757803254297812,-35.06068172887342,-45.45537410134909,-44.971365455973,-35.39286797293289,-47.406406798028,-34.56387792430695,-46.1720240733498,-44.57314581478715,-31.607870834180005,-36.13458225614255,-31.516273235690335,-33.57196899571289,-53.05366725165982,-35.80779286485068,-42.86840047623218,-40.15938635910243,-30.35949256221471,-25.37214163574646,-26.642296718782518,-39.01528472677347,-46.79621543011274,-38.79578393965073,-42.52769641905627,-46.61044804112123,-40.05400393482938,-29.54262641155998,-46.20513558105108,-31.633954322304703,-29.500564762151214,-28.011826740741697,-38.819649138653006,-34.34613639681584,-36.306461597742725,-43.68972056914777,-33.158957516098496,-65.2488747753315,-39.06481323961856,-44.200577490473165,-37.51088859061531,-23.231955075359792,-34.91751372877724,-46.27173334422423,-39.90746826833691,-48.17958683144957,-39.48961612521009,-38.98410342857346,-29.787912149500073,-48.57316779682799,-40.795261327928756,-29.359157844837,-28.055422673417183,-36.00537172746283,-29.132881940648133,-42.16548897878255,-31.888076384038186,-34.15578427426573,-31.772558736149904,-48.496091859526814,-46.677717120248076,-29.783315429651054,-50.228920379111855,-28.51613220653968,-28.05441336417772,-40.64834532517864,-31.44746835129814,-46.09023150227665,-29.250446943500776,-41.17815437528793,-40.5873609549144,-46.83515027061105,-35.37223834882877,-51.17050388231564,-29.43615608643205,-24.767549793603735,-33.61280125369166,-40.7823267105523,-41.29229047065559,-48.25725290565322,-33.70299780229698,-39.51347011917716,-31.164025636621318,-27.84573347101275,-46.53734049623688,-50.725633307804856,-42.75062498959949,-40.92717069503675,-36.10573865452312,-34.92155932412061,-41.46051747230064,-35.09921689047371,-36.1308928710352,-51.15972348723267,-37.72063527273036,-35.91591097106942,-39.35310132515161,-31.565273527627255,-34.93579140426368,-32.92414887619907,-28.667823633619548,-41.0431052840936,-31.38296736005634,-34.7849674471226,-31.541555655933507,-39.14834016712075,-34.54034745501377,-30.895452219243793,-39.308591941887585,-39.49550604648425,-47.48172241354712,-29.114665854867496,-38.75628626617993,-42.56155552876794,-41.54341106678885,-25.441236600589548,-33.68672317512454,-41.238463561234425,-30.703436361577985,-46.219655407510004,-43.33421887220891,-25.651318985996454,-39.926464980634194,-29.230411371783248,-39.40358458585342,-35.80145520704542,-33.32552418424302,-34.812736591157204,-40.580901736758506,-45.87983800029497,-35.99711916786748,-41.73037231299577,-32.86122844991172,-33.4063866479101,-29.62206716581602,-28.268143009818232,-45.41831882987651,-30.423863077576925,-53.38891380643065,-33.08470259146327,-33.66990287456997,-54.506268330745,-30.009218314081693,-29.43224548768768,-42.73886152491633,-52.99828980921757,-36.37836228659154,-29.15707112439702,-33.58058552575608,-31.484973161570508,-38.60462332520103,-36.53093256373779,-29.63782003040734,-38.89781888760933,-32.3104500562676,-37.77153203954657,-36.7812271682331,-26.71793791146257,-48.58062686210076,-40.198320833504056]},{"sha256":"1a9e8ba24931986c398505555b576c185129cd750ed5c9c40673db5eb61a07c2","url":"https://raw.githubusercontent.com/piotrostr/amm-challenge/35b9625f7e3aa57a07627f530240b69e1761e702/contracts/src/SqVolStrategy.sol","fork":"piotrostr/amm-challenge","branch":"rustify","path":"contracts/src/SqVolStrategy.sol","paired":{"n":256,"mean_diff":-57.762204609979214,"se":0.6669007451657509,"worst":[{"seed":901133,"d":-88.27237441869829},{"seed":901237,"d":-82.83448027689673},{"seed":901033,"d":-81.99677153289986},{"seed":901010,"d":-78.9577468483335},{"seed":901181,"d":-78.88076678129164}]},"retail_edge_delta":{"mean":-35.74968943368063,"se":0.42725789634222333},"arb_edge_delta":{"mean":-22.012515176298585,"se":0.3181689303551696},"reconciliation_max_abs":9.947598300641403e-14,"gas":{"max_ok":83290,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":21796,"sum_ok_gas":5579776,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":2883124,"ok":2883124,"max_ok_gas":22592,"sum_ok_gas":65053157120,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":256,"ok":256,"max_ok_gas":21526,"sum_ok_gas":5510656,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":44039,"sum_ok_gas":11273984,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":2349098,"ok":2349098,"max_ok_gas":83290,"sum_ok_gas":114037602478,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":256,"ok":256,"max_ok_gas":21546,"sum_ok_gas":5515776,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]},"valid":true,"mechanism":"It tracks an EMA of squared relative spot changes and takes its square root to obtain an RMS volatility estimate. Both fees equal 8 bps plus 100 bps times RMS volatility divided by 80 bps. This symmetric second-moment volatility mapping replaces RS2's directional price lean and flow and toxicity model.","mean_edge":475.9729546293124,"paired_differences":[-64.84391157321829,-65.95130957660439,-73.94411638321628,-55.29774156945416,-47.99900455905225,-65.55322653246208,-41.86425866030061,-71.10219223329216,-65.57307894134851,-49.320402389118215,-78.9577468483335,-73.42981646601618,-41.08943036836405,-50.17548850278678,-70.56103565538251,-59.12486472202198,-56.0096326876552,-76.66059057112693,-58.64872500144878,-43.37560953698841,-48.525041632933835,-65.27672618458382,-62.38810505620711,-50.20237752342274,-46.597904235003625,-62.36995122378107,-62.689286257529034,-56.14818681578606,-42.90262201112074,-66.13987329979716,-72.0466146988939,-64.01885786919559,-53.784036907488144,-81.99677153289986,-63.76804738906765,-55.86695832532723,-50.29058681266952,-45.007885539646,-56.68624539237396,-42.80832404416884,-44.05230363584701,-50.37908664715928,-65.38551300684674,-59.63326198338325,-58.11307531510215,-47.189534092162205,-68.39396083187683,-69.91073524891954,-78.29900733212628,-59.752267487362644,-53.45503463427724,-54.353487184014966,-71.63074062704499,-61.228896520522255,-66.7713863193153,-59.36138667814862,-57.17544697659622,-47.66285178821067,-47.040850858847534,-76.45388778899269,-44.509606032892805,-72.12012963409461,-53.17944408539125,-66.78243458288193,-61.28082406289707,-55.92544853107614,-57.675642676057464,-64.86844259631516,-59.91895249934936,-69.07314307554145,-45.59549924593142,-42.97017844107938,-63.625192334064536,-47.63203729222431,-75.38703623173626,-62.32723947226782,-61.979392488259805,-60.003097024615045,-69.34967173393034,-74.0753966049831,-51.084507902458824,-48.3377647755467,-45.28666745958287,-59.206904352771744,-48.4193520510575,-44.66695726090171,-60.21955455932169,-45.997223317267355,-41.94097733101097,-76.45096209678422,-45.23368037698202,-39.2729652337091,-55.75720767235521,-51.4078704800022,-54.861604854356926,-66.40784977024259,-63.66501919554764,-50.13942582372772,-56.721238934257485,-67.78989902606338,-65.04689116588168,-56.525966127968445,-68.38601943522087,-50.46966466732897,-73.11601234550267,-68.88046553328957,-51.42638404829694,-59.467740115793504,-43.520455920748645,-54.56005947074004,-78.08693115101198,-55.41586729916111,-61.553822118371045,-55.22623443969417,-46.138219884370244,-40.82884051750801,-45.02939147680769,-52.47055611563667,-61.889112302102035,-59.48853490838428,-69.3874106593999,-65.20271887928402,-58.66462427876337,-44.96331046531412,-72.35629045837459,-46.68451322910039,-44.09681251114114,-41.65682068786947,-59.79977235875691,-51.37223875960092,-53.064100868619676,-68.15413284414922,-55.508374593130384,-88.27237441869829,-59.68852011656901,-75.25936458777244,-56.49057713976907,-36.737463406882114,-52.76441140872873,-72.80512490597846,-58.27834571816692,-66.19752009226602,-61.60346548989412,-61.74815195898486,-50.056868390495254,-76.42360122488344,-65.55632807985887,-44.893756721821546,-43.694444968374285,-54.29413839033134,-49.15563220823208,-70.58252686647558,-49.361612378768996,-52.94727563029204,-47.3320963276617,-72.29430660717014,-74.81329276564816,-48.24872927995375,-71.83285550723804,-40.8063770406917,-46.21010152487099,-69.84814871539083,-49.218936292085516,-78.53662361113038,-45.38629168528382,-66.06287736613876,-64.54521932638261,-71.36715679844372,-61.01594924331977,-71.2607987463366,-48.13522448095574,-40.83329768228646,-50.16514333829451,-61.444932404329506,-64.96499486419793,-73.86861403144417,-50.56964404133163,-62.43416705928115,-44.17708974216481,-40.296349842969335,-70.81948082799568,-78.88076678129164,-69.3695127045338,-59.758306066105945,-55.71717059836686,-55.07182650166499,-60.24920572420308,-58.70445824152705,-54.03770204728653,-76.83239039723264,-55.628212474443444,-53.52472979500993,-59.93719124639654,-43.799281763678664,-58.985484584272456,-52.33831065473163,-41.42926311774829,-60.762875590788894,-48.34205693116337,-56.43651000741437,-50.626726581204935,-60.921014690250104,-53.12453448374964,-47.4746701339119,-61.99921882158145,-62.83208139589135,-75.56656065369418,-45.5955830576483,-61.4104029484854,-68.22563749923086,-67.25180496506584,-39.345800360774945,-50.22902886010564,-59.62556822800809,-42.62560352089707,-69.72902228756584,-67.24149164206028,-42.82556654827488,-51.12642831269477,-50.86426519630754,-62.03319111012593,-52.04106357752289,-46.88573738593169,-60.0880376181957,-62.74614813843567,-68.29849949878081,-51.01763451456793,-58.838184326903615,-53.06547105413273,-46.33181589041703,-46.60739518600349,-42.71700784596777,-69.35050828038959,-49.84486471338977,-75.18747160498708,-46.0882551587398,-51.48032686341645,-82.83448027689673,-44.81074023228177,-47.38403215818977,-60.94805382802241,-71.17050485884283,-54.219495712222226,-42.56976482375569,-53.015026970716235,-47.60788919790991,-65.91683723447102,-57.57634972413365,-42.52555226389177,-54.079279948753026,-52.41278826478492,-60.5251807878613,-57.56743248968189,-40.44321004163942,-72.57144058031918,-59.754208077189276]}],"code":"// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {AMMStrategyBase} from \"./AMMStrategyBase.sol\";\nimport {TradeInfo} from \"./IAMMStrategy.sol\";\n\n/// @title Rookie Edge\n/// @notice Retail-first dynamic fee controller with toxicity and directional protection.\n/// @dev Built to improve edge by trading a bit more arb risk for much higher retail capture.\ncontract Strategy is AMMStrategyBase {\n    // --- decay / update constants ---\n    uint256 private constant ELAPSED_CAP = 8;\n    uint256 private constant SIGNAL_THRESHOLD = WAD / 700; // ~14 bps reserve ratio\n    uint256 private constant DIR_DECAY = 840000000000000000; // 0.84\n    uint256 private constant ACT_DECAY = 750000000000000000; // 0.75\n    uint256 private constant SIZE_DECAY = 720000000000000000; // 0.72\n    uint256 private constant TOX_DECAY = 820000000000000000; // 0.82\n    uint256 private constant SIGMA_DECAY = 680000000000000000; // 0.68\n    uint256 private constant LAMBDA_DECAY = 990000000000000000; // 0.99\n    uint256 private constant SIZE_BLEND_DECAY = 700000000000000000; // 0.70\n    uint256 private constant TOX_BLEND_DECAY = 200000000000000000; // 0.20\n    uint256 private constant ACT_BLEND_DECAY = 985000000000000000; // 0.985\n    uint256 private constant PHAT_ALPHA = 240000000000000000; // 0.24\n    uint256 private constant PHAT_SHOCK_GATE = 40000000000000000; // 4%\n    uint256 private constant DIR_IMPACT_MULT = 2;\n\n    // --- state caps ---\n    uint256 private constant RET_CAP = WAD / 10; // 10%\n    uint256 private constant TOX_CAP = WAD / 5; // 20%\n    uint256 private constant TRADE_RATIO_CAP = WAD / 5; // 20%\n    uint256 private constant LAMBDA_CAP = 5 * WAD; // max 5 trades/step estimate\n    uint256 private constant STEP_COUNT_CAP = 64;\n\n    // --- fee model constants ---\n    uint256 private constant BASE_FEE = 2 * BPS;\n    uint256 private constant SIGMA_COEF = 160000000000000000; // 0.16\n    uint256 private constant LAMBDA_COEF = 10 * BPS;\n    uint256 private constant FLOW_SIZE_COEF = 6200 * BPS;\n    uint256 private constant TOX_COEF = 280 * BPS;\n    uint256 private constant TOX_QUAD_COEF = 10800 * BPS;\n    uint256 private constant ACT_COEF = 50000 * BPS;\n    uint256 private constant DIR_COEF = 24 * BPS;\n    uint256 private constant DIR_TOX_COEF = 120 * BPS;\n    uint256 private constant STALE_DIR_COEF = 6500 * BPS;\n    uint256 private constant TAIL_KNEE = 420 * BPS;\n    uint256 private constant TAIL_SLOPE = 880000000000000000; // 0.88\n\n    // Competitive re-entry: if we were idle for many steps, tighten to win flow back.\n    uint256 private constant IDLE_DISCOUNT_PER_STEP = 1 * BPS;\n    uint256 private constant IDLE_DISCOUNT_CAP = 6 * BPS;\n\n    // slots[0] = bid fee\n    // slots[1] = ask fee\n    // slots[2] = last timestamp\n    // slots[3] = dirState (centered at WAD, [0, 2*WAD])\n    // slots[4] = actEma\n    // slots[5] = pHat\n    // slots[6] = sigmaHat\n    // slots[7] = lambdaHat\n    // slots[8] = sizeHat\n    // slots[9] = toxEma\n    // slots[10] = stepTradeCount (raw integer)\n\n    function afterInitialize(uint256 initialX, uint256 initialY)\n        external\n        override\n        returns (uint256, uint256)\n    {\n        slots[0] = BASE_FEE;\n        slots[1] = BASE_FEE;\n        slots[2] = 0;\n        slots[3] = WAD; // neutral direction\n        slots[4] = 0;\n        slots[5] = initialX > 0 ? wdiv(initialY, initialX) : 100 * WAD;\n        slots[6] = 950000000000000; // 0.095% initial sigma guess\n        slots[7] = 800000000000000000; // 0.8 initial arrival-rate guess\n        slots[8] = 1800000000000000; // 0.18% reserve-size ratio guess\n        slots[9] = 0;\n        slots[10] = 0;\n        return (BASE_FEE, BASE_FEE);\n    }\n\n    function afterSwap(TradeInfo calldata trade)\n        external\n        override\n        returns (uint256, uint256)\n    {\n        uint256 prevBidFee = slots[0];\n        uint256 prevAskFee = slots[1];\n        uint256 lastTs = slots[2];\n        uint256 dirState = slots[3];\n        uint256 actEma = slots[4];\n        uint256 pHat = slots[5];\n        uint256 sigmaHat = slots[6];\n        uint256 lambdaHat = slots[7];\n        uint256 sizeHat = slots[8];\n        uint256 toxEma = slots[9];\n        uint256 stepTradeCount = slots[10];\n\n        bool isNewStep = trade.timestamp > lastTs;\n        uint256 elapsedRaw = 0;\n        if (isNewStep) {\n            elapsedRaw = trade.timestamp - lastTs;\n            uint256 elapsed = elapsedRaw > ELAPSED_CAP ? ELAPSED_CAP : elapsedRaw;\n\n            dirState = _decayCentered(dirState, DIR_DECAY, elapsed);\n            actEma = wmul(actEma, _powWad(ACT_DECAY, elapsed));\n            sizeHat = wmul(sizeHat, _powWad(SIZE_DECAY, elapsed));\n            toxEma = wmul(toxEma, _powWad(TOX_DECAY, elapsed));\n\n            if (stepTradeCount > 0 && elapsedRaw > 0) {\n                uint256 lambdaInst = (stepTradeCount * WAD) / elapsedRaw;\n                if (lambdaInst > LAMBDA_CAP) lambdaInst = LAMBDA_CAP;\n                lambdaHat = wmul(lambdaHat, LAMBDA_DECAY) + wmul(lambdaInst, WAD - LAMBDA_DECAY);\n            }\n\n            stepTradeCount = 0;\n        }\n\n        bool firstInStep = stepTradeCount == 0;\n        uint256 spot = trade.reserveX > 0 ? wdiv(trade.reserveY, trade.reserveX) : pHat;\n        if (pHat == 0) pHat = spot;\n\n        // Recover implied fair level from traded side and fee in use.\n        uint256 feeUsed = trade.isBuy ? prevBidFee : prevAskFee;\n        uint256 gamma = feeUsed < WAD ? WAD - feeUsed : 0;\n        uint256 pImplied;\n        if (gamma == 0) {\n            pImplied = spot;\n        } else {\n            pImplied = trade.isBuy ? wmul(spot, gamma) : wdiv(spot, gamma);\n        }\n\n        if (firstInStep) {\n            uint256 ret = pHat > 0 ? wdiv(absDiff(pImplied, pHat), pHat) : 0;\n            if (ret <= PHAT_SHOCK_GATE) {\n                pHat = wmul(pHat, WAD - PHAT_ALPHA) + wmul(pImplied, PHAT_ALPHA);\n            }\n            if (ret > RET_CAP) ret = RET_CAP;\n            sigmaHat = wmul(sigmaHat, SIGMA_DECAY) + wmul(ret, WAD - SIGMA_DECAY);\n        }\n\n        uint256 tradeRatio = trade.reserveY > 0 ? wdiv(trade.amountY, trade.reserveY) : 0;\n        if (tradeRatio > TRADE_RATIO_CAP) tradeRatio = TRADE_RATIO_CAP;\n\n        if (tradeRatio > SIGNAL_THRESHOLD) {\n            uint256 push = tradeRatio * DIR_IMPACT_MULT;\n            if (push > WAD / 4) push = WAD / 4;\n\n            // isBuy=true => AMM buys X => local sell pressure.\n            if (trade.isBuy) {\n                dirState = dirState + push;\n                if (dirState > 2 * WAD) dirState = 2 * WAD;\n            } else {\n                dirState = dirState > push ? dirState - push : 0;\n            }\n\n            actEma = wmul(actEma, ACT_BLEND_DECAY) + wmul(tradeRatio, WAD - ACT_BLEND_DECAY);\n            sizeHat = wmul(sizeHat, SIZE_BLEND_DECAY) + wmul(tradeRatio, WAD - SIZE_BLEND_DECAY);\n            if (sizeHat > WAD) sizeHat = WAD;\n        }\n\n        uint256 tox = pHat > 0 ? wdiv(absDiff(spot, pHat), pHat) : 0;\n        if (tox > TOX_CAP) tox = TOX_CAP;\n        toxEma = wmul(toxEma, TOX_BLEND_DECAY) + wmul(tox, WAD - TOX_BLEND_DECAY);\n        uint256 toxSignal = toxEma;\n\n        uint256 flowSize = wmul(lambdaHat, sizeHat);\n        uint256 fBase =\n            BASE_FEE\n            + wmul(SIGMA_COEF, sigmaHat)\n            + wmul(LAMBDA_COEF, lambdaHat)\n            + wmul(FLOW_SIZE_COEF, flowSize);\n\n        if (isNewStep && elapsedRaw > 1) {\n            uint256 idleDiscount = (elapsedRaw - 1) * IDLE_DISCOUNT_PER_STEP;\n            if (idleDiscount > IDLE_DISCOUNT_CAP) idleDiscount = IDLE_DISCOUNT_CAP;\n            fBase = fBase > idleDiscount ? fBase - idleDiscount : 0;\n        }\n\n        uint256 fMid =\n            fBase\n            + wmul(TOX_COEF, toxSignal)\n            + wmul(TOX_QUAD_COEF, wmul(toxSignal, toxSignal))\n            + wmul(ACT_COEF, actEma);\n\n        uint256 dirDev;\n        bool sellPressure;\n        if (dirState >= WAD) {\n            dirDev = dirState - WAD;\n            sellPressure = true;\n        } else {\n            dirDev = WAD - dirState;\n            sellPressure = false;\n        }\n\n        uint256 skew = wmul(DIR_COEF, dirDev) + wmul(DIR_TOX_COEF, wmul(dirDev, toxSignal));\n\n        uint256 bidFee;\n        uint256 askFee;\n        if (sellPressure) {\n            bidFee = fMid + skew;\n            askFee = fMid > skew ? fMid - skew : 0;\n        } else {\n            askFee = fMid + skew;\n            bidFee = fMid > skew ? fMid - skew : 0;\n        }\n\n        // Additional stale-direction protection around pHat.\n        uint256 staleShift = wmul(STALE_DIR_COEF, toxSignal);\n        if (spot >= pHat) {\n            bidFee = bidFee + staleShift;\n            askFee = askFee > staleShift ? askFee - staleShift : 0;\n        } else {\n            askFee = askFee + staleShift;\n            bidFee = bidFee > staleShift ? bidFee - staleShift : 0;\n        }\n\n        bidFee = clampFee(_compressTail(bidFee));\n        askFee = clampFee(_compressTail(askFee));\n\n        stepTradeCount = stepTradeCount + 1;\n        if (stepTradeCount > STEP_COUNT_CAP) stepTradeCount = STEP_COUNT_CAP;\n\n        slots[0] = bidFee;\n        slots[1] = askFee;\n        slots[2] = trade.timestamp;\n        slots[3] = dirState;\n        slots[4] = actEma;\n        slots[5] = pHat;\n        slots[6] = sigmaHat;\n        slots[7] = lambdaHat;\n        slots[8] = sizeHat;\n        slots[9] = toxEma;\n        slots[10] = stepTradeCount;\n\n        return (bidFee, askFee);\n    }\n\n    function _compressTail(uint256 fee) internal pure returns (uint256) {\n        if (fee <= TAIL_KNEE) return fee;\n        return TAIL_KNEE + wmul(fee - TAIL_KNEE, TAIL_SLOPE);\n    }\n\n    function _powWad(uint256 factor, uint256 exp) internal pure returns (uint256 result) {\n        result = WAD;\n        while (exp > 0) {\n            if (exp & 1 == 1) result = wmul(result, factor);\n            factor = wmul(factor, factor);\n            exp >>= 1;\n        }\n    }\n\n    function _decayCentered(uint256 centered, uint256 decayFactor, uint256 elapsed)\n        internal\n        pure\n        returns (uint256)\n    {\n        uint256 mul = _powWad(decayFactor, elapsed);\n        if (centered >= WAD) {\n            return WAD + wmul(centered - WAD, mul);\n        }\n        uint256 below = wmul(WAD - centered, mul);\n        return below < WAD ? WAD - below : 0;\n    }\n\n    function getName() external pure override returns (string memory) {\n        return \"Rookie Edge\";\n    }\n}\n","sha256":"c6a8136443126776fb5a32ecc16be78539d40671481ae8b87a16bb84738bdfd6","url":"https://raw.githubusercontent.com/atvinicius/amm-challenge/78752c17e06b3f4b5d304291e29642f13693c2d7/strategy_submission.sol","author":{"name":"Vinicius","github_login":"atvinicius","commit_url":"https://github.com/atvinicius/amm-challenge/commit/78752c17e06b3f4b5d304291e29642f13693c2d7","licence":"MIT (SPDX in strategy source); no repository licence file found in inspected head tree"},"licence":"MIT (SPDX in strategy source); no repository licence file found in inspected head tree","fork_inventory":[{"fork":"giorgoschionas/amm-challenge","heads":[{"branch":"main","commit":"61ba5df13771e35a9887e51994d3eeb5edc4fade","licence_paths":[]}],"afterSwap_file_occurrences":5,"unique_nonupstream":1,"candidates":{"6fd32f2c52b2460046eb1b7fc133531f62e27404fd8efaa8633907691988a19d":[{"branch":"main","commit":"61ba5df13771e35a9887e51994d3eeb5edc4fade","path":"contracts/src/Strategy.sol"}]},"source_url":"https://api.github.com/repos/giorgoschionas/amm-challenge/branches?per_page=100"},{"fork":"piotrostr/amm-challenge","heads":[{"branch":"cleanup-pre-public","commit":"a3bb0103692324467c4f801d9803aec727df2a5e","licence_paths":[]},{"branch":"codex/increase-sims-default-1000","commit":"9f53c7b879bff34234611f17d84db076c68a59d2","licence_paths":[]},{"branch":"codex/security-hardening-upstream","commit":"17d941bea928fe42815a56982657c3eb946b5b0c","licence_paths":[]},{"branch":"main","commit":"6b6921f8d463314aa7c96234e1be25a25245f704","licence_paths":[]},{"branch":"normalizer-30bps","commit":"6a3c7b1f139d43b6ed448231e5c2cebbc8bcd91c","licence_paths":[]},{"branch":"rename-im-to-edge","commit":"4f575fd422aff4c95385ade954e923cc001b3205","licence_paths":[]},{"branch":"rescale-gbm-dt","commit":"b6fb0f82a542af6e7ecd28605cdb6bb7969f021a","licence_paths":[]},{"branch":"rustify","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","licence_paths":[]}],"afterSwap_file_occurrences":33,"unique_nonupstream":5,"candidates":{"21d7bc25a3c5c953f5711b58be2842c62e55e304d773261e729efc6a58d2593a":[{"branch":"rustify","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","path":"contracts/src/BoundedExpStrategy.sol"}],"fc5ea1e0b30d853b50a640d79fd6ee146bdae7bd7a2f10714ddb596fbd8f2386":[{"branch":"rustify","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","path":"contracts/src/DecayVolStrategy.sol"}],"864423ee8cc5dcbff1be42741629d5f5134569214cd021772e68800344fa7749":[{"branch":"rustify","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","path":"contracts/src/ExpVolStrategy.sol"}],"420f6586b8f316fffdc0cfcc3a75011895d869f0e824c650dea9534f091dc3a1":[{"branch":"rustify","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","path":"contracts/src/FastVolStrategy.sol"}],"1a9e8ba24931986c398505555b576c185129cd750ed5c9c40673db5eb61a07c2":[{"branch":"rustify","commit":"35b9625f7e3aa57a07627f530240b69e1761e702","path":"contracts/src/SqVolStrategy.sol"}]},"source_url":"https://api.github.com/repos/piotrostr/amm-challenge/branches?per_page=100"},{"fork":"atvinicius/amm-challenge","heads":[{"branch":"cleanup-pre-public","commit":"a3bb0103692324467c4f801d9803aec727df2a5e","licence_paths":[]},{"branch":"codex/increase-sims-default-1000","commit":"9f53c7b879bff34234611f17d84db076c68a59d2","licence_paths":[]},{"branch":"codex/security-hardening-upstream","commit":"17d941bea928fe42815a56982657c3eb946b5b0c","licence_paths":[]},{"branch":"main","commit":"78752c17e06b3f4b5d304291e29642f13693c2d7","licence_paths":[]},{"branch":"normalizer-30bps","commit":"6a3c7b1f139d43b6ed448231e5c2cebbc8bcd91c","licence_paths":[]},{"branch":"rename-im-to-edge","commit":"4f575fd422aff4c95385ade954e923cc001b3205","licence_paths":[]},{"branch":"rescale-gbm-dt","commit":"b6fb0f82a542af6e7ecd28605cdb6bb7969f021a","licence_paths":[]}],"afterSwap_file_occurrences":25,"unique_nonupstream":1,"candidates":{"c6a8136443126776fb5a32ecc16be78539d40671481ae8b87a16bb84738bdfd6":[{"branch":"main","commit":"78752c17e06b3f4b5d304291e29642f13693c2d7","path":"strategy_submission.sol"}]},"source_url":"https://api.github.com/repos/atvinicius/amm-challenge/branches?per_page=100"},{"fork":"alexanderzliu/amm-challenge","heads":[{"branch":"main","commit":"e15b10d2193387e14b863342adacf9508821b471","licence_paths":[]}],"afterSwap_file_occurrences":5,"unique_nonupstream":1,"candidates":{"72e777f283b5a9f4cb64670902d47a339907dbd810fb3fdaaf364fbb6c441fb1":[{"branch":"main","commit":"e15b10d2193387e14b863342adacf9508821b471","path":"my_strategy.sol"}]},"source_url":"https://api.github.com/repos/alexanderzliu/amm-challenge/branches?per_page=100"}],"calibration":{"mean":525.5258821780834,"expected":525.5258821780834,"gas":[{"role":"Baseline","callback":"afterInitialize","calls":1000,"ok":1000,"max_ok_gas":21796,"sum_ok_gas":21796000,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":10741746,"ok":10741746,"max_ok_gas":22592,"sum_ok_gas":242365461576,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":1000,"ok":1000,"max_ok_gas":21526,"sum_ok_gas":21526000,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":1000,"ok":1000,"max_ok_gas":185532,"sum_ok_gas":185532000,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":10445223,"ok":10445223,"max_ok_gas":151647,"sum_ok_gas":811927105393,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":1000,"ok":1000,"max_ok_gas":21530,"sum_ok_gas":21530000,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}],"n":1000,"seeds":[0,999],"sha256":"6dd68f77a70900319460215374143dbd5d924198450a46d9f5f91f6b1e3d35c3","source_url":"https://raw.githubusercontent.com/ChengHua926/amm-challenge/d34a5199c59a4c44d5336a25f1436b4ae1f21104/contracts/src/Strategy.sol"},"baseline":{"name":"RS2","sha256":"f24b6ca198b744c380842c3a17964a6dc21f311bb04984b26733afa3fee8eaf2","url":"https://api.imd.fun/artifacts/19f2ec857df536e8ab62ab1da89ec6623332521ce46849f15bccff402c63e1e5","screen":{"n":32,"start":900000,"mean_edge":542.3651755555325,"gas":{"max_ok":197184,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":21796,"sum_ok_gas":697472,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":347681,"ok":347681,"max_ok_gas":22592,"sum_ok_gas":7844739256,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":32,"ok":32,"max_ok_gas":21526,"sum_ok_gas":688832,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":32,"ok":32,"max_ok_gas":243099,"sum_ok_gas":7779168,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":334336,"ok":334336,"max_ok_gas":197184,"sum_ok_gas":39335592284,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":32,"ok":32,"max_ok_gas":21607,"sum_ok_gas":691424,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]}},"shortlist":{"n":256,"start":901000,"mean_edge":533.7351592392916,"gas":{"max_ok":202386,"oog":0,"afterSwap_oog":0,"raw_counters":[{"role":"Baseline","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":21796,"sum_ok_gas":5579776,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"afterSwap","calls":2778010,"ok":2778010,"max_ok_gas":22592,"sum_ok_gas":62680188392,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Baseline","callback":"getName","calls":256,"ok":256,"max_ok_gas":21526,"sum_ok_gas":5510656,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterInitialize","calls":256,"ok":256,"max_ok_gas":243099,"sum_ok_gas":62233344,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"afterSwap","calls":2678625,"ok":2678625,"max_ok_gas":202386,"sum_ok_gas":315113268856,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0},{"role":"Submission","callback":"getName","calls":256,"ok":256,"max_ok_gas":21607,"sum_ok_gas":5531392,"oog":0,"revert":0,"other_halt":0,"tx_error":0,"bad_return":0}]}}},"protocol":{"upstream_commit":"6b6921f8d463314aa7c96234e1be25a25245f704","wheel_sha256":"aedb68280aca34c110968f00148387c95885207913fb2cf19a1ab4c5cfd6887a","compiler":"solc 0.8.24; optimizer enabled runs 200; viaIR; evmVersion paris","validation":"Each exact candidate copied into contracts/src/Mine_<sha256>.sol and passed amm-match validate; no source modifications or dependencies from forks.","screen_seeds":[900000,900031],"shortlist_seeds":[901000,901255],"match":"Each arm independently runs amm_sim_rs.run_batch(arm, VanillaStrategy, configs, 8), in disjoint chunks of at most 20; never two mined strategies or RS2 in one market.","configs":"10000 steps; initial price 100, reserves 100 X / 10000 Y; mu 0, dt 1; default_rng(seed) uniform draws in order: mean retail size [19,21], arrival rate [0.6,1.0], sigma [0.000882,0.001008]; retail size sigma 1.2, buy probability 0.5; price seed=seed, retail seed=seed+1.","selection":"Top three gas-valid 32-seed paired mean gains; no tuning or code edits. Final code is the highest 256-seed paired mean among that fixed shortlist.","paired":"d_i = candidate edge_i - RS2 edge_i; se=sample std(d,ddof=1)/sqrt(n); worst=five smallest d with their seed.","gas":"Reset gas_stats immediately before each arm chunk; snapshot after return and read-only result extraction with no intervening EVM calls; sum counters, maximize max_ok_gas. max_ok is Submission/afterSwap only; any OOG or error invalidates the arm.","decomposition":"Uses supplied harness_source: reconstruct arbitrage edge as negative closed-form arb profit from each step fair price, preceding final spot/fees, and k=100*10000; retail edge=total edge-arb edge. Adapted reconstruction to use each unmodified source actual initial fee (bps): RS2 4, fixed 25, BoundedExp 15, DecayVol 3, ExpVol 5, FastVol 3, SqVol 8, Rookie Edge 2, DirContrarian 24. These are numerical reconstructions, not native trade-type edge counters.","method_source":"https://api.imd.fun/artifacts/33f54e81f3372088e9eced52c0174f310ac348af98ef5727b73785c088679194","decomposition_check":"Each of the nine arms run on seeds 11000..11031 for 100 steps with retail_arrival_rate input 0; check reconstructed arb equals total edge on paths with observed zero submission retail volume; actual initialization fee per source; gas reset and checked for each arm."},"decomposition_check":[{"sha256":"RS2","initial_fee":0.0004,"n_zero_retail":10,"max_abs_error":1.2987805275699316e-11,"oog":0,"max_ok":179096},{"sha256":"6fd32f2c52b2460046eb1b7fc133531f62e27404fd8efaa8633907691988a19d","initial_fee":0.0025,"n_zero_retail":10,"max_abs_error":8.179013022413528e-12,"oog":0,"max_ok":22580},{"sha256":"21d7bc25a3c5c953f5711b58be2842c62e55e304d773261e729efc6a58d2593a","initial_fee":0.0015,"n_zero_retail":10,"max_abs_error":1.3158696354764743e-11,"oog":0,"max_ok":72761},{"sha256":"fc5ea1e0b30d853b50a640d79fd6ee146bdae7bd7a2f10714ddb596fbd8f2386","initial_fee":0.0003,"n_zero_retail":10,"max_abs_error":1.6777690348135366e-11,"oog":0,"max_ok":94622},{"sha256":"864423ee8cc5dcbff1be42741629d5f5134569214cd021772e68800344fa7749","initial_fee":0.0005,"n_zero_retail":10,"max_abs_error":1.7601253787802307e-11,"oog":0,"max_ok":72730},{"sha256":"420f6586b8f316fffdc0cfcc3a75011895d869f0e824c650dea9534f091dc3a1","initial_fee":0.0003,"n_zero_retail":10,"max_abs_error":9.114237142782144e-12,"oog":0,"max_ok":72516},{"sha256":"1a9e8ba24931986c398505555b576c185129cd750ed5c9c40673db5eb61a07c2","initial_fee":0.0008,"n_zero_retail":10,"max_abs_error":8.12527822802167e-12,"oog":0,"max_ok":82586},{"sha256":"c6a8136443126776fb5a32ecc16be78539d40671481ae8b87a16bb84738bdfd6","initial_fee":0.0002,"n_zero_retail":10,"max_abs_error":1.2204459665099421e-11,"oog":0,"max_ok":127533},{"sha256":"72e777f283b5a9f4cb64670902d47a339907dbd810fb3fdaaf364fbb6c441fb1","initial_fee":0.0024,"n_zero_retail":10,"max_abs_error":1.1151246592788766e-11,"oog":0,"max_ok":33366}],"notes":["All four named forks cloned with all remote branches; scanned every .sol at each branch head using function-afterSwap detection, excluded hashes matching any upstream .sol at the pinned commit, deduplicated exact source bytes by SHA-256. No fork exceeded 50 candidates; no candidate dropped.","Fork scripts and packages were not executed or installed. Only candidate Solidity was compiled and simulated in the pinned trusted checkout.","No seed >=5000000 was used. This item follows the explicit fork-mining protocol and compares against RS2, not STACK; it is not a fresh-block STACK confirmation or a leaderboard submission.","Best means highest observed 256-seed paired mean among the three shortlisted files, even if negative. No top-10 gain is inferred.","The preloaded screening harness used its default 4-bps initial fee only for unused screen decompositions; total edge, d32, selection and gas are unaffected. Shortlist deltas and the independent decomposition checks use actual per-source initialization fees.","No repository-level licence file was found at the inspected heads; MIT is declared by SPDX in every candidate source. Author metadata identifies the fork head commit author, not an independently verified sole author."],"paired":{"n":256,"mean_diff":-7.564545284368279,"se":0.10280381194003085,"worst":[{"seed":901068,"d":-13.586148595762893},{"seed":901033,"d":-12.085894160903536},{"seed":901200,"d":-11.735979786892926},{"seed":901217,"d":-11.315180298133555},{"seed":901070,"d":-11.221952660071224}]},"gas":{"max_ok":150946,"oog":0},"retail_edge_delta":{"mean":1.0408719011457876,"se":0.07694585092171627},"arb_edge_delta":{"mean":-8.60541718551407,"se":0.08617217772840877},"beats_RS2":false}