{"credit":"Taylor (gtmcknight), github.com/gtmcknight/amm-sim@4812a6382311624e1506aca131ca35c378f930d9 research/solved: the solved policy, real.py filter, tellpol posterior, qm tables and replica. LEANBASE (A/efb8e653...) is the network's replica policy built on it; this item only subclasses it.","base":{"name":"LEANBASE","artifact":"https://api.imd.fun/artifacts/efb8e653f8fd061cecf3e92b186470c9c96c5188523364b60ed101e9672869aa","leanbase_py_sha256":"ba015769f7981d7798acbbc9aff8c0e0c59825bb1541d55bcdef49311d7a04bc (checked)","research_commit":"66604b3426d8e97a73e2c39940b9b4dece51cc73 (fetch.sh: 34 files, 0 mismatched)","options":"soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35","rival":"replica 30 bps rival"},"rule":{"pick":"AGE","state_kept":"AGE: one value, router_t = timestamp of the last binding router bound (initially 0); age = max(0, t - router_t) is derived. LEANBASE (stalerival.py) already computes router_t/router_age in Python; a contract that hardcodes the 0.35 pull would add this one timestamp (fits in a packed slot). Pull weights are constants. THR (not picked): 2 bits (pulls this step, saturating at 2) + a bound bit, beside the existing synced flag. HYP (not picked): no state.","per_callback":"Only on a callback the tell reads as retail (not arb), after LEANBASE's filter and lookup: cand = s*(1-old_bid_fee)/0.997 on isBuy, else s*0.997/(1-old_ask_fee), s = reserveY/reserveX from WAD integers. prior = old rival estimate, clipped into [exp(m)*0.997, exp(m)/0.997] on the step's first callback. binding = cand<prior (buy) or cand>prior (sell); if binding, router_t = t. age = max(0, t-router_t). If gap = ln(cand/s2h) is on the non-binding side (gap>0 on buy, <0 on sell): alpha = 0.7*age/(age+1) (LEANBASE: 0.35); ln s2h += alpha*gap; synced = true; re-look up the table with phase 1 (first retail of the step) or 2. Extra arithmetic over LEANBASE: 1 add (age+1), 1 mul, 1 div. age=0 gives alpha=0 (the synced re-lookup still runs, as in the AGE artifact). Arb callbacks: unchanged.","arms_defined":{"AGE":"a0=0 ainf=0.7 tau=1 in stalerival's alpha=a0+(ainf-a0)*age/(age+tau), i.e. alpha=0.7*age/(age+1); options only, no new code","THR":"synced tables (1s/2s) iff a binding bound happened this step or >=2 pulls this step (agethr.py thr=1)","AGE+THR":"both","AGE+THR+HYP":"both + first-callback band clip replaced by m+c+sd*psi((r-m-c)/sd)-sd*psi((r-m+c)/sd), psi(z)=(z+sqrt(z*z+2/pi))/2, c=ln 0.997, sd=sqrt(v) (softclip.py clip=3 vs=1)"}},"choose":{"seeds":[64000,65023],"n":1024,"paired_vs":"LEANBASE, same seeds","base_mean_edge":539.0183,"arms":{"AGE":{"mean_diff":0.015715,"se":0.005707,"min":-0.779904},"THR":{"mean_diff":0.003774,"se":0.00334,"min":-0.583738},"AGE+THR":{"mean_diff":0.01472,"se":0.006031,"min":-0.820775},"AGE+THR+HYP":{"mean_diff":0.01413,"se":0.006226,"min":-0.816562}},"selection":"highest mean_diff on choose seeds, shorter rule when within one se: AGE (0.0157) is highest and also the shortest; AGE+THR (0.0147) and AGE+THR+HYP (0.0141) are within one se but longer.","combos_minus_AGE":{"AGE+THR":{"mean_diff":-0.000996,"se":0.003304},"AGE+THR+HYP":{"mean_diff":-0.001586,"se":0.003688}}},"frozen":{"pick":"AGE","params":{"a0":0,"ainf":0.7,"tau":1,"soft":1,"qm":"qm_k1e-5.json"},"code_sha256":"18354cade5f90452c9273f1a6c381f67a1c2edd38ac5037c017a6573d302bd72","code_sha256_of":"agethr.py (THR/HYP arms; AGE itself runs on LEANBASE code with options only, leanbase.py ba015769..., stalerival.py in deps)","params_sha256":"03b15a0071fc82366c18e91a43e699f43cd8b443c136a2d5ac75dbe97f94949e","deps_sha256":{"agethr.py":"18354cade5f90452c9273f1a6c381f67a1c2edd38ac5037c017a6573d302bd72","leanbase.py":"ba015769f7981d7798acbbc9aff8c0e0c59825bb1541d55bcdef49311d7a04bc","stalerival.py":"d124a171d35b024daed840e5449d352b2b5e50a68ce98c8a9aaafaf3419d23da","softclip.py":"b9a3c959a6645592c846bcd5c7b8510b98fdac4fb1b02452f922d9a28c841323","lean_tell.py":"b70054f8c0561779e40c4c8df3f41ab08da05b9aef591816ac6c9034beb40a95","tellpol.py":"7d5961c45bec56292533e65607245ad119b8733c760a5bf28f76a2e07bc3960b","tellref.py":"4867a33106ce2597863b8d7c8fb396288954b98f291714801fae8820f1f47aa3","real.py":"6a4a0f0e7f8b43d38e5eaa9d8b2e847a0771aee7f89551b122fe89bfe7969b5f","replica2.py":"54380c8755f4e42e9a0426759e918eacd2c5f915b7f04e5d0501c394c5846b40","run.py":"91133e4ef485626226679d73349b5b4e374d9713ac5d7e9d36a39e1afd75933c","evalpol.py":"79a96efe8c543aee125c937554688b37ec2e7df44df4f3435265bba6eb012bf3","exp.py":"4d81d186580f7d974e99ca2ad26b1e50eb484aa5bfb670e6b810dc56b5596541","qm_k1e-5.json":"5ff53e42ca87390e5f65d1caa3f7a480e67a8212fb0670274dfd562b05ba1afd","pol_mid.json":"efbb5ee102db4d312f64565d9bf7232b6becbe02b624164f744a402bbbf2983b"},"frozen_utc":"2026-11-10T17:47:30+00:00","all_arm_settings":{"BASE":"leanbase:Policy soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35","AGE":"agethr:Policy soft=1 qm=qm_k1e-5.json a0=0 ainf=0.7 tau=1","THR":"agethr:Policy soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35 thr=1","AGE+THR":"agethr:Policy soft=1 qm=qm_k1e-5.json a0=0 ainf=0.7 tau=1 thr=1","AGE+THR+HYP":"agethr:Policy soft=1 qm=qm_k1e-5.json a0=0 ainf=0.7 tau=1 thr=1 clip=3 vs=1"},"rechecked_after_report":"all 14 dependency sha256 unchanged"},"report":{"seeds":[10000,12047],"n":2048,"order":"32 blocks of 64 in increasing order, all five policies (BASE + 4 arms) on a block before the next; run once after the freeze; 16.2 minutes of work","base_mean_edge":536.6034,"arms":[{"name":"AGE (pick)","minus_base":{"mean_diff":0.019709,"se":0.004066,"min":-2.20673}},{"name":"THR","minus_base":{"mean_diff":0.005196,"se":0.002449,"min":-0.669424}},{"name":"AGE+THR","minus_base":{"mean_diff":0.0223,"se":0.004327,"min":-2.255583}},{"name":"AGE+THR+HYP","minus_base":{"mean_diff":0.024997,"se":0.004471,"min":-2.351834}}],"pick_worst5":[[11701,-2.20673],[10300,-0.810635],[11695,-0.761734],[10233,-0.738787],[10879,-0.721874]],"pick_blocks_positive":"25 of 32","combos_minus_AGE":{"AGE+THR":{"mean_diff":0.00259,"se":0.002431},"AGE+THR+HYP":{"mean_diff":0.005287,"se":0.002656}},"note":"On report seeds AGE+THR+HYP is +0.0053 se 0.0027 over AGE (about 2 se) and THR alone +0.0052 se 0.0024; on choose seeds the same contrasts were -0.0016 se 0.0037 and +0.0038 se 0.0033. By the rule fixed before the report the pick stays AGE; the stacked arm is a candidate for a fresh choose/report split, not a result."},"cost":{"pick":"AGE","extra_storage_words":1,"extra_storage_note":"1 = last-binding timestamp, relative to a contract with a constant 0.35 pull (0 relative to LEANBASE Python, which already keeps router_t); can pack into an existing slot. Estimate, no Solidity written.","worst_ops_per_callback":"retail callback with a pull: binding test 2 compares (+2 compares for the clip on a first callback) and 1 store when binding, then 1 sub, 1 add, 1 mul, 1 div for alpha; no log/exp/loop/table lookup added (the re-lookup after a pull is LEANBASE's)","runs_on_peak_path":true,"runs_on_peak_path_note":"it runs on retail callbacks that also do LEANBASE's second table lookup, assumed to be the peak path; increment estimated by op count, not measured","other_arms":{"THR":"0 words (bits in the synced word), +1 add, 1 saturate, 1 compare","HYP":"0 words; first callback: 1 sqrt(v) + 2 sqrt(z*z+2/pi) + ~10 mul/add replacing 2 compares"}},"checks":{"fetch":"Taylor research at 66604b34: 34 files, 0 sha256 mismatches; leanbase.py sha256 = ba015769... as LEANBASE states; qm_k1e-5.json 5ff53e42... and pol_mid.json efbb5ee1... equal LEANBASE's table_sha256","off_switch":"agethr.py with thr=0 clip=0 a0=ainf=0.35 gives rows identical to leanbase:Policy on 16 seeds 64900..64915 (every field)","thr_equals_source":"THR (agethr thr=1) rows identical to the THR artifact's blend.py thr60add (mode=thr thr=0.6 cadd=1) put on LEANBASE, 16 seeds 64900..64915; differs from BASE on 16/16","age_equals_source":"AGE minus LEANBASE per seed equals the AGE artifact's rows (measured on stalerival.py) on 2047 of 2048 report seeds (|diff|<1e-9); the exception is seed 10942, the seed where LEANBASE itself differs from stalerival.py (-0.2600 there, -0.2613 here)","hyp_code":"softclip.py taken verbatim from the HYP artifact's code_zb64; arm S3 = clip=3 vs=1","blind":"every policy runs through run.py's Blind wrapper, which hands it only (is_buy, amount_x, amount_y, timestamp, reserve_x, reserve_y); no arb flag, true price, rival spot or run parameters (needs_flag False). Structural check; no garbled-input run.","freeze":"code and settings sha256 written before the first report seed; 14 dependency hashes rechecked unchanged after the report","report_protocol":"2048 seeds, 32 blocks of 64 in order, all arms per block, run once; 16.2 min < 40 min"},"advance":true,"advance_checks":{"mean_diff":0.019709,"mean_diff_ge_0.015":true,"mean_minus_2se":0.011577,"mean_minus_2se_positive":true,"reads_no_hidden_input":true,"named_checks_hold":true,"caveat":"+0.020 per seed on the replica; the goal needs about +0.2 to reach 528.4152, so this is a small additive lever. Its effect equals the earlier AGE artifact on stalerival.py: it confirms that result on LEANBASE rather than adding a new one."},"code_zb64":"eNrFWVmT2zYS/itd9kNIibo4nrFHY00lu3bsrXXilO192GSyKoiERox5haQ0Ryr57fs1DgqkNI6TPEQ+RAKNPj70BeiXR+JaNptqXN49mtOjK/Xnq1cvaUIfXr/D/6//+x1VyU6ko6YS0cckv6Zqm8qaipzevPzq23989f7lmN43cZqsMJbeja/yq/yflYyTZk4fxF1aVORdN1n0MU+uN40f0HXSbLarcVRkk/34RGTZqE6yL588m4Xi7ORZeDKbnYVP5Ox0eiYiMTuZReLkNDp5+mx9fjKNz6/yStZSVNFmUhfpTsbkVVKkMITWSdrIKqBGpmlZqKGyqDGUFBj9OaNGrGBCQJUs0yQS/rg1hRaUSpGvRC2x7Cr36o0IT89oJaaz06dn5+PxGBY0G0m5bG6K6uMXteUCGfi6o2JNSVNTVOSMWHMB6qSmrIgBm0KI6u0qSkV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+soeiHFvRDdFe7R8/dY9/JseZKFIBgarPUFT9RPMH9fWUXSd5CJND1m6Whz5wengJiqgT//SdPRnpb/l16T+b0NHfhX6Kz8K9e0cH9Wc77Z//T/ejoi+","code_encoding":"base64(zlib(JSON {path: text})): agethr.py (THR/HYP arms, sha256 18354cade5f90452c9273f1a6c381f67a1c2edd38ac5037c017a6573d302bd72) and softclip.py (verbatim from A/4f6244a3...). The pick AGE needs no module beyond LEANBASE: options a0=0 ainf=0.7 tau=1 on stalerival.py.","run":["R=https://raw.githubusercontent.com/gtmcknight/amm-sim/66604b3426d8e97a73e2c39940b9b4dece51cc73/research; curl -fLsS $R/tell/fetch.sh -o fetch.sh; sh fetch.sh $R amm","decode LEANBASE reference_zb64 into amm/, then this code_zb64 into amm/","cd amm; PROCS=4 python3 -I run.py leanbase:Policy 10000 64 base.json soft=1 qm=qm_k1e-5.json a0=0.35 ainf=0.35","PROCS=4 python3 -I run.py leanbase:Policy 10000 64 age.json soft=1 qm=qm_k1e-5.json a0=0 ainf=0.7 tau=1; python3 -I pair.py age.json base.json"],"seeds_used":{"checks":[64900,64915],"choose":[64000,65023],"report":[10000,12047],"engine":[],"report_reused_for_selection":false},"not_done":["No Solidity port, gas, size, T/F/G gates or engine seeds: Python replica item only; cost is an op-count estimate","No paired comparison against the lb-4 contract or qt1: replica LEANBASE only, as the item asks","No garbled-input run; blindness is structural (Blind wrapper)","AGE+THR+HYP looks better on report seeds (+0.0053 se 0.0027 over AGE) but not on choose seeds; it would need new choose and report seeds","No submission anywhere"]}