{
  "key": "f-interval-vol",
  "approach": "Blind composition over one opaque N instance. Interval-censored Gaussian composite likelihood on competitor bid/ask midpoint displacement at lags 1, 5, 20, weights 0.5/0.3/0.2, estimates tick volatility on a fixed sigma grid. After 20 observations, if the estimate strictly exceeds the frozen threshold and first-step s is eligible, move each nearest newly placed bid/ask one tick outward; drop only if the new tick is outside 1..99. Preserve quantities, IDs and cancellation actions. Existing resting orders are left to N; no orders are added, so no own-order hiding is needed. This is a heuristic likelihood, not a calibrated volatility forecast.",
  "tried": {
    "incumbent_sha256": "bf0d179f3e47d28819f6fa7e0d25548c2ced43374c216d36460b00a26a26ffae",
    "incumbent_seed_310000_edge": 17.1160017503,
    "incumbent_seed_check_matches_17_116002": true,
    "variants": [
      {
        "threshold": 0.75,
        "spreads": [
          4
        ],
        "tuning": {
          "n": 200,
          "incumbent_mean": 85.162653165042,
          "mean_diff": -0.6301086363289999,
          "se": 0.2345627461950615,
          "sum_d": -126.0217272658,
          "sum_d2": 2269.190718437518,
          "retail_diff": -0.134469577397,
          "arb_diff": -0.49563905893450017
        },
        "all_spreads": {
          "n": 200,
          "incumbent_mean": 85.162653165042,
          "mean_diff": -6.0885682904055,
          "se": 0.5428765927732049,
          "sum_d": -1217.7136580811,
          "sum_d2": 19143.789565631825,
          "retail_diff": -1.5130832871860005,
          "arb_diff": -4.575485003279
        },
        "by_spread": {
          "1": {
            "n": 47,
            "incumbent_mean": 30.59600304578298,
            "mean_diff": -5.62956996233617,
            "se": 1.411356126717771,
            "sum_d": -264.5897882298,
            "sum_d2": 5796.0709878676025,
            "retail_diff": -1.549047587906384,
            "arb_diff": -4.08052237446383
          },
          "2": {
            "n": 57,
            "incumbent_mean": 81.35713208259824,
            "mean_diff": -7.612162919447369,
            "se": 0.7398839849403734,
            "sum_d": -433.8932864085,
            "sum_d2": 5050.25755505456,
            "retail_diff": -1.8613011311245622,
            "arb_diff": -5.750861788417544
          },
          "3": {
            "n": 53,
            "incumbent_mean": 115.06691980369057,
            "mean_diff": -7.419035022207549,
            "se": 1.0624614787267506,
            "sum_d": -393.2088561770001,
            "sum_d2": 6028.270304272145,
            "retail_diff": -1.8268554877754717,
            "arb_diff": -5.592179534515093
          },
          "4": {
            "n": 43,
            "incumbent_mean": 112.9910514314628,
            "mean_diff": -2.9307378433906974,
            "se": 1.025654876353491,
            "sum_d": -126.0217272658,
            "sum_d2": 2269.190718437518,
            "retail_diff": -0.6254398948697675,
            "arb_diff": -2.305297948532559
          }
        }
      },
      {
        "threshold": 1.5,
        "spreads": [
          2
        ],
        "tuning": {
          "n": 200,
          "incumbent_mean": 85.162653165042,
          "mean_diff": -0.30954789622000006,
          "se": 0.06611246670459199,
          "sum_d": -61.909579244000014,
          "sum_d2": 193.12413851072378,
          "retail_diff": -0.09617778273700017,
          "arb_diff": -0.21337011348649995
        },
        "all_spreads": {
          "n": 200,
          "incumbent_mean": 85.162653165042,
          "mean_diff": -1.3774169007805008,
          "se": 0.277960048870077,
          "sum_d": -275.48338015610017,
          "sum_d2": 3454.4746566718063,
          "retail_diff": -0.666846010887501,
          "arb_diff": -0.7105708898989999
        },
        "by_spread": {
          "1": {
            "n": 47,
            "incumbent_mean": 30.59600304578298,
            "mean_diff": -1.8355699571702127,
            "se": 0.9583793818802081,
            "sum_d": -86.271787987,
            "sum_d2": 2144.135529823795,
            "retail_diff": -1.0516253021957467,
            "arb_diff": -0.7839446550085108
          },
          "2": {
            "n": 57,
            "incumbent_mean": 81.35713208259824,
            "mean_diff": -1.0861329691929826,
            "se": 0.19858688068638544,
            "sum_d": -61.909579244000014,
            "sum_d2": 193.12413851072378,
            "retail_diff": -0.3374659043403515,
            "arb_diff": -0.7486670648649121
          },
          "3": {
            "n": 53,
            "incumbent_mean": 115.06691980369057,
            "mean_diff": -1.4696115512018892,
            "se": 0.4172114750622095,
            "sum_d": -77.88941221370013,
            "sum_d2": 594.1914634349786,
            "retail_diff": -0.6804603524207555,
            "arb_diff": -0.789151198752829
          },
          "4": {
            "n": 43,
            "incumbent_mean": 112.9910514314628,
            "mean_diff": -1.149130249102326,
            "se": 0.5080972314856912,
            "sum_d": -49.41260071140002,
            "sum_d2": 523.0235249023086,
            "retail_diff": -0.6661129708976747,
            "arb_diff": -0.48301727821395435
          }
        }
      }
    ],
    "selection_rule": "For each threshold choose spreads whose paired tuning mean exceeds one SE; if none, choose the single spread with greatest mean minus SE. Select threshold by the masked all-seed mean minus SE. Tuning estimates include spread selection and are optimistic.",
    "frozen_threshold": 1.5,
    "off_check": {
      "seeds": [
        310000,
        310001,
        310002,
        310003,
        310004,
        310005,
        310006,
        310007,
        310008,
        310009
      ],
      "equal_results_and_every_state_and_action": true
    },
    "outside_spread_gate_check": "Every holdout result outside the selected spread set equals N exactly, across every SimulationResult field.",
    "assembled_check": {
      "seeds": [
        310000,
        310001,
        310002,
        310003,
        310004
      ],
      "equal_results_and_every_state_and_action": true,
      "code_sha256": "0e6a608053af237468264663541681653cab68845fa760cb5238e0b483f5c8f9",
      "assembled_sha256": "e6818e2b3111bc57b20dfd22c549203ec9f50bc98ee78c691101439719167d89"
    },
    "execution": "Pinned unmodified simulator b244530ee2a6247b5f930830eeca9dd950da0e7e, default ChallengeConfig and ParameterVariance, 2000 steps; serial in-process engines; no workers or sandbox. N source was saved, hashed, loaded and mechanically renamed without opening, printing or searching it. No earlier strategies or network results read. Tuning seeds 310000..310199 only; holdout 410000..410499 once per strategy. No 900000..903999 seeds used.",
    "scoreboard": "N remains the incumbent. The two thresholds and frozen spread selection have tuning paired differences recorded here; the frozen candidate has one independent paired holdout below. No finalist promotion is claimed."
  },
  "next": "Retain N: this overlay did not show a paired gain exceeding twice its holdout SE. Do not promote from these non-finalist seeds.",
  "spreads_acted": [
    2
  ],
  "off_equals_n": true,
  "code": "from collections import deque\nfrom dataclasses import replace\nfrom math import erf, log, sqrt\nfrom orderbook_pm_challenge.strategy import BaseStrategy\nfrom orderbook_pm_challenge.types import PlaceOrder, Side\n\n\nclass Strategy(BaseStrategy):\n    # Frozen after tuning. No added orders; N sees the entire own-order state.\n    SPREADS = (2,)\n    THRESHOLD = 1.5\n    ENABLED = True\n    SIGMAS = (0.125, 0.25, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 5.0, 8.0)\n\n    def __init__(self):\n        self.n = _N()\n        self.history = deque(maxlen=21)\n        self.spread = None\n        self.volatility = 0.0\n\n    def on_step(self, state):\n        actions = self.n.on_step(state)\n        bid = state.competitor_best_bid_ticks\n        ask = state.competitor_best_ask_ticks\n        if self.spread is None and state.step == 0:\n            self.spread = max(1, (ask - bid + 1) // 2) if bid is not None and ask is not None else 0\n        if bid is None or ask is None:\n            self.history.clear()\n            return actions\n        mid = (bid + ask) * 0.5\n        observations = []\n        for lag, weight in ((1, 0.5), (5, 0.3), (20, 0.2)):\n            if len(self.history) >= lag:\n                old_step, old_mid = self.history[-lag]\n                if state.step - old_step == lag:\n                    observations.append((abs(mid - old_mid), lag, weight))\n        self.history.append((state.step, mid))\n        if not self.ENABLED or self.spread not in self.SPREADS or len(observations) < 3:\n            return actions\n        # Composite likelihood of interval-censored absolute Gaussian moves.\n        # Midpoint ticks have a half-tick lattice; +/-0.5 allows rounding noise.\n        best_score = float('-inf')\n        for sigma in self.SIGMAS:\n            score = 0.0\n            for move, lag, weight in observations:\n                scale = sigma * sqrt(2.0 * lag)\n                lo = max(0.0, move - 0.5)\n                hi = move + 0.5\n                mass = erf(hi / scale) - erf(lo / scale)\n                score += weight * log(max(1e-15, mass))\n            if score > best_score:\n                best_score = score\n                self.volatility = sigma\n        if self.volatility <= self.THRESHOLD:\n            return actions\n        buys = [a.price_ticks for a in actions if isinstance(a, PlaceOrder) and a.side == Side.BUY]\n        sells = [a.price_ticks for a in actions if isinstance(a, PlaceOrder) and a.side == Side.SELL]\n        near_buy = max(buys) if buys else None\n        near_sell = min(sells) if sells else None\n        result = []\n        for action in actions:\n            if isinstance(action, PlaceOrder):\n                tick = action.price_ticks\n                if action.side == Side.BUY and tick == near_buy:\n                    tick -= 1\n                elif action.side == Side.SELL and tick == near_sell:\n                    tick += 1\n                if not 1 <= tick <= 99:\n                    continue\n                if tick != action.price_ticks:\n                    action = replace(action, price_ticks=tick)\n            result.append(action)\n        return result\n",
  "code_sha256": "0e6a608053af237468264663541681653cab68845fa760cb5238e0b483f5c8f9",
  "assembled_sha256": "e6818e2b3111bc57b20dfd22c549203ec9f50bc98ee78c691101439719167d89",
  "tuning": {
    "n": 200,
    "mean_diff": -0.30954789622000006,
    "se": 0.06611246670459199
  },
  "paired": {
    "n": 500,
    "incumbent_mean": 104.4137531881468,
    "mean_diff": -0.6748852093749997,
    "se": 0.15443782784214174,
    "sum_d": -337.4426046874999,
    "sum_d2": 6178.570168732022,
    "retail_diff": -0.2102066658670004,
    "arb_diff": -0.4646785435138001,
    "first_seed": 410000,
    "last_seed": 410499,
    "complete": true,
    "failures": 0
  },
  "by_spread": {
    "1": {
      "incumbent_mean": 28.495154459731303,
      "mean_diff": 0.0,
      "se": 0.0,
      "sum_d": 0.0,
      "sum_d2": 0.0,
      "retail_diff": 0.0,
      "arb_diff": 0.0,
      "runs": 115
    },
    "2": {
      "incumbent_mean": 97.76626247947759,
      "mean_diff": -2.9089879714439646,
      "se": 0.6241608273746742,
      "sum_d": -337.4426046874999,
      "sum_d2": 6178.570168732022,
      "retail_diff": -0.9060632149439672,
      "arb_diff": -2.0029247565250006,
      "runs": 116
    },
    "3": {
      "incumbent_mean": 128.4054514027384,
      "mean_diff": 0.0,
      "se": 0.0,
      "sum_d": 0.0,
      "sum_d2": 0.0,
      "retail_diff": 0.0,
      "arb_diff": 0.0,
      "runs": 138
    },
    "4": {
      "incumbent_mean": 151.67248160310686,
      "mean_diff": 0.0,
      "se": 0.0,
      "sum_d": 0.0,
      "sum_d2": 0.0,
      "retail_diff": 0.0,
      "arb_diff": 0.0,
      "runs": 131
    }
  },
  "seconds_per_simulation": 1.1054289922900498
}
