{
  "notes": "EPISODE 5 (goal: lift NP2 on Paradigm AMM fee challenge; need paired +5.8 for top 10, +9.6 for 1st vs NP2 526.1156 on seeds 0..999).\nSTATE AT START: handed ep3-base/harness-a (ran), harness-b (blocked: its host had no network egress, so the brief was fine), ep1-rules/harness (ran, with the gate line dropped by the worker), ep4-flow/both-b and ep4-lean/cap-a (both ran). Still running: ep3-base/decomp, ep3-oracle (2), ep3-mech canary (5) with 11 held, ep4-flow (3), ep4-lean (3). Items used 41 before this episode; this episode cancels ep3-mech (-11 held) and adds 16 => 46 of 400; 5 episodes left after this one.\nWHAT WAS LEARNED:\n1. The mended 1159-char script works: three machines ran the simulator with it. Speed with 8 workers: 0.075-0.16 s per sim (11,000-47,000 sims per hour); a 2,000-seed paired confirm takes 5-10 minutes, so an item can afford grids of a few hundred seeds per point plus the confirm. se calibration (each vs Vanilla, 2,000 seeds): a +1 bps BASE_FEE change gives mean_diff -0.065 se 0.0105 (per-seed diff sd 0.47); +5 bps gives -2.68 se 0.023 on 4,000 seeds. So for small edits se on 2,000 seeds is ~0.01-0.03 and t>=2 needs mean_diff >= ~0.05; a real +1.0 is unmistakable. Two 2,000-seed blocks agreed within 1.2 combined se: the pairing transfers.\n2. METHOD CORRECTION (requester 17:45Z): paired means each strategy run SEPARATELY vs the compiled 30 bps VanillaStrategy on the same seed configs, d = edge(cand) - edge(NP2) per seed. The ep3/ep4 briefs said \"pair via run_batch\" and workers read it as run_batch(candidate, NP2) in ONE market, which measures flow stealing, not the board score (both-b: +35.0 head-to-head, but -2.6 when each is run vs Vanilla). Every result measured head-to-head is invalid; ep3-mech and ep3-oracle were briefed with the same wording, so treat their numbers as invalid unless the item states the separate-vs-Vanilla method. From now on every brief carries the MEASURE paragraph (build_config draws, get_vanilla_bytecode_and_abi, two separate run_batch calls, NEVER run_batch(cand,np2)); it is in artifacts/goal/episodes/005/decisions.json.\n3. Board-study levers FAIL as direct edits (each vs Vanilla, 256 tuning seeds): flattening the fee's flow slope to ~1.1 bps per 10k retail Y: -2.5 to -6.5 depending on the transform; a 0.2 bps bid->ask lean shift: -0.05 (se 0.01); a 12 bps bid-ask cap with stuck-side pull (cap-a): -47 (and the pull-only variant -218). So the leaders' flatter, centred fees are a symptom of better tracking, not a dial. Requester's direction: find where pHat lags the true price by situation, fix tracking, finish the oracle bound.\n4. CH identified: ChengHua926/amm-challenge Strategy.sol @d34a5199c59a4c44d5336a25f1436b4ae1f21104 (raw.githubusercontent.com/ChengHua926/amm-challenge/d34a5199c59a4c44d5336a25f1436b4ae1f21104/contracts/src/Strategy.sol), sha256 6dd68f77..., 525.525882178 on seeds 0..999 reproduced by two workers. NP2 = 526.1155722 (sha256 51f1c1a9d4999ee460eb8bbc66880da8074b173399a4f5d71f96671482e18ac0), TWO = 525.7767611 (sha256 6f23c204...); NP2 - TWO = +0.339 se 0.023 on 0..999. NP2 vs Vanilla on 0..999: mean bid 36.48, ask 35.39 bps, 103 runs with mean bid > 40.\n5. Reference harness: ep3-base/harness-a's pair.py (SimulationConfig with the three default_rng draws, seed=s; batches of 16; 8 workers; edges[\"submission\"]); ep1-rules/harness's pair.py uses build_config(seed, gbm_sigma, retail_arrival_rate, retail_mean_size), equal to MatchRunner's configs field by field. Rust keeps all step snapshots, so chunk run_batch.\nDECIDED:\n- cancel ep3-mech: its 11 held items would run on the head-to-head wording; the 5 canary results still arrive (merge-01) and their deltas/code may be worth re-measuring, but their tuning optimised the wrong objective.\n- ep5-diag (4 items, no canary): err-a / err-b = NP2's pHat error vs the true price by situation (arb-first, retail-first, retail-later prints; silent steps by length; arb share of prints; separability of arb vs retail first prints by tradeRatio / silent steps / |pImplied-pHat|/sigmaHat; edge loss by error bucket) on seeds 10000..10199 / 10200..10399 via a local measurement patch of the engine. oracle-price-c = NP2 with pHat := true price (bound on tracking), confirm 2540000..2541999; oracle-full-c = knows price and sigma, fee per side = gap to fair + tuned g (bound on everything), confirm 2550000..2551999. Both report arb and retail edge separately.\n- ep5-mech (12 items = 6 tracking-first mechanisms x 2 machines, canary = arbfirst-a, silence-a, kalman-a, prespot-a, evfee-a; then nextmix-a and the -b copies; merge groups of 6, ranking by t, marking head-to-head items invalid, copying delta+sha256+code of items with mean_diff >= 2se). Mechanisms: arbfirst (P(arb) for first-in-step prints from silent steps, sigmaHat, band and tradeRatio; alpha = P(arb)*A1 + (1-P)*A0); silence (g silent steps => fair stayed in the band: pull pHat to band centre by 1-(1-w1)^g); kalman (lnP + variance in slots, R small for likely-arb prints, R = (half band + impact)^2 for retail); prespot (retail prints: update toward the pre-trade spot recovered from reserves and amounts, not the fee-adjusted post-trade spot); evfee (per-side f maximising f*share(f)*flow - P(arb)*loss with the exact smooth router split); nextmix (fee serves the next trade: mix arb-next-step and retail-this-step regimes by Poisson(lambdaHat)).\nCONFIRM SEED BLOCKS (never reuse): ep1-mech 2000000..2229999 (cancelled, may have run); harness calibration ep1 2900000..2909999; ep2-oracle 2230000..2249999 (cancelled); ep3-base 2250000..2253999 and 2260000..2263999; ep3-oracle 2270000..2289999; ep3-mech 2300000..2459999 (cancelled, canary may have run); ep4-flow 2460000..2499999; ep4-lean 2500000..2539999; ep5-diag oracle-price-c 2540000..2541999, oracle-full-c 2550000..2551999; ep5-mech item i (order: arbfirst-a, silence-a, kalman-a, prespot-a, evfee-a, nextmix-a, arbfirst-b, silence-b, kalman-b, prespot-b, evfee-b, nextmix-b) 2560000+i*10000..+1999 (to 2679999). NEXT FREE BLOCK: 2680000 (allocate 10000 per item; skip 2900000..2909999). Tuning seeds: 10000..99999 (ep5-diag err items use 10000..10399).\nBRIEF BUDGET (hard, <=3000 filled): the ep5 template (NP2 def 400 + SETUP with the script 1430 + MEASURE 640 + task + return) leaves ~420 chars for a mechanism text with a 7-digit block; the longest filled brief this episode is ~2980. Reuse the ep5 template from decisions.json; cut before adding.\nREADS REQUESTED for ep6: ep3-base/decomp; ep3-oracle/oracle-price, oracle-full; ep3-mech/merge-01; ep4-flow/flat-a, flat-b, both-a; ep4-lean/lean-a, lean-b, cap-b; all 4 ep5-diag items; ep5-mech/merge-01, merge-02 and all 12 ep5-mech items.\nEP6 PLAN: (a) For every handed result, first check its method: separate-vs-Vanilla numbers count, head-to-head numbers do not (keep the delta/code for re-measurement only if the idea is still live). (b) Rank ep5-mech by t on its confirm block; a mechanism with both copies at mean_diff >= 2se is a winner; one positive copy = one retune from the better copy's delta; both t<1 = drop. (c) Use err-a/b to target the next tracking mechanisms at the situation with the largest error-weighted loss (expect retail-first prints and long silences), and oracle-price-c vs oracle-full-c to split the +9.6 into tracking vs fee policy: if oracle-price-c < +5, tracking alone cannot reach top 10 and ep6 must weight evfee/nextmix-style fee policy; if oracle-full-c is near +9.6 the leaders are near the bound. (d) ep6-ep7: stack winners (each stacking item = NP2 + the winners' deltas copied from the results, confirm on a fresh block from 2680000), two machines each; ep8-9: final 4,000-seed confirmation of the best stack; the requester submits any file >= +1.0 over NP2 on 4,000 fresh seeds and reports the board score as a note. Keep ~100 items for that. Finish when a candidate shows mean_diff - 2se >= 5.8 vs NP2 or the budget nears exhaustion; the write-up gives final code, sha256, paired{n,mean_diff,se,worst}.\n",
  "spawn": [
    {
      "name": "ep5-err",
      "brief": "NP2 = `code` of https://api.imd.fun/artifacts/528a6da78583c6142644a552c86670f9d25c20e39e92f4de44deae05ddc8cecd plus `code` of https://api.imd.fun/artifacts/da313379a2e69e9286668865e06b18dfcae25732c82b934b0fd9c2ef0d8c2ff5 from `// Interior retail routing` to (excl.) `uint256 tradeRatio =`, inserted before TWO's `uint256 tradeRatio =`; sha256 51f1c1a9...; 526.1156 on seeds 0..999 vs Vanilla (check).\nSETUP (this script, not the objective's): clone github.com/benedictbrady/amm-challenge @6b6921f8d463314aa7c96234e1be25a25245f704 in your workspace (not /tmp); save as scratch/setup.sh; `sh scratch/setup.sh` once from the checkout root; prefix later commands with `. scratch/env.sh && `.\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nTASK: measure where NP2's fair-price estimate pHat (slots[5]) errs. Patch your local engine to log each trade: step, true price, spot before and after, side, amountY, arbitrageur or retail, pHat after the call (slot 5 via the EVM, or a Python port of afterSwap checked against NP2's fees). Seeds {{seeds}}, NP2 vs Vanilla, MatchRunner._build_configs draws with rng=default_rng(s), seed=s. Report in bps: (a) RMS and mean signed ln(pHat/p) right after each print, by kind: arb first-in-step, retail first-in-step, retail later; (b) at the end of silent steps by silence length 1, 2, 3-5, 6+; (c) arbitrageur share of all prints and of first-in-step prints; (d) precision/recall of the best threshold on tradeRatio, on silent steps g, on |pImplied-pHat|/sigmaHat, telling arb from retail first-in-step prints; (e) per-step arb loss and retail take by |error| bucket <5, 5-15, 15-30, >30 bps.\nRETURN markdown sections: method (<=600 chars), results (tables a-e), code (patch and scripts), blocked ({step,error} or null; if blocked, no invented numbers), next (<=3 testable fixes to NP2's update, each tied to a pattern found).",
      "items": [
        {
          "key": "err-a",
          "vars": {
            "seeds": "10000..10199"
          }
        },
        {
          "key": "err-b",
          "vars": {
            "seeds": "10200..10399"
          }
        }
      ],
      "output": {
        "format": "markdown",
        "maxBytes": 64000
      }
    },
    {
      "name": "ep5-oracle",
      "brief": "NP2 = `code` of https://api.imd.fun/artifacts/528a6da78583c6142644a552c86670f9d25c20e39e92f4de44deae05ddc8cecd plus `code` of https://api.imd.fun/artifacts/da313379a2e69e9286668865e06b18dfcae25732c82b934b0fd9c2ef0d8c2ff5 from `// Interior retail routing` to (excl.) `uint256 tradeRatio =`, inserted before TWO's `uint256 tradeRatio =`; sha256 51f1c1a9...; 526.1156 on seeds 0..999 vs Vanilla (check).\nSETUP (this script, not the objective's): clone github.com/benedictbrady/amm-challenge @6b6921f8d463314aa7c96234e1be25a25245f704 in your workspace (not /tmp); save as scratch/setup.sh; `sh scratch/setup.sh` once from the checkout root; prefix later commands with `. scratch/env.sh && `.\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE (other methods are discarded): configs as MatchRunner._build_configs with rng=default_rng(s), seed=s; vanilla=get_vanilla_bytecode_and_abi()[0]. run_batch(cand,vanilla,cfgs,8) and run_batch(np2,vanilla,cfgs,8) SEPARATELY, 16 seeds a call; d = cand edges['submission'] minus NP2's; report n, mean(d), se=std(d,ddof=1)/sqrt(n), min(d). NEVER run_batch(cand,np2): a shared market is not the board score.\nTASK: {{task}} Confirm vs NP2 on seeds {{seeds}} as above.\nRETURN sections: method (<=600 chars), code (patch and strategy), paired (json {n,mean_diff,se,worst} as above), decomposition (arb edge, retail edge, mean bid/ask bps, both strategies, confirm seeds), blocked ({step,error} or null; if blocked n 0, no invented numbers), next (<=3 ways a real contract could capture part of this bound).",
      "items": [
        {
          "key": "oracle-price-c",
          "vars": {
            "task": "ORACLE BOUND for tracking. Patch your local engine so the strategy can read the true fair price at each afterSwap (e.g. written to a storage slot before the call). Candidate = NP2 with pHat set to the true price at every print; sigmaHat and all fee logic unchanged; tune nothing. Bounds what better estimation alone buys.",
            "seeds": "2540000..2541999"
          }
        },
        {
          "key": "oracle-full-c",
          "vars": {
            "task": "ORACLE BOUND for everything. Patch your local engine so the strategy reads the true fair price and sigma at each afterSwap. Candidate: per side fee = distance from that side's spot to the true price (0 if that side is safe) + g; grid-tune g, then g by sigma and lambdaHat, on seeds 10000..10499; freeze. Bounds what any strategy can earn.",
            "seeds": "2550000..2551999"
          }
        }
      ],
      "output": {
        "format": "markdown",
        "maxBytes": 64000
      }
    },
    {
      "name": "ep5-mech",
      "brief": "NP2 = `code` of https://api.imd.fun/artifacts/528a6da78583c6142644a552c86670f9d25c20e39e92f4de44deae05ddc8cecd plus `code` of https://api.imd.fun/artifacts/da313379a2e69e9286668865e06b18dfcae25732c82b934b0fd9c2ef0d8c2ff5 from `// Interior retail routing` to (excl.) `uint256 tradeRatio =`, inserted before TWO's `uint256 tradeRatio =`; sha256 51f1c1a9...; 526.1156 on seeds 0..999 vs Vanilla (check).\nSETUP (this script, not the objective's): clone github.com/benedictbrady/amm-challenge @6b6921f8d463314aa7c96234e1be25a25245f704 in your workspace (not /tmp); save as scratch/setup.sh; `sh scratch/setup.sh` once from the checkout root; prefix later commands with `. scratch/env.sh && `.\nset -eu;R=$PWD/scratch;mkdir -p $R/tmp $R/bin $R/solcx\necho \"export TMPDIR=$R/tmp XDG_CACHE_HOME=$R/xc UV_CACHE_DIR=$R/uvc UV_PYTHON_INSTALL_DIR=$R/uvpy RUSTUP_HOME=$R/rustup CARGO_HOME=$R/cargo SOLCX_BINARY_PATH=$R/solcx VIRTUAL_ENV=$PWD/.venv PATH=$PWD/.venv/bin:$R/bin:$R/cargo/bin:\\$PATH\" >$R/env.sh;. $R/env.sh\ncommand -v uv >/dev/null||{ curl -LsSf https://github.com/astral-sh/uv/releases/latest/download/uv-x86_64-unknown-linux-gnu.tar.gz|tar --no-same-owner -xz -C $R/tmp;cp $R/tmp/uv-*/uv $R/bin/;}\ncc --version >/dev/null 2>&1||{ curl -Ls https://micro.mamba.pm/api/micromamba/linux-64/latest -o $R/tmp/mm.tbz;python3 -c \"import sys,tarfile;tarfile.open(sys.argv[1]).extract('bin/micromamba',sys.argv[2])\" $R/tmp/mm.tbz $R;MAMBA_ROOT_PREFIX=$R/mamba $R/bin/micromamba create -yq -p $R/cenv -c conda-forge gcc;ln -sf $(ls $R/cenv/bin/*gcc|head -n1) $R/bin/cc;}\ncommand -v cargo >/dev/null||{ curl -sSf https://sh.rustup.rs|sh -s -- -y --profile minimal --no-modify-path;}\nuv venv --python 3.12 .venv;uv pip install -e . maturin\nmaturin develop --release --uv --manifest-path amm_sim_rs/Cargo.toml\namm-match validate contracts/src/StarterStrategy.sol\nMEASURE (other methods are discarded): configs as MatchRunner._build_configs with rng=default_rng(s), seed=s; vanilla=get_vanilla_bytecode_and_abi()[0]. run_batch(cand,vanilla,cfgs,8) and run_batch(np2,vanilla,cfgs,8) SEPARATELY, 16 seeds a call; d = cand edges['submission'] minus NP2's; report n, mean(d), se=std(d,ddof=1)/sqrt(n), min(d). NEVER run_batch(cand,np2): a shared market is not the board score.\nTASK: add to NP2 only this ONE mechanism: {{mech}} Tune on seeds 10000..99999 only; freeze; confirm ONCE on fresh seeds {{block}}..{{block}}+1999.\nRETURN sections: delta (<=900 chars: changed lines), code (full .sol), sha256 (code text), tuning (constants, n, mean_diff, se per point), paired (json {n,mean_diff,se,worst}, confirm block, as above), blocked ({step,error} or null; if blocked n 0, no invented numbers), next (one idea).",
      "items": [
        {
          "key": "arbfirst-a",
          "vars": {
            "mech": "ARB-FIRST: a first-in-step print may be the arbitrageur, whose implied price is exact. P(arb) from silent steps g since the last print, sigmaHat and the fee band (chance the price left the band) and from tradeRatio (arbs trade little); alpha = P*A1 + (1-P)*A0, A1 near 1; tune A1, A0, prior.",
            "block": "2560000"
          }
        },
        {
          "key": "silence-a",
          "vars": {
            "mech": "SILENCE: g silent steps before a print mean the fair price stayed inside [spot*(1-bid), spot/(1-ask)] at each (the arbitrageur trades on any gap beyond the fee). Before the print's update pull pHat toward the band centre by w=1-(1-w1)^g and shrink the update's gate/alpha; tune w1, cap on g, shrink.",
            "block": "2570000"
          }
        },
        {
          "key": "kalman-a",
          "vars": {
            "mech": "KALMAN: keep lnP and its variance V in free slots; V += sigmaHat^2 per elapsed step; measurement = pImplied, noise R small for likely-arb prints (first in step, small tradeRatio), R = (half band + impact)^2 for retail; gain V/(V+R) replaces the fixed alphas 0.27/0.06/0.12; tune both R scales, V floor.",
            "block": "2580000"
          }
        },
        {
          "key": "prespot-a",
          "vars": {
            "mech": "PRE-SPOT: for a retail print the fair price lies in the pre-trade band, so pImplied is biased in the trade's direction by its own impact. Recover the pre-trade spot from reserves and amounts; for non-first prints (and first prints with large tradeRatio) update pHat toward it or the band centre; tune alphas.",
            "block": "2590000"
          }
        },
        {
          "key": "evfee-a",
          "vars": {
            "mech": "EV-FEE: per side choose f maximising f*share(f)*E[retail flow next step] - P(arb hits that side next step)*E[arb loss]; share(f) = exact smooth router split vs the 30 bps pool (equal reserves: 10bps 75%, 60 12%); P(arb) from sigmaHat and that side's spot-to-pHat gap; blend with NP2's fee by w; tune w, loss.",
            "block": "2600000"
          }
        },
        {
          "key": "nextmix-a",
          "vars": {
            "mech": "NEXT-MIX: the fee returned after a print serves the next trade: the arbitrageur next step (if the price leaves the band) or another retail order this step (P via Poisson(lambdaHat)). Quote the mix of the two regimes: cheaper on the side the arbitrageur cannot hit, protective on the other; tune mix weight, offsets.",
            "block": "2610000"
          }
        },
        {
          "key": "arbfirst-b",
          "vars": {
            "mech": "ARB-FIRST: a first-in-step print may be the arbitrageur, whose implied price is exact. P(arb) from silent steps g since the last print, sigmaHat and the fee band (chance the price left the band) and from tradeRatio (arbs trade little); alpha = P*A1 + (1-P)*A0, A1 near 1; tune A1, A0, prior.",
            "block": "2620000"
          }
        },
        {
          "key": "silence-b",
          "vars": {
            "mech": "SILENCE: g silent steps before a print mean the fair price stayed inside [spot*(1-bid), spot/(1-ask)] at each (the arbitrageur trades on any gap beyond the fee). Before the print's update pull pHat toward the band centre by w=1-(1-w1)^g and shrink the update's gate/alpha; tune w1, cap on g, shrink.",
            "block": "2630000"
          }
        },
        {
          "key": "kalman-b",
          "vars": {
            "mech": "KALMAN: keep lnP and its variance V in free slots; V += sigmaHat^2 per elapsed step; measurement = pImplied, noise R small for likely-arb prints (first in step, small tradeRatio), R = (half band + impact)^2 for retail; gain V/(V+R) replaces the fixed alphas 0.27/0.06/0.12; tune both R scales, V floor.",
            "block": "2640000"
          }
        },
        {
          "key": "prespot-b",
          "vars": {
            "mech": "PRE-SPOT: for a retail print the fair price lies in the pre-trade band, so pImplied is biased in the trade's direction by its own impact. Recover the pre-trade spot from reserves and amounts; for non-first prints (and first prints with large tradeRatio) update pHat toward it or the band centre; tune alphas.",
            "block": "2650000"
          }
        },
        {
          "key": "evfee-b",
          "vars": {
            "mech": "EV-FEE: per side choose f maximising f*share(f)*E[retail flow next step] - P(arb hits that side next step)*E[arb loss]; share(f) = exact smooth router split vs the 30 bps pool (equal reserves: 10bps 75%, 60 12%); P(arb) from sigmaHat and that side's spot-to-pHat gap; blend with NP2's fee by w; tune w, loss.",
            "block": "2660000"
          }
        },
        {
          "key": "nextmix-b",
          "vars": {
            "mech": "NEXT-MIX: the fee returned after a print serves the next trade: the arbitrageur next step (if the price leaves the band) or another retail order this step (P via Poisson(lambdaHat)). Quote the mix of the two regimes: cheaper on the side the arbitrageur cannot hit, protective on the other; tune mix weight, offsets.",
            "block": "2670000"
          }
        }
      ],
      "output": {
        "format": "markdown",
        "maxBytes": 64000
      },
      "merge": {
        "groupSize": 6,
        "brief": "Merge into one table ranked by t = mean_diff/se on the confirm block: item, mechanism, n, mean_diff, se, worst, blocked step. For each item say whether it measured each strategy separately against Vanilla (valid) or candidate against NP2 in one market (invalid: mark it and leave it out of the ranking). For every valid item with mean_diff >= 2*se copy its delta, sha256 and full code verbatim. List blocked items with their step and error."
      }
    }
  ],
  "cancel": [
    "ep3-mech"
  ],
  "read": [
    "ep3-base/decomp",
    "ep3-oracle/oracle-price",
    "ep3-oracle/oracle-full",
    "ep3-mech/merge-01",
    "ep4-flow/flat-a",
    "ep4-flow/flat-b",
    "ep4-flow/both-a",
    "ep4-lean/lean-a",
    "ep4-lean/lean-b",
    "ep4-lean/cap-b",
    "ep5-err/err-a",
    "ep5-err/err-b",
    "ep5-oracle/oracle-price-c",
    "ep5-oracle/oracle-full-c",
    "ep5-mech/merge-01",
    "ep5-mech/merge-02",
    "ep5-mech/arbfirst-a",
    "ep5-mech/silence-a",
    "ep5-mech/kalman-a",
    "ep5-mech/prespot-a",
    "ep5-mech/evfee-a",
    "ep5-mech/nextmix-a",
    "ep5-mech/arbfirst-b",
    "ep5-mech/silence-b",
    "ep5-mech/kalman-b",
    "ep5-mech/prespot-b",
    "ep5-mech/evfee-b",
    "ep5-mech/nextmix-b"
  ],
  "wake": {
    "batches": [
      "ep5-err",
      "ep5-oracle",
      "ep5-mech"
    ],
    "afterMinutes": 240
  },
  "finish": false
}
