{
 "key": "f-join-only",
 "mech": "f-join-only: join only - N orders priced inside rival best quotes moved back to rival best tick on that side, size unchanged",
 "approach": "Overlay subclass of N: after N's on_step, every new PlaceOrder BUY priced above the rival best bid is repriced to the rival best bid, every SELL below the rival best ask to the rival best ask; size and order id unchanged; cancels untouched. Acts only when N's self.s is in 2..4. Resting orders are not touched. Result: strongly negative; giving up queue priority inside the rival spread loses most retail edge (retail_diff -53) and also worsens arb (-8.8).",
 "tried": [
  "A: join on spreads 2,3,4 (frozen)",
  "B: join on spreads 2,3 only",
  "C: join on spreads 3,4 only"
 ],
 "next": "Reject joining. Being inside the rival's quotes is where N's retail edge comes from; arb reduction must come from sizing/skew/probability estimation, not from retreating to the rival tick.",
 "spreads_acted": [
  2,
  3,
  4
 ],
 "off_equals_n": true,
 "code": "# Overlay f-join-only: N's new orders priced inside the rival's best quotes\n# are moved back to the rival's best tick on their side (size unchanged).\nJOIN_SPREADS = (2, 3, 4)\nJOIN_ON = True\n\n\nclass Strategy(_N):\n    def on_step(self, state):\n        actions = super().on_step(state)\n        if not JOIN_ON:\n            return actions\n        s = getattr(self, \"s\", None)\n        bid = state.competitor_best_bid_ticks\n        ask = state.competitor_best_ask_ticks\n        if s not in JOIN_SPREADS or bid is None or ask is None or actions is None:\n            return actions\n        out = []\n        for a in actions:\n            if isinstance(a, PlaceOrder):\n                if a.side == Side.BUY and a.price_ticks > bid:\n                    a = PlaceOrder(a.side, bid, a.quantity, a.client_order_id)\n                elif a.side == Side.SELL and a.price_ticks < ask:\n                    a = PlaceOrder(a.side, ask, a.quantity, a.client_order_id)\n            out.append(a)\n        return out\n",
 "code_sha256": "1c295cb7f4cdb7cab1c60e123b72d2faa744daf0a79fd7239c5afff158245cf0",
 "assembled_sha256": "17b4ee0942e9465ec087eaf415bf1c8a346eb4dd2f6f372583df3ace4a5dcc93",
 "tuning": {
  "seeds": "320000..320199",
  "selected": "A",
  "variants": {
   "A": {
    "overall": {
     "mean_diff": -64.4958457421355,
     "se": 5.909012173069934,
     "n": 200
    },
    "s1": {
     "mean_diff": 0.0,
     "se": 0.0,
     "n": 50
    },
    "s2": {
     "mean_diff": -51.323934585132,
     "se": 6.472300303182868,
     "n": 50
    },
    "s3": {
     "mean_diff": -85.00659119905417,
     "se": 10.468819159688643,
     "n": 48
    },
    "s4": {
     "mean_diff": -120.24338541569038,
     "se": 15.55089184633856,
     "n": 52
    }
   },
   "B": {
    "overall": {
     "mean_diff": -33.232565534056,
     "se": 3.9070916431871976,
     "n": 200
    },
    "s1": {
     "mean_diff": 0.0,
     "se": 0.0,
     "n": 50
    },
    "s2": {
     "mean_diff": -51.323934585132,
     "se": 6.472300303182868,
     "n": 50
    },
    "s3": {
     "mean_diff": -85.00659119905417,
     "se": 10.468819159688643,
     "n": 48
    },
    "s4": {
     "mean_diff": 0.0,
     "se": 0.0,
     "n": 52
    }
   },
   "C": {
    "overall": {
     "mean_diff": -51.664862095852506,
     "se": 6.043031371131238,
     "n": 200
    },
    "s1": {
     "mean_diff": 0.0,
     "se": 0.0,
     "n": 50
    },
    "s2": {
     "mean_diff": 0.0,
     "se": 0.0,
     "n": 50
    },
    "s3": {
     "mean_diff": -85.00659119905417,
     "se": 10.468819159688643,
     "n": 48
    },
    "s4": {
     "mean_diff": -120.24338541569038,
     "se": 15.55089184633856,
     "n": 52
    }
   }
  }
 },
 "paired": {
  "seeds": "430000..430499",
  "n": 500,
  "complete": true,
  "missing_seeds": [],
  "overall": {
   "n": 500,
   "sum_d": -30821.1932245954,
   "sum_d2": 5187543.400474392,
   "mean_diff": -61.6423864491908,
   "se": 3.6300082516999357,
   "incumbent_mean": 95.54201511346659,
   "candidate_mean": 33.899628664275795,
   "retail_diff": -52.8363311357714,
   "arb_diff": -8.806055313437202
  },
  "by_spread": {
   "1": {
    "n": 131,
    "sum_d": 0.0,
    "sum_d2": 0.0,
    "mean_diff": 0.0,
    "se": 0.0,
    "incumbent_mean": 38.277936657049615,
    "candidate_mean": 38.277936657049615,
    "retail_diff": 0.0,
    "arb_diff": 0.0
   },
   "2": {
    "n": 120,
    "sum_d": -8106.1821463100005,
    "sum_d2": 1034006.6588980327,
    "mean_diff": -67.55151788591667,
    "se": 5.836364262533413,
    "incumbent_mean": 77.8558643979175,
    "candidate_mean": 10.304346512000832,
    "retail_diff": -46.425364570773326,
    "arb_diff": -21.126153315128334
   },
   "3": {
    "n": 133,
    "sum_d": -11949.5796975387,
    "sum_d2": 2220884.6824154602,
    "mean_diff": -89.84646389126843,
    "se": 8.083838158413599,
    "incumbent_mean": 146.55140363646615,
    "candidate_mean": 56.70493974519775,
    "retail_diff": -81.4366968156391,
    "arb_diff": -8.409767075680449
   },
   "4": {
    "n": 116,
    "sum_d": -10765.4313807467,
    "sum_d2": 1932652.0591608984,
    "mean_diff": -92.80544293747155,
    "se": 8.365531441646747,
    "incumbent_mean": 120.02204692465259,
    "candidate_mean": 27.216603987181035,
    "retail_diff": -86.34518226649053,
    "arb_diff": -6.460260671014659
   }
  }
 },
 "failures": 0,
 "check_values": {
  "310000": 17.1160017503,
  "310001": 20.0171113118,
  "310002": 2.3903113616,
  "310003": 241.4847522404
 },
 "python_version": "3.12.3",
 "seconds_per_simulation": 0.668,
 "note": "A screen, never a promotion. Paired holdout mean_diff -61.64 (se 3.63). Within a spread the variants are identical, so tuning only chose the spread set; all acted spreads were negative."
}