{
  "key": "f-side-staleness",
  "approach": "Blind side-age reliability overlay: implied fair-value observations bid+(s-0.5), ask-(s-0.5), weighted by (1+age)^(-power); age resets only when that best quote changes. If weighted estimate differs from current competitor midpoint by strictly more than half a tick, move newly placed N orders on the exposed side one tick outward. Sizes and other actions unchanged; at price boundaries retain the original order. No added orders, hence none to hide. Missing competitor side disables intervention. First-step spread gates the whole run.",
  "tried": {
    "incumbent_sha256": "bf0d179f3e47d28819f6fa7e0d25548c2ced43374c216d36460b00a26a26ffae",
    "incumbent_seed_310000_edge": 17.1160017503,
    "incumbent_check_matches": true,
    "variants": [
      {
        "power": 1.0,
        "spreads": [
          1,
          2,
          3,
          4
        ],
        "groups": {
          "1": {
            "n": 47,
            "incumbent_mean": 30.59600304578298,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          },
          "2": {
            "n": 57,
            "incumbent_mean": 81.35713208259824,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          },
          "3": {
            "n": 53,
            "incumbent_mean": 115.06691980369057,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          },
          "4": {
            "n": 43,
            "incumbent_mean": 112.9910514314628,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          }
        },
        "total": {
          "n": 200,
          "incumbent_mean": 85.16265316504199,
          "mean_diff": 0.0,
          "se": 0.0,
          "sum_d": 0.0,
          "sum_d2": 0.0,
          "retail_diff": 0.0,
          "arb_diff": 0.0
        }
      },
      {
        "power": 0.5,
        "spreads": [
          1,
          2,
          3,
          4
        ],
        "groups": {
          "1": {
            "n": 47,
            "incumbent_mean": 30.59600304578298,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          },
          "2": {
            "n": 57,
            "incumbent_mean": 81.35713208259824,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          },
          "3": {
            "n": 53,
            "incumbent_mean": 115.06691980369057,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          },
          "4": {
            "n": 43,
            "incumbent_mean": 112.9910514314628,
            "mean_diff": 0.0,
            "se": 0.0,
            "sum_d": 0.0,
            "sum_d2": 0.0,
            "retail_diff": 0.0,
            "arb_diff": 0.0
          }
        },
        "total": {
          "n": 200,
          "incumbent_mean": 85.16265316504199,
          "mean_diff": 0.0,
          "se": 0.0,
          "sum_d": 0.0,
          "sum_d2": 0.0,
          "retail_diff": 0.0,
          "arb_diff": 0.0
        }
      }
    ],
    "selection": "Only seeds 310000..310199. For each of two powers, enable spread groups with nonnegative paired tuning means (zero-gain ties remain enabled); select largest pooled paired tuning mean. Freeze before holdout. Tuning SE does not correct for selection.",
    "selected_power": 1.0,
    "diagnostic_on_tuning_seeds": {
      "steps": 20000,
      "unequal_ages": 13,
      "signals": 0,
      "max_abs_delta": 0.25,
      "first_seed": 310000,
      "last_seed": 310009
    },
    "off_check": {
      "n": 10,
      "first_seed": 310000,
      "last_seed": 310009,
      "exact_state_action_traces_and_full_results": true
    },
    "assembled_equals_s1": {
      "n": 5,
      "seeds": "310000..310004",
      "exact_state_action_traces_and_full_results": true
    },
    "execution": "Pinned unmodified simulator b244530ee2a6247b5f930830eeca9dd950da0e7e; default ChallengeConfig and ParameterVariance; 2000 steps; serial, no sandbox; no finalist seeds touched."
  },
  "next": "No promotion: both tuned variants were empirically inert. Check the geometry of side-implied fair-value offsets and the strict half-tick trigger before allocating further measurement; do not treat exact zero differences as evidence of an improvement. Finalist seeds were not run.",
  "spreads_acted": [
    1,
    2,
    3,
    4
  ],
  "off_equals_n": true,
  "code": "from dataclasses import replace as _stale_replace\nfrom orderbook_pm_challenge.types import PlaceOrder as _StalePlaceOrder, Side as _StaleSide\n\n\nclass Strategy(BaseStrategy):\n    \"\"\"One-tick defense from unequal ages of the competitor's two quotes.\"\"\"\n    SPREADS = (1, 2, 3, 4)\n    AGE_POWER = 1.0\n\n    def __init__(self):\n        self._n = _N()\n        self._spread = None\n        self._last_bid = None\n        self._last_ask = None\n        self._bid_changed = 0\n        self._ask_changed = 0\n\n    def on_step(self, state):\n        # No added orders: all own_orders belong to N and remain visible to it.\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:\n            if bid is None or ask is None:\n                self._spread = 0\n            else:\n                self._spread = max(1, (ask - bid + 1) // 2)\n            self._bid_changed = self._ask_changed = state.step\n        if bid != self._last_bid:\n            self._bid_changed = state.step\n        if ask != self._last_ask:\n            self._ask_changed = state.step\n        self._last_bid, self._last_ask = bid, ask\n        if self._spread not in self.SPREADS or bid is None or ask is None:\n            return actions\n        # At initialization a side lies s-1/2 ticks from fair value in expectation.\n        # Give observations less weight as time since their last change increases.\n        wb = (1 + state.step - self._bid_changed) ** (-self.AGE_POWER)\n        wa = (1 + state.step - self._ask_changed) ** (-self.AGE_POWER)\n        half_width = self._spread - 0.5\n        estimate = (wb * (bid + half_width) + wa * (ask - half_width)) / (wb + wa)\n        delta = estimate - (bid + ask) / 2.0\n        exposed = _StaleSide.SELL if delta > 0.5 else _StaleSide.BUY if delta < -0.5 else None\n        if exposed is None:\n            return actions\n        result = []\n        for action in actions:\n            if isinstance(action, _StalePlaceOrder) and action.side == exposed:\n                tick = action.price_ticks + (1 if exposed == _StaleSide.SELL else -1)\n                if 1 <= tick <= 99:\n                    action = _stale_replace(action, price_ticks=tick)\n            result.append(action)\n        return result\n",
  "code_sha256": "755b966620276ddda466bba202c98989f200499e927c3d4197229d459f2e8946",
  "assembled_sha256": "7d6ba8329c9e8703ec8767416a06a2682a5193506b39688112219964cfffed26",
  "tuning": {
    "n": 200,
    "mean_diff": 0.0,
    "se": 0.0
  },
  "paired": {
    "first_seed": 410000,
    "last_seed": 410499,
    "n": 500,
    "incumbent_mean": 104.4137531881468,
    "mean_diff": 0.0,
    "se": 0.0,
    "sum_d": 0.0,
    "sum_d2": 0.0,
    "retail_diff": 0.0,
    "arb_diff": 0.0,
    "complete": true,
    "failures": 0
  },
  "by_spread": {
    "1": {
      "incumbent_mean": 28.495154459731307,
      "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.76626247947758,
      "mean_diff": 0.0,
      "se": 0.0,
      "sum_d": 0.0,
      "sum_d2": 0.0,
      "retail_diff": 0.0,
      "arb_diff": 0.0,
      "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": 0.35313070004107433
}
