{
  "key": "f-inventory-skew",
  "mech": "inventory skew",
  "approach": "Wrapped opaque incumbent N. On rival spreads 2-4 only, if YES inventory exceeds 1.0, shift every incumbent placement one tick down; below -1.0, shift every placement one tick up. Preserve cancellations and all other actions. Threshold 1.0 was frozen after paired tuning.",
  "tried": "Thresholds 0.25, 0.5, and 1.0; all were screened paired against N on tuning seeds.",
  "next": "No promotion: the frozen screen was negative. Do not promote this overlay; investigate why inventory shifts reduce retail and arbitrage edge before revisiting.",
  "spreads_acted": [2, 3, 4],
  "off_equals_n": true,
  "code": "from orderbook_pm_challenge.types import PlaceOrder\n\nclass Strategy(_N):\n    _inventory_threshold = 1.0\n\n    def on_step(self, state):\n        actions = super().on_step(state)\n        if state.competitor_best_bid_ticks is None or state.competitor_best_ask_ticks is None:\n            return actions\n        spread = state.competitor_best_ask_ticks - state.competitor_best_bid_ticks\n        # A one-tick move is only useful when there is room in the observed rival spread.\n        if spread < 2:\n            return actions\n        skew = 0\n        if state.yes_inventory > self._inventory_threshold:\n            skew = -1\n        elif state.yes_inventory < -self._inventory_threshold:\n            skew = 1\n        if not skew:\n            return actions\n        out = []\n        for action in actions:\n            if isinstance(action, PlaceOrder):\n                price = max(1, min(99, action.price_ticks + skew))\n                out.append(PlaceOrder(action.side, price, action.quantity, action.client_order_id))\n            else:\n                out.append(action)\n        return out\n",
  "code_sha256": "0725b55be555ff20a085e74e51f532210c5d7bb55a590955b758e7dfaf40d15d",
  "assembled_sha256": "fa00ff432fbe160c6397704a4313cd90e569fded28229ea7f7967ff692de1c87",
  "tuning": {
    "seeds": "320000..320199",
    "selected": 1.0,
    "variants": [
      {"threshold": 0.25, "n": 200, "mean_diff": -52.133751872709, "se": 4.88161784501446},
      {"threshold": 0.5, "n": 200, "mean_diff": -51.575237164170005, "se": 4.975724813679812},
      {"threshold": 1.0, "n": 200, "mean_diff": -50.568438502013, "se": 4.923959363288024}
    ]
  },
  "paired": {
    "seeds": "430000..430499",
    "n": 500,
    "complete": true,
    "missing_seeds": [],
    "overall": {"n": 500, "sum_d": -28249.3887088564, "sum_d2": 6478751.0475166235, "mean_diff": -56.4987774177128, "se": 4.423790267557522, "incumbent_mean": 95.54201511346659, "candidate_mean": 39.0432376957538, "retail_diff": -45.355344661552806, "arb_diff": -11.143432756183397},
    "by_spread": {
      "1": {"n": 131, "sum_d": -6777.0028199747, "sum_d2": 2524129.254939428, "mean_diff": -51.73284595400535, "se": 11.297336275881472, "incumbent_mean": 38.277936657049615, "candidate_mean": -13.454909296955725, "retail_diff": -38.32922487351756, "arb_diff": -13.403621080475574},
      "2": {"n": 120, "sum_d": -7312.7472731584, "sum_d2": 1189590.3942012796, "mean_diff": -60.939560609653334, "se": 7.217871865480589, "incumbent_mean": 77.8558643979175, "candidate_mean": 16.916303788264166, "retail_diff": -45.24111293162583, "arb_diff": -15.698447678103335},
      "3": {"n": 133, "sum_d": -8771.8758687535, "sum_d2": 1899180.210208813, "mean_diff": -65.95395390040225, "se": 8.673202554857506, "incumbent_mean": 146.55140363646615, "candidate_mean": 80.59744973606391, "retail_diff": -54.0395532840203, "arb_diff": -11.91440061640376},
      "4": {"n": 116, "sum_d": -5387.7627469698, "sum_d2": 865851.1881671026, "mean_diff": -46.44623057732586, "se": 6.793207634426026, "incumbent_mean": 120.02204692465259, "candidate_mean": 73.57581634732672, "retail_diff": -43.45129080841207, "arb_diff": -2.994939768925004}
    }
  },
  "failures": [],
  "check_values": [17.116002, 20.017111, 2.390311, 241.484752],
  "python_version": "3.12.3",
  "seconds_per_simulation": 0.35
}
