{
  "delta": "Replace NP2's smoothed pHat, second-print update and normalizer blend with first-print-only step-exact tracking; no later print updates pHat. Reconstruct pre-trade X/Y reserves by reversing net input (gross amount*(1-fee)) and output; s0=preY/preX. pA=postSpot*(1-bidFee) when AMM buys X, postSpot/(1-askFee) when it sells X. Set pHat=pA iff abs(ln(pA/pHat)) <= k*sigmaHat*sqrt(1+gap); otherwise clamp into [s0*(1-bidFee),s0/(1-askFee)]. gap=timestamp-lastTs (0 at timestamp 0); gate uses pre-update sigmaHat and an equivalent squared comparison. Final k=1.1 (WAD STEP_K); range-reduced WAD log series through z^39/39. Keep NP2's sigma update and all fee/state coefficients; remove unused smoothing constants and slots 11/12; name step_exact_a.",
  "code": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.24;\n\nimport {AMMStrategyBase} from \"./AMMStrategyBase.sol\";\nimport {TradeInfo} from \"./IAMMStrategy.sol\";\n\ncontract Strategy is AMMStrategyBase {\n    uint256 constant STEP_K = 1100000000000000000;\n    uint256 constant ELAPSED_CAP = 8;\n    uint256 constant SIGNAL_THRESHOLD = WAD / 650;\n    uint256 constant DIR_DECAY = 750000000000000000;\n    uint256 constant ACT_DECAY = 530000000000000000;\n    uint256 constant SIZE_DECAY = 530000000000000000;\n    uint256 constant TOX_DECAY = 910000000000000000;\n    uint256 constant SIGMA_DECAY = 690000000000000000;\n    uint256 constant LAMBDA_DECAY = 990000000000000000;\n    uint256 constant SIZE_BLEND_DECAY = 828000000000000000;\n    uint256 constant TOX_BLEND_DECAY = 51000000000000000;\n    uint256 constant ACT_BLEND_DECAY = 985000000000000000;\n    uint256 constant DIR_IMPACT_MULT = 4;\n    uint256 constant TRADE_TOX_BOOST = 3500 * BPS;\n    uint256 constant STALE_ATTRACT_FRAC = 1050000000000000000;\n    uint256 constant RET_CAP = WAD / 35;\n    uint256 constant TOX_CAP = WAD / 5;\n    uint256 constant TRADE_RATIO_CAP = WAD / 5;\n    uint256 constant LAMBDA_CAP = 1820000000000000000;\n    uint256 constant STEP_COUNT_CAP = 64;\n    uint256 constant BASE_FEE = 4 * BPS;\n    uint256 constant SIGMA_COEF = 200000000000000000;\n    uint256 constant LAMBDA_COEF = 12 * BPS;\n    uint256 constant FLOW_SIZE_COEF = 4842 * BPS;\n    uint256 constant TOX_COEF = 300 * BPS;\n    uint256 constant TOX_QUAD_COEF = 15000 * BPS;\n    uint256 constant ACT_COEF = 91843 * BPS;\n    uint256 constant DIR_COEF = 20 * BPS;\n    uint256 constant DIR_TOX_COEF = 100 * BPS;\n    uint256 constant STALE_DIR_COEF = 6850 * BPS;\n    uint256 constant SIGMA_TOX_COEF = 500 * BPS;\n    uint256 constant TAIL_KNEE = 600 * BPS;\n    uint256 constant TAIL_SLOPE_PROTECT = 930000000000000000;\n    uint256 constant TAIL_SLOPE_ATTRACT = 850000000000000000;\n\n    function afterInitialize(uint256 initialX, uint256 initialY) external override returns (uint256, uint256) {\n        slots[0] = BASE_FEE; slots[1] = BASE_FEE; slots[2] = 0; slots[3] = WAD; slots[4] = 0;\n        slots[5] = initialX > 0 ? wdiv(initialY, initialX) : 100 * WAD;\n        slots[6] = 950000000000000; slots[7] = 800000000000000000; slots[8] = 2000000000000000;\n        slots[9] = 0; slots[10] = 0;\n        return (BASE_FEE, BASE_FEE);\n    }\n\n    function afterSwap(TradeInfo calldata trade) external override returns (uint256, uint256) {\n        uint256 prevBidFee = slots[0]; uint256 prevAskFee = slots[1]; uint256 lastTs = slots[2];\n        uint256 dirState = slots[3]; uint256 actEma = slots[4]; uint256 pHat = slots[5];\n        uint256 sigmaHat = slots[6]; uint256 lambdaHat = slots[7]; uint256 sizeHat = slots[8];\n        uint256 toxEma = slots[9]; uint256 stepTradeCount = slots[10];\n\n        bool isNewStep = trade.timestamp > lastTs;\n        if (isNewStep) {\n            uint256 elapsedRaw = trade.timestamp - lastTs;\n            uint256 elapsed = elapsedRaw > ELAPSED_CAP ? ELAPSED_CAP : elapsedRaw;\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            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            stepTradeCount = 0;\n        }\n\n        bool firstInStep = stepTradeCount == 0;\n        uint256 spot = trade.reserveX > 0 ? wdiv(trade.reserveY, trade.reserveX) : pHat;\n\n        uint256 feeUsed = trade.isBuy ? prevBidFee : prevAskFee;\n        uint256 gamma = feeUsed < WAD ? WAD - feeUsed : 0;\n        uint256 pImplied;\n        if (gamma == 0) { pImplied = spot; }\n        else { pImplied = trade.isBuy ? wmul(spot, gamma) : wdiv(spot, gamma); }\n\n        // Only the first print can be the step's initial arbitrage.\n        // gap counts elapsed simulator steps since our preceding print.\n        if (firstInStep) {\n            uint256 preX;\n            uint256 preY;\n            if (trade.isBuy) {\n                // X input is gross; its fee is collected outside reserves.\n                uint256 netX = wmul(trade.amountX, gamma);\n                preX = trade.reserveX > netX ? trade.reserveX - netX : 0;\n                preY = trade.reserveY + trade.amountY;\n            } else {\n                // Y input is gross; its fee is collected outside reserves.\n                uint256 netY = wmul(trade.amountY, gamma);\n                preX = trade.reserveX + trade.amountX;\n                preY = trade.reserveY > netY ? trade.reserveY - netY : 0;\n            }\n            uint256 s0 = preX > 0 ? wdiv(preY, preX) : spot;\n            uint256 ret = pHat > 0 ? wdiv(absDiff(pImplied, pHat), pHat) : 0;\n            uint256 gap = trade.timestamp > lastTs ? trade.timestamp - lastTs : 0;\n            uint256 logMove = _absLogRatio(pImplied, pHat);\n            uint256 gate = wmul(STEP_K, sigmaHat);\n            // Equivalent to |ln(pA/pHat)| <= k*sigmaHat*sqrt(1+gap).\n            if (logMove * logMove <= gate * gate * (1 + gap)) {\n                pHat = pImplied;\n            } else {\n                uint256 lower = wmul(s0, WAD - prevBidFee);\n                uint256 upper = wdiv(s0, WAD - prevAskFee);\n                pHat = clamp(pHat, lower, upper);\n            }\n            // Preserve NP2's first-print volatility estimator.\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            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            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        stepTradeCount = stepTradeCount + 1;\n        if (stepTradeCount > STEP_COUNT_CAP) stepTradeCount = STEP_COUNT_CAP;\n\n        uint256 flowSize = wmul(lambdaHat, sizeHat);\n        uint256 fBase = BASE_FEE + wmul(SIGMA_COEF, sigmaHat) + wmul(LAMBDA_COEF, lambdaHat) + wmul(FLOW_SIZE_COEF, flowSize);\n        uint256 fMid = fBase + wmul(TOX_COEF, toxSignal) + wmul(TOX_QUAD_COEF, wmul(toxSignal, toxSignal)) + wmul(ACT_COEF, actEma);\n        fMid = fMid + wmul(SIGMA_TOX_COEF, wmul(sigmaHat, toxSignal));\n\n        uint256 dirDev; bool sellPressure;\n        if (dirState >= WAD) { dirDev = dirState - WAD; sellPressure = true; }\n        else { dirDev = WAD - dirState; sellPressure = false; }\n\n        uint256 skew = wmul(DIR_COEF, dirDev) + wmul(DIR_TOX_COEF, wmul(dirDev, toxSignal));\n        uint256 bidFee; 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        {\n            uint256 staleShift = wmul(STALE_DIR_COEF, toxSignal);\n            uint256 attractShift = wmul(staleShift, STALE_ATTRACT_FRAC);\n            if (spot >= pHat) {\n                bidFee = bidFee + staleShift;\n                askFee = askFee > attractShift ? askFee - attractShift : 0;\n            } else {\n                askFee = askFee + staleShift;\n                bidFee = bidFee > attractShift ? bidFee - attractShift : 0;\n            }\n        }\n\n        {\n            bool tradeAligned = (trade.isBuy && spot >= pHat) || (!trade.isBuy && spot < pHat);\n            if (tradeAligned) {\n                uint256 tradeBoost = wmul(TRADE_TOX_BOOST, tradeRatio);\n                if (trade.isBuy) { bidFee = bidFee + tradeBoost; }\n                else { askFee = askFee + tradeBoost; }\n            }\n        }\n\n        if (sellPressure) {\n            bidFee = clampFee(_compressTailWithSlope(bidFee, TAIL_SLOPE_PROTECT));\n            askFee = clampFee(_compressTailWithSlope(askFee, TAIL_SLOPE_ATTRACT));\n        } else {\n            askFee = clampFee(_compressTailWithSlope(askFee, TAIL_SLOPE_PROTECT));\n            bidFee = clampFee(_compressTailWithSlope(bidFee, TAIL_SLOPE_ATTRACT));\n        }\n\n        slots[0] = bidFee; slots[1] = askFee; slots[2] = trade.timestamp;\n        slots[3] = dirState; slots[4] = actEma; slots[5] = pHat;\n        slots[6] = sigmaHat; slots[7] = lambdaHat; slots[8] = sizeHat;\n        slots[9] = toxEma; slots[10] = stepTradeCount;\n\n        return (bidFee, askFee);\n    }\n\n    // WAD absolute natural log. Range reduction bounds z by 1/3;\n    // ln(r)=2*(z+z^3/3+z^5/5+...), z=(r-1)/(r+1).\n    function _absLogRatio(uint256 a, uint256 b) internal pure returns (uint256 value) {\n        if (a == 0 || b == 0) return 256 * WAD;\n        uint256 ratio = a >= b ? wdiv(a, b) : wdiv(b, a);\n        while (ratio >= 2 * WAD) {\n            ratio /= 2;\n            value += 693147180559945309;\n        }\n        uint256 z = wdiv(ratio - WAD, ratio + WAD);\n        uint256 z2 = wmul(z, z);\n        uint256 term = z;\n        uint256 sum = z;\n        for (uint256 d = 3; d <= 39; d += 2) {\n            term = wmul(term, z2);\n            if (term == 0) break;\n            sum += term / d;\n        }\n        return value + 2 * sum;\n    }\n\n    function _compressTailWithSlope(uint256 fee, uint256 slope) internal pure returns (uint256) {\n        if (fee <= TAIL_KNEE) return fee;\n        return TAIL_KNEE + wmul(fee - TAIL_KNEE, 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) internal pure returns (uint256) {\n        uint256 mul = _powWad(decayFactor, elapsed);\n        if (centered >= WAD) { return WAD + wmul(centered - WAD, mul); }\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) { return \"step_exact_a\"; }\n}\n",
  "sha256": "7ebe1a489eab8b4aef49425b1c6f9b4eae6835ade11810278836a954ded741e6",
  "np2_check": {
    "seeds": "0..999",
    "n": 1000,
    "CH": 525.5258821780834,
    "CH_expected": 525.525882178,
    "NP2": 526.1155722459862,
    "NP2_expected": 526.1156,
    "pass": true,
    "np2_sha256": "51f1c1a9d4999ee460eb8bbc66880da8074b173399a4f5d71f96671482e18ac0",
    "config_draws_match": true,
    "method": "Measured locally with the pinned unmodified simulator; required scores reproduced before tuning.",
    "source_urls": [
      "https://api.imdnotdead.fun/artifacts/528a6da78583c6142644a552c86670f9d25c20e39e92f4de44deae05ddc8cecd",
      "https://api.imdnotdead.fun/artifacts/da313379a2e69e9286668865e06b18dfcae25732c82b934b0fd9c2ef0d8c2ff5",
      "https://raw.githubusercontent.com/ChengHua926/amm-challenge/d34a5199c59a4c44d5336a25f1436b4ae1f21104/contracts/src/Strategy.sol"
    ]
  },
  "tune": {
    "seeds": [
      "10000..10249",
      "20000..20999"
    ],
    "best_mean_diff": -55.172618628615865,
    "selected_k": "1.1",
    "selection_seeds": "20000..20999",
    "selection_n": 1000,
    "selection_se": 0.3342720434119169,
    "selection_rule": "Highest paired mean on the final tuning comparison block; only k varied.",
    "trials": [
      {
        "k": "0",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -79.13328148830459,
        "se": 1.234127116956946,
        "sha256": "850a6eec0d7089d38c20e4e8d5d6b0f2953ac8914fcf339bc2d9ea996c91f42d"
      },
      {
        "k": "0.25",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -134.55503949019288,
        "se": 2.018903188389098,
        "sha256": "69ffc7d15de85b0dac9241f5518133eb1f4574616a917ce7519f4227609a4e10"
      },
      {
        "k": "0.5",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -95.46403760876198,
        "se": 1.337188590849377,
        "sha256": "97cbe0b7efe53c58f188e2f548873ef33b6144ef1d3c51797473c3d8fcc10a5d"
      },
      {
        "k": "1",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -55.91857831220956,
        "se": 0.665507359467202,
        "sha256": "ce2569c16216d7f257a787bb2371f0ce2c2b9c634e6d180ec1521ea203b8b924"
      },
      {
        "k": "1.5",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -59.508747353186465,
        "se": 0.6090081928456755,
        "sha256": "a9b7eb5de86d462a2c5dd9512dbbde33619f70c558c66439d81621892d47d747"
      },
      {
        "k": "2",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -69.8443456023296,
        "se": 0.6726248537039198,
        "sha256": "076543ca8140897ffe79fd80b66efe48dd6bd7a264bd726fc0d94192243e5642"
      },
      {
        "k": "3",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -87.90706020287034,
        "se": 0.8698004715479206,
        "sha256": "69724711d0eee8879d7f204a5be03a8d32c71f328231587df9e0aac5735d010a"
      },
      {
        "k": "4",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -99.53731193476881,
        "se": 0.9982664418737783,
        "sha256": "58d2880b73211a38905253360bba2a1a350e3780c5154563c789ef7d8d0923d2"
      },
      {
        "k": "6",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -112.82021939875408,
        "se": 1.1892309034444117,
        "sha256": "0ee2a6d172e1b4aecbdb0996f957fe7dd0cd7c4d4f316d9893070d914fc700bf"
      },
      {
        "k": "0.8",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -65.0563258149079,
        "se": 0.8138935751024302,
        "sha256": "0f58b06ba8ec9b9578890f32879d0a56a5314340f04ef1e7c86cb572654bb435"
      },
      {
        "k": "0.9",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -59.586002027219436,
        "se": 0.7078833195936696,
        "sha256": "3924fecedba62a1fc89db1a63460fb10cbdc3a6bb3215a01e5e3dc1671d2301f"
      },
      {
        "k": "1.1",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -54.94863050088498,
        "se": 0.6125314243451643,
        "sha256": "7ebe1a489eab8b4aef49425b1c6f9b4eae6835ade11810278836a954ded741e6"
      },
      {
        "k": "1.2",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -54.69817222044488,
        "se": 0.6135939745535711,
        "sha256": "25c5139d266ebf2fed760f24cc489da83497f30101426854b889eefd5a138655"
      },
      {
        "k": "1.3",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -55.93107646987794,
        "se": 0.586949074628052,
        "sha256": "5cd3e4f34fb3414b2ef0f4abf3cbe7368e6aa1919906620979b81f89e32cf485"
      },
      {
        "k": "1.4",
        "seeds": "10000..10249",
        "n": 250,
        "mean_diff": -57.6509765666136,
        "se": 0.582175733164601,
        "sha256": "0a4ad205bb3cb00f57ca4405d84005da2a101177500e2dbb9bd40606c3289841"
      },
      {
        "k": "1.2",
        "seeds": "20000..20999",
        "n": 1000,
        "mean_diff": -55.41785146953231,
        "se": 0.3167699537552154,
        "sha256": "25c5139d266ebf2fed760f24cc489da83497f30101426854b889eefd5a138655"
      },
      {
        "k": "1.1",
        "seeds": "20000..20999",
        "n": 1000,
        "mean_diff": -55.172618628615865,
        "se": 0.3342720434119169,
        "sha256": "7ebe1a489eab8b4aef49425b1c6f9b4eae6835ade11810278836a954ded741e6"
      },
      {
        "k": "1",
        "seeds": "20000..20999",
        "n": 1000,
        "mean_diff": -56.39225886077458,
        "se": 0.3524373536712129,
        "sha256": "ce2569c16216d7f257a787bb2371f0ce2c2b9c634e6d180ec1521ea203b8b924"
      },
      {
        "k": "1.3",
        "seeds": "20000..20999",
        "n": 1000,
        "mean_diff": -56.211243144983094,
        "se": 0.3106289768896395,
        "sha256": "5cd3e4f34fb3414b2ef0f4abf3cbe7368e6aa1919906620979b81f89e32cf485"
      }
    ],
    "freeze": {
      "k": "1.1",
      "sha256": "7ebe1a489eab8b4aef49425b1c6f9b4eae6835ade11810278836a954ded741e6",
      "utc": "2026-11-07T17:47:18.551132+00:00",
      "selection_seeds": "20000..20999",
      "selected_trial": {
        "n": 1000,
        "mean_diff": -55.172618628615865,
        "se": 0.3342720434119169,
        "candidate_mean": 466.6149407538476,
        "np2_mean": 521.7875593824634,
        "worst": [
          {
            "seed": 20048,
            "diff": -119.08746569302593,
            "candidate_edge": 542.9931375392011,
            "np2_edge": 662.0806032322271
          },
          {
            "seed": 20171,
            "diff": -93.21345680438094,
            "candidate_edge": 565.3443326256148,
            "np2_edge": 658.5577894299958
          },
          {
            "seed": 20771,
            "diff": -90.20203810988926,
            "candidate_edge": 642.3158405920254,
            "np2_edge": 732.5178787019147
          },
          {
            "seed": 20168,
            "diff": -87.06302536265196,
            "candidate_edge": 518.6550987651485,
            "np2_edge": 605.7181241278005
          },
          {
            "seed": 20462,
            "diff": -85.48641421814722,
            "candidate_edge": 472.82008941162275,
            "np2_edge": 558.30650362977
          }
        ],
        "k": "1.1",
        "seeds": "20000..20999",
        "sha256": "7ebe1a489eab8b4aef49425b1c6f9b4eae6835ade11810278836a954ded741e6"
      },
      "selection_rule": "Highest paired mean on the final tuning comparison block; only k varied.",
      "confirmation_seeds": "2300000..2301999",
      "confirmation_n": 2000,
      "no_tuning_after_freeze": true
    },
    "method": {
      "simulator_commit": "6b6921f8d463314aa7c96234e1be25a25245f704",
      "simulator_url": "https://github.com/benedictbrady/amm-challenge/tree/6b6921f8d463314aa7c96234e1be25a25245f704",
      "backend": "amm_sim_rs.run_batch; 8 workers; chunks of 32; source files unmodified",
      "comparison": "Each candidate and NP2 separately versus VanillaStrategy (30bps), identical configs per seed.",
      "draws": "numpy.default_rng(s): size uniform(19,21), rate uniform(0.6,1.0), sigma uniform(0.000882,0.001008), in this order; cfg.seed=s.",
      "config": "10000 steps; initial price=100, X=100, Y=10000; mu=0, dt=1, retail_size_sigma=1.2, buy_prob=0.5; price seed=s, retail seed=s+1.",
      "statistics": "diff=candidate edge minus NP2 edge per seed; se=sample std(ddof=1)/sqrt(n); worst=five smallest differences.",
      "sources": [
        "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/match.py",
        "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_competition/competition/config.py",
        "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/simulation/engine.rs"
      ]
    }
  },
  "paired": {
    "n": 2000,
    "mean_diff": -54.97857710114733,
    "se": 0.21258710896579427,
    "candidate_mean": 469.20752348822555,
    "np2_mean": 524.1861005893729,
    "worst": [
      {
        "seed": 2301168,
        "diff": -95.73721933173158,
        "candidate_edge": 454.4537875924767,
        "np2_edge": 550.1910069242083
      },
      {
        "seed": 2300162,
        "diff": -93.62417465872693,
        "candidate_edge": 459.9724303906537,
        "np2_edge": 553.5966050493806
      },
      {
        "seed": 2301696,
        "diff": -85.20055118602056,
        "candidate_edge": 552.8518464574979,
        "np2_edge": 638.0523976435185
      },
      {
        "seed": 2301874,
        "diff": -84.52321436099061,
        "candidate_edge": 510.1803479961731,
        "np2_edge": 594.7035623571637
      },
      {
        "seed": 2301862,
        "diff": -84.46787087727193,
        "candidate_edge": 625.5342079634817,
        "np2_edge": 710.0020788407536
      }
    ],
    "seeds": "2300000..2301999",
    "definition": "Candidate submission edge minus NP2 submission edge; separate markets with the same 30bps normalizer and identical seed/config draws.",
    "run_once": true,
    "candidate_frozen_before_confirmation": true,
    "measurement": "Local simulation result, not an independently verified leaderboard score."
  },
  "arb_volume": {
    "units": "Y",
    "aggregation": "Mean cumulative volume per 10000-step simulation",
    "n": 2000,
    "candidate": 21192.951074082503,
    "np2": 24125.490624771206,
    "mean_diff": -2932.539550688712,
    "se": 19.113652664541636,
    "relative_change": -0.12155357154385404
  },
  "retail_volume": {
    "units": "Y",
    "aggregation": "Mean cumulative volume per 10000-step simulation",
    "n": 2000,
    "candidate": 59935.439361150784,
    "np2": 77261.75091452763,
    "mean_diff": -17326.311553376836,
    "se": 62.349320871912596,
    "relative_change": -0.2242547101028609
  },
  "gas": {
    "source_sha256": "7ebe1a489eab8b4aef49425b1c6f9b4eae6835ade11810278836a954ded741e6",
    "success": true,
    "n_calls": 3352,
    "initialization_gas": 185532,
    "max_after_swap_gas": 119831,
    "mean_after_swap_gas": 36270.05727923628,
    "gas_limit": 250000,
    "method": "pyrevm ExecutionResult.gas_used, not executor placeholder estimate",
    "cases": {
      "retail_sell": 541,
      "clamp_lower": 386,
      "later_frozen": 1386,
      "arb_sell": 429,
      "clamp_upper": 492,
      "clamp_inside": 268,
      "retail_buy": 605,
      "arb_buy": 391
    },
    "reserve_reconstruction_max_error_wad": 0,
    "model": "Independent Decimal natural log; exact integer reserve/fee equations; state assertions after every call",
    "validate_pass": true,
    "validate_stdout": "Validating strategy...\nCompiling strategy...\nStrategy 'step_exact_a' validated successfully!",
    "qualification": "Observed gas in controlled boundary cases and randomized valid constant-product swaps; not a formal all-input bound.",
    "source": "https://raw.githubusercontent.com/benedictbrady/amm-challenge/6b6921f8d463314aa7c96234e1be25a25245f704/amm_sim_rs/src/evm/strategy.rs"
  },
  "blocked": null,
  "next": "Do not promote: the frozen step-exact tracker loses to NP2. A separate experiment should test a stronger first-print arb/retail classifier or a volatility estimate insulated from retail; no post-confirmation tuning was performed."
}
