{"approach":"Spread 1 only: infer this run's symmetric buy/sell retail intensity and lognormal order-size mean from own quote fills. Explicit order ids separate main fills from probes and other bid levels. Fit a compound-Poisson/lognormal likelihood to zero and partial fills with truncation normalization; treat exhausted quotes as right-censored only when the current probability belief safely rules out arbitrage, otherwise omit them with the corresponding conditional normalization. Use three-term moment-matched compound sizes and a 15-point quadrature prior over the simulator parameter bands, updated every 100 steps. Apply half of the posterior change to ask sizing and scale stock demand halfway toward inferred per-side notional flow, bounded to [0.4,1.9]. Bid sizing stays at the base distribution. All trading adaptations are gated by self.s==1. Exact arithmetic-order-preserving optimizations keep runtime competitive. Discovery first 1000 sorted tuning seeds; reserved validation last 1036; code frozen before scoring the unseen spread-1 seeds. Flow errors on 300 base runs are reported in tried.","blocked":null,"python_version":"3.12.3","spread":1,"base_mean_edge":98.4694596619638,"runs":{"tuning":2036,"unseen":1969},"base_unseen":{"mean_edge":41.78494849744236,"retail_edge":65.91107840022042,"arb_edge":-24.1261299027871},"holdout":{"mean_edge":43.05991213528613,"retail_edge":66.86579553104582,"arb_edge":-23.805883395768767,"failures":0},"diff":{"mean":1.2749636378437785,"standard_error":0.22866124461633183,"retail":0.9547171308253937,"arb":0.3202465070183341},"others_identical":{"runs":900,"identical":true},"seconds":{"base":97.14125820901245,"yours":95.32359191693831},"code":"\"\"\"Crossing-cover base with isolated, untuned spread overrides.\"\"\"\nimport math\nfrom orderbook_pm_challenge.strategy import BaseStrategy\nfrom orderbook_pm_challenge.types import CancelOrder, PlaceOrder, Side\n\nP = dict(lam_r=0.25, m=5.0, sig_n=1.2, lam_j=0.0019, sig_j=0.35, sig=0.02,\n         qmax=3000.0, rmin=2, kA=0.7, kL=0.15, pL=0.05,\n         ammo=1.0, ydem=0.4, W=200.0, fy=0.6, ammo_q=60.0, ammo_pmax=0.05, ammo_maxpay=0.02,\n         fb=0.9, fu=0.7, xu=0.1, sticky=1.0, min_ahead=2.0, keep_hi=1.5, keep_lo=0.7, Hu=300.0, bins=8.0, filt=1.0, uni=0.01, jumpinfo=1.0, dmin=0.0, kLb=0.08, kLf=0.08, pinf=1.0, pre=0.0, H1=100.0,\n         ydf=0.6, Wf=2000.0, g_hi=0.15, g_lo=0.15, qf=400.0, pmaxf=0.05, pre_gap=1.0,\n         ydf1=0.6, g1=5.0, f1=0.6, a1=100.0, nb1=0.0, gs=1.0, p1t=1.0, m1=1.0, zd=1.0, pfl=0.0005)\nSQ2 = math.sqrt(2.0)\nSQ2PI = math.sqrt(2.0 * math.pi)\ndef cdf(x): return 0.5 * (1.0 + math.erf(x / SQ2))\ndef pdf(x): return math.exp(-0.5 * x * x) / SQ2PI\ndef inv(p):\n    p = min(max(p, 1e-9), 1 - 1e-9)\n    t = math.sqrt(-2.0 * math.log(min(p, 1 - p)))\n    x = t - (2.515517 + 0.802853 * t + 0.010328 * t * t) / (1 + 1.432788 * t + 0.189269 * t * t + 0.001308 * t ** 3)\n    x = -x if p < 0.5 else x\n    for _ in range(2):\n        d = pdf(x)\n        if d < 1e-12:\n            break\n        x -= (cdf(x) - p) / d\n    return x\ndef lpm(k):\n    return pdf(k) + k * cdf(k)\ndef fl(q):\n    return math.floor(q * 100 + 1e-9) / 100\n\nNODES = [(-2.2, .06), (-1.3, .17), (-0.6, .27), (0.6, .27), (1.3, .17), (2.2, .06)]\nPROBE = 0.01\n\n\n\n# Conditional likelihood of partial fills and zeros. Fully exhausted quotes\n# can be either retail or arbitrage; neither is treated as a zero or a\n# complete retail order. Truncation normalization corrects the selection.\nFLOW_CAPS = (0.03125, 0.0625, 0.125, 0.25, 0.5, 1., 2., 4., 8., 16., 32., 64., 128., 256.)\nFLOW_GRID = []\nFLOW_PRIORS=[]\nfor _rn,_rw in ((-math.sqrt(0.6),5/18),(0.,4/9),(math.sqrt(0.6),5/18)):\n    _r=0.1265+0.0495*_rn\n    for _mn,_mw in ((-0.906179845938664,0.118463442528095),(-0.538469310105683,0.239314335249683),(0.,0.284444444444444),(0.538469310105683,0.239314335249683),(0.906179845938664,0.118463442528095)):\n        _m=4.488+1.848*_mn\n        _parts=[]\n        for _n in (1,2,3):\n            _v=math.log(1+(math.exp(1.44)-1)/_n)\n            _sg=math.sqrt(_v)\n            _mu=math.log(_n*_m)-_v/2\n            _w=_r**_n/math.factorial(_n)\n            _parts.append((_mu,_sg,_w))\n        _norm=[]\n        for _c in FLOW_CAPS:\n            _prob=sum(w*(cdf((math.log(_c)-mu)/sg)-cdf((math.log(0.03)-mu)/sg)) for mu,sg,w in _parts)\n            _norm.append(math.log1p(_prob))\n        _tails=[]\n        for _c in FLOW_CAPS:\n            _cdf=1+sum(w*cdf((math.log(_c)-mu)/sg) for mu,sg,w in _parts)\n            _tails.append(math.log(max(1e-100,1-math.exp(-_r)*_cdf)))\n        FLOW_GRID.append((_r,_m,_parts,_norm,_tails))\n        FLOW_PRIORS.append(math.log(_rw*_mw))\n\nclass Strategy(BaseStrategy):\n    def __init__(self):\n        self.n = 0\n        self.ahead = set()     # main orders placed strictly ahead of any competitor order at their tick\n        self.res = {}          # order id -> uncovered quantity at placement\n        self.bc = None         # belief: sub-tick grid centres (ticks)\n        self.bw = None         # belief: weights\n        self.st = 0.5          # last one-step sd in ticks\n        self.pcb = self.pca = None\n        self.pb = set()\n        self.pa = set()\n        self.tb = 0\n        self.s = None          # competitor spread parameter\n        self.flow_notional = 0.0\n        self.flow_exposure = 0\n        self.last_ask_tick = None\n        self.last_quote_exposed = False\n        self.last_flow_ca = None\n        self.last_flow_cap = 0.0\n        self.last_flow_correction = 1.0\n        self.iv01=inv(0.01)\n        self.iv002=inv(0.002)\n        self.iv998=inv(0.998)\n        self.ivtail=inv(1-1e-6)\n        self.params = P.copy()\n        self.fl_obs = ()\n        self.fl_scores = FLOW_PRIORS.copy()\n        self.fl_bins = [0]*len(FLOW_CAPS)\n        self.fl_rate = 0.568734\n        self.fl_r = 0.1265\n        self.fl_m = 4.488\n        self.fl_buy_sum = self.fl_sell_sum = 0.0\n        self.fl_buy_exp = self.fl_sell_exp = 0.0\n        self.fl_exp = 0\n        self.fl_dirty=False\n        self.fl_ahead=set()\n        self.fl_safe_n=0\n        self.fl_sbins=[0]*len(FLOW_CAPS)\n\n\n    def _oid(self, tag):\n        self.n += 1\n        return tag + str(self.n)\n\n    def on_step(self, state):\n        H = max(1, state.steps_remaining)\n        cb = state.competitor_best_bid_ticks or 0\n        ca = state.competitor_best_ask_ticks or 100\n        if self.s is None:\n            self.s = max(1, (ca - cb + 1) // 2)\n            if self.s == 1:\n                self.params.update({'dmin': 0.3, 'pfl': 1e-06})\n            if self.s == 3:\n                self.params.update({'flow_prior': 200, 'flow_level': 0.6, 'flow_strength': 1.0, 'flow_safety': 2.0, 'flow_exposure_min': 5.0})\n        P = self.params\n        if self.s == 3 and self.last_quote_exposed and ca <= self.last_flow_ca + 1:\n            self.flow_exposure += 1\n            self.flow_notional += min(self.last_flow_cap, state.sell_filled_quantity * self.last_ask_tick / 100.0) * self.last_flow_correction\n        lo, hi = cb, ca\n        for o in state.own_orders:\n            if o.side is Side.BUY:\n                lo = max(lo, o.price_ticks)\n            else:\n                hi = min(hi, o.price_ticks)\n        if P['pinf'] > 0:\n            sb = {o.price_ticks for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity <= PROBE + 1e-9}\n            sa = {o.price_ticks for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity <= PROBE + 1e-9}\n            ea = self.pa - sa\n            eb = self.pb - sb\n            if sa and ea:\n                lo = max(lo, min(max(ea), hi))\n            if eb and (sb or min(eb) <= P['p1t']):\n                hi = min(hi, max(min(eb), lo))\n        if P['jumpinfo'] > 0 and self.pcb is not None:\n            if ca > self.pca + 1:\n                lo = max(lo, ca - 1)\n            if cb < self.pcb - 1:\n                hi = min(hi, cb + 1)\n        self.pcb, self.pca = cb, ca\n        if lo > hi:\n            lo, hi = hi, lo\n        # sub-tick belief over p_(t-1): predict with one-step noise, truncate to [lo, hi]\n        exp=math.exp\n        wid = max(hi - lo, 1e-6)\n        nb = max(2, min(48, int(round(wid * P['bins']))))\n        cs = [lo + (i + 0.5) * wid / nb for i in range(nb)]\n        if self.bc is None or P['filt'] <= 0:\n            ws = [1.0 / nb] * nb\n        else:\n            sg = max(self.st, 0.6 * wid / nb)\n            k = -0.5 / (sg * sg)\n            ws = []\n            uni = P['uni'] * sg\n            pairs = tuple(zip(self.bc,self.bw)) if self.s==1 else None\n            if self.s==1 and len(self.bc)==8:\n                c0,c1,c2,c3,c4,c5,c6,c7=self.bc\n                w0,w1,w2,w3,w4,w5,w6,w7=self.bw\n                for c in cs:\n                    t=uni\n                    d=c-c0\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w0*exp(d2)\n                    d=c-c1\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w1*exp(d2)\n                    d=c-c2\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w2*exp(d2)\n                    d=c-c3\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w3*exp(d2)\n                    d=c-c4\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w4*exp(d2)\n                    d=c-c5\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w5*exp(d2)\n                    d=c-c6\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w6*exp(d2)\n                    d=c-c7\n                    d2=d*d*k\n                    if d2>-12.5:\n                        t+=w7*exp(d2)\n                    ws.append(t)\n            else:\n                for c in cs:\n                    t = uni\n                    for ci, wi in (pairs if pairs is not None else zip(self.bc, self.bw)):\n                        d = c - ci\n                        d2 = d * d * k\n                        if d2 > -12.5:\n                            t += wi * exp(d2)\n                    ws.append(t)\n\n            tot = sum(ws)\n            ws = [w / tot for w in ws]\n        self.bc, self.bw = cs, ws\n        mean_t = sum(c * w for c, w in zip(cs, ws))\n        var_t = max(sum(c * c * w for c, w in zip(cs, ws)) - mean_t * mean_t, 0.0)\n        phat = min(max(mean_t / 100.0, 0.002), 0.998)\n        var = P['sig'] ** 2 + P['lam_j'] * P['sig_j'] ** 2\n        sd = math.sqrt(H * var)\n        self.tb = self.tb + 1 if hi <= 1 else 0\n        if self.tb > 0 and P['zd'] > 0:\n            # below the last tick there is no probe: the score keeps walking away from it\n            phat = min(phat, max(P['pfl'], cdf((self.iv01 if self.s==1 else inv(0.01)) - P['zd'] * 0.02 * math.sqrt(self.tb) / sd)))\n        z = (self.iv002 if phat==0.002 else self.iv998 if phat==0.998 else inv(phat)) if self.s==1 else inv(phat)\n        Z = z * sd\n        sp = pdf(z) / sd * P['sig']\n        self.st = sp * 100.0\n        if self.s == 1:\n            remaining={o.order_id:o.remaining_quantity for o in state.own_orders} if self.fl_obs else {}\n            for px, ci, buying, previous, tick in self.fl_obs:\n                qty=max(0.0,sum(q-remaining.get(oid,0.0) for oid,q in previous))\n                x=qty*px\n                cap=FLOW_CAPS[ci]\n                gap=tick/100.0-phat if buying else phat-tick/100.0\n                safe=gap>max(0.005,2.0*math.sqrt(var_t)/100.0)\n                if 0<x<0.03:\n                    continue\n                if x>=cap:\n                    if safe:\n                        self.fl_sbins[ci]+=1\n                        self.fl_exp+=1\n                        self.fl_dirty=True\n                    continue\n                if safe:\n                    self.fl_safe_n+=1\n                else:\n                    self.fl_bins[ci]+=1\n                self.fl_exp+=1\n                self.fl_dirty=True\n                if buying:\n                    self.fl_buy_exp+=1\n                else:\n                    self.fl_sell_exp+=1\n                if x>0:\n                    lx=math.log(x)\n                    for i,(r,m,parts,norm,tails) in enumerate(FLOW_GRID):\n                        density=sum(w*pdf((lx-mu)/sg)/sg for mu,sg,w in parts)\n                        self.fl_scores[i]+=math.log(max(density,1e-100))\n            if state.step % 100 == 0 and (self.fl_dirty or state.step==0):\n                bins=[(i,n) for i,n in enumerate(self.fl_bins) if n]\n                sbins=[(i,n) for i,n in enumerate(self.fl_sbins) if n]\n                logs=[score-sum(n*g[3][i] for i,n in bins)-g[0]*self.fl_safe_n+sum(n*g[4][i] for i,n in sbins) for score,g in zip(self.fl_scores,FLOW_GRID)]\n                mx=max(logs)\n                weights=[math.exp(v-mx) for v in logs]\n                den=sum(weights)\n                self.fl_dirty=False\n                self.fl_rate=sum(w*g[0]*g[1] for w,g in zip(weights,FLOW_GRID))/den\n                self.fl_r=sum(w*g[0] for w,g in zip(weights,FLOW_GRID))/den\n                self.fl_m=sum(w*g[1] for w,g in zip(weights,FLOW_GRID))/den\n\n        s = math.sqrt(sp * sp + var_t / 1e4 + 1e-8)\n        sd1 = math.sqrt(max(1.0, H - 1.0) * var)\n        jp = None if self.s==1 else [(cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES]\n        lj = P['lam_j']\n\n        def AB(x):\n            nonlocal jp\n            if jp is None:\n                jp = [(cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES]\n            k = (x - phat) / s\n            a = s * lpm(k)\n            b = a - (x - phat)\n            if self.s==1:\n                ja=jb=0.0\n                for p,w in jp:\n                    if x>p:\n                        ja += w*(x-p)\n                    else:\n                        jb += w*(p-x)\n            else:\n                ja = sum(w * max(0.0, x - p) for p, w in jp)\n                jb = sum(w * max(0.0, p - x) for p, w in jp)\n            return (1 - lj) * a + lj * ja, (1 - lj) * b + lj * jb\n\n        if H == 1:\n            def AB(x):\n                return (1 - phat) * x, phat * (1 - x)\n        rho = P['lam_r'] * 0.5\n        mu = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n        kA = P['kL'] if phat < P['pL'] else P['kA']\n\n        def qsize(loss, gain, px, flow=False):\n            loss *= kA\n            if gain <= 0:\n                return 0.0\n            rr = (0.125+0.5*(self.fl_r-0.125)) if flow and self.s==1 else rho\n            mm = math.log(5.0+0.5*(self.fl_m-5.0))-0.5*P['sig_n']**2 if flow and self.s==1 else mu\n            tail = loss / (rr * gain)\n            if tail >= 1.0:\n                return 0.0\n            return min(P['qmax'], math.exp(mm + P['sig_n'] * (self.ivtail if self.s==1 and tail<=1e-6 else inv(1 - max(tail, 1e-6)))) / px)\n\n        ptk = phat * 100\n        def qbid(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            if self.s==1 and phat*100-t<P['dmin']:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if phat * 100 - t < P['dmin']:\n                return 0.0\n            if P['nb1'] > 0 and self.s == 1 and t == 1 and ptk < 1.0:\n                return 0.0\n            if phat < P['pL']:\n                ytg = P['ydem'] * min(H, P['W']) / max(ca - 1, ptk + 1) * 100.0\n                a *= (P['kLb'] if state.yes_inventory < ytg else P['kLf']) / P['kL']\n            return qsize(a, b, max(phat, 0.05))\n\n        def qask(t):\n            if not 1 <= t <= 99:\n                return 0.0\n            if self.s==1 and t-phat*100<P['dmin']:\n                return 0.0\n            a, b = AB(t / 100.0)\n            if t - phat * 100 < P['dmin']:\n                return 0.0\n            return qsize(b, a, t / 100.0, flow=True)\n\n        bids = [o for o in state.own_orders if o.side is Side.BUY and o.remaining_quantity > PROBE + 1e-9]\n        asks = [o for o in state.own_orders if o.side is Side.SELL and o.remaining_quantity > PROBE + 1e-9]\n        sticky = P['sticky'] > 0\n        def top(orders, comp, step):\n            if sticky and sum(o.remaining_quantity for o in orders if o.price_ticks == comp and o.order_id in self.ahead) >= P['min_ahead']:\n                return comp\n            return comp + step\n        bid_t = top(bids, cb, 1)\n        ask_t = top(asks, ca, -1)\n        qb = qbid(bid_t)\n        qa = qask(ask_t)\n\n        flow_scale = max(0.4,min(1.9,1.0+0.5*(self.fl_rate/0.568734-1))) if self.s==1 else 1.0\n        Y = state.yes_inventory\n        if ask_t == 1 and H > P['H1'] and P['pre'] > 0:\n            qa = qa if Y >= P['a1'] > 0 else 0.0          # let the competitor's 2-tick ask erode instead of fronting it for nothing\n        # ammunition: hold YES so that low asks are covered\n        ptick = phat * 100\n        amt = 0\n        qam = 0.0\n        if P['ammo'] > 0 and ask_t >= 2 and phat < max(P['ammo_pmax'], P['pmaxf']):\n            wealth = state.cash + Y * phat\n            x = max(ask_t, ptick + 1) / 100.0\n            capw = P['fy'] * wealth / max(phat, 0.005)\n            target = min(flow_scale * P['ydem'] * min(H, P['W']) / x, capw)\n            full = min(flow_scale * P['ydf'] * min(H, P['Wf']) / x, capw) if phat < P['pmaxf'] else 0.0\n            t = max(1, min(99, int(math.ceil(ptick + 1e-9))))\n            g = t - ptick\n            if Y < full and g <= P['g_hi'] and bid_t <= t < ask_t:\n                amt, qam = t, min(P['qf'], full - Y)     # a tick p has just crossed: nearly free\n            elif Y < target and phat < P['ammo_pmax'] and bid_t <= t < ask_t and t / 100.0 - phat < P['ammo_maxpay']:\n                amt, qam = t, min(P['ammo_q'], target - Y)\n            elif Y < full and t >= 2 and 1.0 - g <= P['g_lo']:\n                amt, qam = t - 1, min(P['qf'], full - Y)  # rest just under p: filled only on the crossing, or by retail\n\n        if P['pre'] > 0 and ca == 2 and phat < 0.01 and H > P['H1'] and Y < P['pre'] and not qam and 1.0 - ptick < P['pre_gap']:\n            amt, qam = 1, min(P['ammo_q'], P['pre'] - Y)\n        q1 = 0.0\n        if P['ydf1'] > 0 and P['m1'] < ptick < P['g1'] + 1.0 and amt != 1:\n            stock_rate = flow_scale * P['ydf1']\n            if self.s == 3:\n                flow = (self.flow_notional + P['flow_prior'] * P['flow_level']) / (P['flow_prior'] + self.flow_exposure)\n                scale = max(0.5, min(2.0, flow / P['flow_level']))\n                stock_rate *= 1.0 + P['flow_strength'] * (scale - 1.0)\n            q1 = max(0.0, stock_rate * min(H, P['Wf']) / (self.s / 100.0) - Y)\n\n        # Bridge expected retail demand until another tick crossing is available.\n        if 0.02 < phat < 0.1:\n            ct = max(2, min(99, int(math.floor(ptick))))\n            wealth = state.cash + Y * phat\n            goal = min(flow_scale * qa, 0.3 * max(wealth, 0.0) / phat)\n            if Y < goal and ct < ask_t:\n                amt, qam = ct, min(3000.0, goal - Y)\n        # order management\n        actions = []\n        free = state.free_cash - 2.0\n        keep_ask = 0.0\n        new_b = []\n        new_a = []\n        def cancel(o):\n            nonlocal free\n            actions.append(CancelOrder(o.order_id))\n            x = o.price_ticks / 100.0\n            if o.side is Side.BUY:\n                free += x * o.remaining_quantity\n            else:\n                free += (1 - x) * min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n            self.ahead.discard(o.order_id)\n            self.res.pop(o.order_id, None)\n        for o in state.own_orders:\n            if o.remaining_quantity <= PROBE + 1e-9:\n                cancel(o)\n        kept_ids = set()\n        def manage(orders, t, q, comp):\n            kept = 0.0\n            for o in orders:\n                if o.price_ticks == t and q > 0 and kept + o.remaining_quantity <= max(q * P['keep_hi'], 1.0):\n                    kept += o.remaining_quantity\n                    kept_ids.add(o.order_id)\n                else:\n                    cancel(o)\n            return kept\n        kb = manage(bids, bid_t, qb, cb)\n        ka = manage(asks, ask_t, qa, ca)\n        add_b = (qb - kb) if (kb < qb * P['keep_lo'] and bid_t != cb) else 0.0\n        add_a = (qa - ka) if (ka < qa * P['keep_lo'] and ask_t != ca) else 0.0\n\n        budget = P['fb'] * max(free, 0.0)\n        cost = add_b * bid_t / 100.0 + qam * amt / 100.0\n        if cost > budget:\n            f = budget / cost\n            add_b *= f\n            qam *= f\n            cost = budget\n        out = []\n        q1 = min(q1, P['f1'] * max(budget - cost, 0.0) * 100.0)\n        if q1 >= 0.01:\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=1, quantity=fl(q1)))\n            free -= fl(q1) / 100.0 + 1e-6\n        if amt and qam >= 0.01:\n            q = fl(qam)\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=amt, quantity=q))\n            free -= q * amt / 100.0 + 1e-6\n        if bid_t >= 1 and add_b >= 0.01:\n            q = fl(add_b)\n            oid = self._oid('b')\n            out.append(PlaceOrder(side=Side.BUY, price_ticks=bid_t, quantity=q, client_order_id=oid))\n            free -= q * bid_t / 100.0 + 1e-6\n            if bid_t > cb:\n                self.ahead.add(oid)\n        if ask_t <= 99 and add_a >= 0.01:\n            x = ask_t / 100.0\n            covk = sum(o.remaining_quantity - min(self.res.get(o.order_id, 0.0), o.remaining_quantity)\n                       for o in asks if o.order_id in kept_ids)\n            cov = max(0.0, Y - covk - 0.1)\n            unc = max(0.0, add_a - cov)\n            if unc > 0:\n                ub = max(0.0, free - (1 - P['fu']) * max(state.cash, 0.0)) if x >= P['xu'] else 0.0\n                if H < P['Hu'] and phat < 0.05:\n                    ub = max(0.0, free * (1 - H / P['Hu']))\n                unc = min(unc, ub / (1 - x))\n            q = fl(min(add_a, cov + unc))\n            if q >= 0.01:\n                oid = self._oid('a')\n                out.append(PlaceOrder(side=Side.SELL, price_ticks=ask_t, quantity=q, client_order_id=oid))\n                r = max(0.0, q - cov)\n                self.res[oid] = r\n                free -= r * (1 - x) + 1e-6\n                if ask_t < ca:\n                    self.ahead.add(oid)\n\n        # probes: tiny orders that the arbitrageur removes when p crosses them\n        f = int(math.floor(ptick + 1e-9))\n        r = max(int(P['rmin']), int(math.ceil(2.0 * s * 100)))\n        self.pb = set()\n        self.pa = set()\n        if free > 1.0:\n            for t in range(f, f + r + 1):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(PlaceOrder(side=Side.BUY, price_ticks=t, quantity=PROBE))\n                    self.pb.add(t)\n            for t in range(f + 1 - r, f + 2):\n                if cb < t < ca and 1 <= t <= 99:\n                    out.append(PlaceOrder(side=Side.SELL, price_ticks=t, quantity=PROBE))\n                    self.pa.add(t)\n        if self.s == 3:\n            self.last_ask_tick = ask_t\n            self.last_flow_ca = ca\n            exposed_qty = ka + sum(o.quantity for o in out if o.side is Side.SELL and o.price_ticks == ask_t and o.quantity > PROBE)\n            self.last_flow_cap = exposed_qty * ask_t / 100.0\n            self.last_quote_exposed = ask_t / 100.0 > phat + max(0.005, P['flow_safety'] * self.st / 100.0) and self.last_flow_cap >= P['flow_exposure_min']\n            if self.last_quote_exposed:\n                logcap = math.log(self.last_flow_cap)\n                mu_flow = math.log(P['m']) - 0.5 * P['sig_n'] ** 2\n                clipped = P['m'] * cdf((logcap - mu_flow - P['sig_n'] ** 2) / P['sig_n']) + self.last_flow_cap * (1.0 - cdf((logcap - mu_flow) / P['sig_n']))\n                self.last_flow_correction = min(3.0, P['m'] / max(clipped, 0.01))\n        if self.s == 1:\n            if not kept_ids and not any(o.quantity>PROBE for o in out):\n                self.fl_obs=()\n                self.fl_ahead.clear()\n                return actions+out\n            # Give stock orders explicit ids so per-order remaining quantities\n            # separate their fills from other bid levels and tiny probes.\n            for i,o in enumerate(out):\n                if o.client_order_id is None and o.quantity>PROBE:\n                    out[i]=PlaceOrder(side=o.side,price_ticks=o.price_ticks,quantity=o.quantity,client_order_id=self._oid('f'))\n            live=[]\n            oldids={o.order_id for o in state.own_orders if o.order_id in kept_ids}\n            self.fl_ahead.intersection_update(oldids)\n            for o in state.own_orders:\n                if o.order_id in kept_ids and o.remaining_quantity>PROBE:\n                    live.append((o.side,o.price_ticks,o.remaining_quantity,o.order_id))\n            for o in out:\n                if o.quantity>PROBE:\n                    live.append((o.side,o.price_ticks,o.quantity,o.client_order_id))\n                    if (o.side is Side.SELL and o.price_ticks<ca) or (o.side is Side.BUY and o.price_ticks>cb):\n                        self.fl_ahead.add(o.client_order_id)\n            obs=[]\n            for buying,side,comp in ((True,Side.SELL,ca),(False,Side.BUY,cb)):\n                orders=[o for o in live if o[0] is side]\n                if not orders:\n                    continue\n                tick=min(o[1] for o in orders) if buying else max(o[1] for o in orders)\n                orders=[o for o in orders if o[1]==tick]\n                if not all(o[3] in self.fl_ahead for o in orders):\n                    continue\n                if (buying and tick>comp) or (not buying and tick<comp):\n                    continue\n                px=tick/100.0 if buying else max(phat,0.05)\n                cap=sum(o[2] for o in orders)*px\n                if cap<0.04:\n                    continue\n                ci=0\n                while ci+1<len(FLOW_CAPS) and FLOW_CAPS[ci+1]<cap-0.01:\n                    ci+=1\n                obs.append((px,ci,buying,[(o[3],o[2]) for o in orders],tick))\n            self.fl_obs=obs\n        return actions + out\n","code_sha256":"8d64518c77c4093ff35656f6680da3fb22b50ffada4bdfd5b05de0ecac82ed4b","tried":["Spread-1 tuning seeds in [8000,15999]: 8005,8007,8009,8014,8016,8018,8019,8020,8021,8025,8029,8030,8034,8035,8036,8037,8043,8047,8048,8050,8051,8052,8057,8058,8062,8069,8074,8077,8078,8080,8083,8084,8086,8087,8091,8092,8096,8098,8100,8104,8108,8109,8110,8114,8116,8117,8119,8122,8124,8142,8148,8149,8153,8162,8167,8171,8178,8179,8181,8182,8183,8184,8185,8198,8206,8207,8222,8227,8228,8230,8234,8236,8245,8249,8250,8251,8256,8259,8262,8265,8268,8270,8275,8284,8293,8295,8298,8299,8300,8301,8303,8308,8311,8317,8323,8329,8339,8340,8341,8351,8354,8356,8365,8366,8370,8371,8374,8381,8383,8385,8387,8390,8397,8398,8400,8414,8425,8426,8428,8429,8430,8437,8438,8439,8446,8447,8450,8453,8458,8460,8461,8463,8464,8468,8471,8473,8474,8478,8485,8489,8490,8491,8492,8503,8508,8510,8514,8515,8517,8521,8523,8524,8531,8539,8541,8547,8552,8553,8557,8563,8571,8572,8575,8583,8592,8596,8598,8605,8608,8613,8614,8620,8629,8635,8636,8649,8653,8655,8656,8658,8665,8666,8672,8673,8678,8683,8684,8700,8703,8705,8716,8718,8722,8723,8724,8725,8729,8735,8740,8741,8746,8748,8750,8754,8755,8758,8760,8767,8770,8774,8775,8776,8779,8780,8782,8783,8785,8793,8796,8797,8804,8805,8808,8815,8816,8819,8822,8825,8831,8835,8840,8842,8845,8849,8850,8851,8854,8855,8859,8864,8869,8871,8874,8875,8883,8886,8890,8902,8904,8910,8911,8914,8916,8923,8934,8937,8941,8942,8944,8949,8954,8955,8956,8961,8963,8973,8978,8984,8986,8988,8996,8997,9004,9008,9016,9018,9023,9026,9028,9034,9036,9038,9044,9046,9051,9052,9054,9056,9061,9071,9074,9076,9085,9086,9087,9091,9093,9094,9095,9096,9097,9109,9110,9111,9113,9114,9121,9127,9142,9145,9155,9162,9163,9164,9166,9170,9174,9177,9188,9189,9195,9204,9205,9210,9215,9219,9225,9226,9229,9233,9234,9242,9244,9248,9254,9255,9262,9274,9275,9277,9279,9282,9285,9289,9290,9291,9297,9303,9314,9316,9329,9334,9348,9352,9353,9354,9355,9361,9362,9370,9371,9375,9383,9390,9392,9397,9400,9401,9406,9413,9416,9419,9422,9426,9429,9437,9447,9450,9451,9453,9459,9468,9475,9476,9477,9480,9484,9485,9486,9490,9494,9496,9500,9507,9512,9514,9515,9520,9522,9530,9534,9540,9544,9546,9551,9552,9553,9556,9558,9563,9565,9567,9568,9572,9579,9580,9582,9583,9584,9588,9596,9599,9610,9614,9616,9624,9628,9629,9630,9633,9636,9642,9650,9652,9653,9654,9656,9657,9660,9661,9664,9680,9681,9683,9686,9693,9694,9699,9701,9703,9714,9718,9725,9739,9740,9742,9744,9745,9752,9753,9757,9762,9763,9764,9766,9768,9770,9780,9781,9782,9783,9784,9787,9790,9791,9793,9795,9796,9804,9806,9807,9812,9815,9820,9824,9832,9838,9844,9845,9856,9865,9866,9867,9868,9872,9882,9884,9890,9899,9902,9903,9908,9909,9912,9917,9920,9928,9929,9943,9944,9954,9955,9958,9960,9961,9964,9965,9966,9967,9968,9970,9982,9984,9990,9994,10000,10003,10005,10006,10015,10021,10023,10032,10036,10039,10040,10051,10061,10065,10070,10071,10075,10089,10093,10099,10103,10107,10112,10114,10116,10136,10141,10145,10150,10156,10160,10176,10181,10182,10183,10190,10197,10198,10199,10205,10206,10214,10215,10224,10235,10244,10250,10255,10258,10264,10269,10273,10274,10283,10288,10289,10292,10299,10301,10304,10310,10311,10312,10313,10320,10322,10324,10326,10339,10343,10344,10346,10348,10350,10355,10359,10364,10366,10367,10371,10378,10379,10380,10387,10390,10397,10399,10400,10405,10407,10416,10418,10429,10439,10445,10446,10451,10453,10454,10457,10466,10468,10469,10474,10476,10480,10482,10483,10484,10485,10489,10490,10492,10493,10494,10495,10498,10499,10503,10506,10507,10511,10516,10523,10525,10528,10538,10543,10544,10548,10550,10553,10554,10555,10557,10560,10565,10569,10574,10575,10582,10584,10591,10596,10599,10600,10608,10610,10617,10619,10623,10624,10629,10631,10633,10634,10636,10639,10641,10642,10646,10647,10649,10651,10654,10655,10666,10667,10670,10672,10674,10675,10680,10681,10683,10685,10692,10693,10694,10695,10701,10702,10704,10707,10712,10715,10716,10721,10724,10726,10727,10728,10729,10736,10739,10741,10742,10743,10744,10748,10750,10751,10752,10760,10761,10766,10768,10773,10775,10782,10790,10793,10795,10819,10834,10835,10838,10839,10841,10842,10844,10847,10849,10850,10851,10852,10854,10855,10860,10862,10866,10867,10871,10884,10887,10889,10891,10906,10907,10913,10917,10919,10922,10927,10928,10936,10938,10940,10944,10945,10947,10949,10955,10956,10957,10958,10960,10965,10967,10968,10976,10983,10997,11017,11019,11025,11027,11033,11038,11047,11050,11053,11056,11059,11063,11067,11095,11096,11101,11114,11116,11122,11130,11132,11135,11136,11142,11145,11149,11151,11154,11157,11158,11160,11163,11164,11165,11166,11169,11170,11171,11176,11178,11189,11190,11193,11194,11195,11196,11201,11202,11203,11208,11210,11218,11220,11222,11227,11228,11237,11245,11252,11253,11258,11266,11279,11282,11286,11287,11299,11304,11307,11313,11315,11317,11325,11331,11332,11342,11346,11353,11363,11364,11365,11366,11368,11373,11379,11381,11383,11384,11395,11401,11406,11407,11408,11418,11422,11423,11425,11428,11432,11436,11438,11446,11451,11460,11461,11465,11467,11471,11472,11474,11480,11486,11500,11502,11504,11508,11509,11512,11516,11521,11534,11537,11540,11542,11548,11551,11554,11558,11562,11563,11566,11569,11570,11578,11582,11586,11592,11596,11598,11599,11601,11602,11604,11605,11609,11613,11617,11621,11628,11639,11642,11658,11662,11663,11664,11666,11668,11670,11673,11678,11681,11683,11684,11687,11689,11692,11702,11705,11707,11715,11717,11726,11727,11731,11736,11742,11763,11767,11768,11769,11770,11771,11773,11776,11780,11783,11786,11788,11791,11794,11795,11797,11805,11807,11809,11812,11817,11818,11820,11822,11828,11832,11837,11838,11839,11841,11848,11849,11850,11852,11853,11862,11867,11872,11881,11887,11890,11895,11896,11897,11909,11911,11917,11920,11922,11927,11937,11943,11945,11951,11957,11965,11966,11967,11968,11983,11987,11996,11998,12005,12013,12018,12029,12039,12047,12048,12058,12059,12060,12065,12067,12068,12069,12070,12078,12079,12082,12084,12085,12087,12092,12093,12094,12109,12111,12118,12119,12121,12122,12123,12124,12127,12129,12132,12135,12137,12140,12142,12143,12148,12162,12163,12167,12176,12179,12181,12182,12185,12187,12190,12196,12200,12201,12210,12213,12216,12218,12221,12228,12230,12242,12245,12247,12248,12251,12252,12255,12260,12261,12265,12268,12283,12284,12285,12286,12287,12299,12301,12303,12309,12310,12320,12324,12331,12334,12337,12339,12342,12348,12350,12356,12361,12362,12368,12372,12376,12384,12385,12387,12388,12390,12393,12395,12402,12405,12406,12414,12416,12418,12425,12429,12430,12431,12436,12438,12441,12442,12449,12452,12454,12455,12462,12463,12467,12477,12483,12486,12493,12496,12497,12503,12504,12509,12511,12512,12516,12520,12521,12522,12525,12528,12532,12538,12553,12554,12560,12561,12566,12567,12572,12577,12580,12583,12590,12599,12602,12615,12616,12617,12618,12623,12625,12630,12639,12641,12645,12647,12658,12660,12673,12678,12682,12688,12690,12693,12697,12701,12703,12704,12705,12717,12719,12720,12732,12733,12735,12743,12753,12759,12761,12767,12777,12783,12785,12786,12788,12799,12800,12807,12815,12816,12818,12819,12823,12829,12840,12848,12858,12871,12877,12881,12887,12890,12895,12897,12906,12910,12912,12928,12936,12939,12945,12947,12948,12960,12971,12973,12976,12990,12992,12995,13006,13009,13011,13013,13017,13019,13020,13021,13022,13030,13034,13037,13039,13042,13056,13064,13066,13067,13070,13072,13078,13079,13082,13090,13092,13093,13095,13097,13102,13103,13113,13117,13121,13127,13142,13146,13151,13154,13161,13166,13170,13171,13177,13180,13181,13184,13186,13192,13194,13198,13204,13205,13206,13207,13211,13212,13217,13224,13226,13229,13230,13235,13236,13237,13247,13253,13265,13266,13269,13272,13276,13280,13294,13297,13301,13304,13314,13320,13324,13331,13333,13336,13341,13348,13350,13351,13353,13358,13363,13364,13365,13366,13367,13368,13374,13375,13377,13378,13381,13386,13390,13392,13395,13396,13405,13407,13410,13414,13415,13416,13424,13429,13433,13438,13439,13441,13446,13451,13462,13463,13466,13476,13477,13487,13497,13504,13505,13506,13515,13518,13523,13525,13529,13531,13534,13536,13538,13544,13545,13550,13551,13552,13554,13556,13558,13563,13570,13577,13583,13586,13588,13589,13590,13591,13602,13605,13613,13616,13620,13628,13630,13633,13635,13637,13639,13641,13649,13656,13661,13666,13667,13668,13688,13690,13695,13697,13701,13708,13715,13717,13720,13727,13729,13733,13735,13737,13745,13746,13747,13749,13754,13756,13759,13762,13763,13775,13778,13779,13782,13785,13798,13800,13807,13811,13813,13814,13815,13821,13825,13830,13831,13838,13839,13841,13846,13849,13854,13856,13860,13864,13874,13877,13878,13879,13884,13888,13890,13894,13899,13905,13909,13911,13916,13918,13924,13928,13929,13930,13933,13937,13939,13942,13944,13948,13951,13952,13953,13954,13956,13960,13964,13967,13974,13981,13982,13985,13987,13989,13992,13998,13999,14000,14003,14009,14020,14026,14027,14037,14040,14041,14043,14045,14046,14051,14060,14062,14063,14067,14070,14077,14086,14105,14111,14113,14118,14125,14128,14130,14132,14134,14136,14139,14144,14145,14155,14156,14159,14164,14165,14166,14169,14176,14178,14184,14187,14192,14193,14196,14202,14208,14209,14215,14217,14219,14221,14232,14234,14237,14239,14242,14246,14249,14250,14251,14252,14254,14262,14265,14269,14281,14293,14294,14297,14298,14299,14303,14305,14308,14309,14312,14315,14319,14320,14324,14325,14327,14329,14333,14336,14337,14341,14342,14346,14347,14348,14353,14356,14360,14366,14371,14374,14375,14376,14383,14384,14386,14387,14397,14398,14402,14403,14408,14409,14416,14424,14430,14433,14434,14438,14449,14451,14452,14463,14466,14469,14473,14484,14489,14493,14496,14498,14499,14502,14503,14504,14509,14510,14512,14521,14524,14526,14530,14532,14533,14539,14540,14548,14550,14552,14560,14562,14571,14578,14581,14583,14587,14591,14598,14602,14613,14617,14619,14621,14632,14636,14637,14642,14650,14651,14659,14660,14662,14663,14665,14668,14674,14676,14683,14696,14697,14700,14706,14708,14711,14717,14718,14719,14720,14726,14727,14734,14738,14739,14743,14746,14757,14758,14763,14768,14769,14775,14776,14778,14781,14783,14787,14788,14790,14792,14794,14797,14799,14803,14806,14809,14817,14818,14819,14823,14828,14830,14838,14849,14850,14858,14859,14867,14870,14873,14876,14879,14880,14881,14882,14892,14894,14895,14908,14913,14915,14917,14918,14924,14925,14926,14928,14930,14932,14936,14937,14940,14942,14944,14946,14947,14952,14953,14954,14956,14962,14970,14972,14976,14978,14979,14986,14987,14988,14994,14997,15003,15013,15024,15025,15030,15032,15036,15043,15050,15053,15056,15060,15061,15063,15065,15066,15067,15068,15079,15088,15094,15097,15099,15105,15110,15113,15115,15117,15125,15131,15135,15136,15140,15148,15152,15157,15160,15165,15166,15168,15170,15175,15181,15188,15189,15202,15207,15209,15210,15214,15216,15226,15235,15242,15252,15256,15268,15269,15272,15279,15284,15285,15290,15291,15298,15299,15303,15307,15308,15312,15314,15317,15319,15322,15327,15342,15344,15345,15346,15347,15350,15351,15354,15357,15359,15366,15369,15374,15377,15384,15387,15390,15391,15392,15394,15399,15402,15403,15411,15414,15415,15418,15419,15420,15425,15434,15437,15438,15439,15442,15446,15450,15453,15454,15466,15473,15474,15476,15479,15486,15489,15494,15495,15497,15503,15504,15505,15510,15511,15523,15524,15527,15531,15535,15545,15550,15552,15558,15559,15565,15575,15577,15585,15598,15600,15607,15616,15617,15620,15634,15636,15638,15639,15648,15649,15650,15656,15659,15664,15667,15673,15675,15676,15680,15681,15685,15689,15692,15693,15698,15709,15710,15713,15715,15718,15719,15720,15722,15724,15732,15734,15735,15739,15742,15746,15757,15760,15765,15775,15779,15781,15788,15798,15800,15801,15803,15805,15811,15812,15813,15820,15823,15829,15831,15839,15841,15842,15843,15844,15848,15849,15857,15863,15868,15869,15872,15874,15879,15883,15890,15896,15907,15908,15909,15911,15917,15921,15924,15926,15931,15935,15942,15959,15960,15962,15965,15966,15968,15972,15981,15982,15984,15986,15988,15993,15995,15996","Spread-1 unseen seeds in [60000,67999]: 60004,60012,60014,60016,60021,60023,60027,60028,60044,60045,60056,60062,60067,60069,60075,60076,60079,60081,60082,60089,60090,60092,60094,60099,60103,60104,60113,60117,60127,60131,60132,60133,60141,60143,60147,60152,60153,60155,60156,60159,60165,60167,60175,60178,60180,60181,60189,60194,60195,60196,60210,60212,60214,60217,60218,60225,60232,60235,60243,60244,60249,60251,60253,60263,60265,60266,60268,60269,60273,60283,60285,60288,60289,60296,60297,60298,60301,60306,60309,60312,60316,60317,60320,60325,60329,60330,60334,60338,60341,60343,60344,60361,60362,60369,60370,60376,60377,60381,60393,60394,60396,60403,60404,60415,60416,60417,60421,60426,60433,60434,60436,60443,60446,60448,60454,60463,60465,60469,60473,60475,60478,60490,60494,60496,60498,60500,60501,60519,60521,60524,60526,60527,60529,60533,60543,60544,60553,60554,60555,60558,60560,60564,60573,60578,60579,60580,60583,60588,60590,60595,60604,60605,60612,60619,60620,60622,60623,60628,60632,60634,60636,60642,60643,60647,60656,60658,60659,60661,60663,60667,60668,60672,60674,60678,60679,60686,60688,60690,60691,60698,60704,60711,60712,60714,60719,60723,60724,60736,60738,60741,60743,60744,60746,60751,60753,60762,60780,60782,60787,60792,60798,60799,60802,60803,60805,60807,60808,60812,60819,60820,60821,60825,60829,60831,60834,60836,60852,60853,60860,60863,60864,60867,60868,60874,60875,60883,60887,60888,60894,60902,60903,60917,60930,60933,60934,60936,60949,60952,60956,60966,60972,60975,60984,60985,60990,60991,60992,60993,60997,61000,61007,61008,61009,61010,61018,61021,61024,61045,61047,61049,61053,61058,61071,61075,61078,61080,61083,61084,61092,61093,61104,61106,61114,61122,61134,61136,61140,61144,61146,61149,61150,61151,61160,61165,61174,61176,61180,61186,61187,61191,61199,61205,61206,61207,61208,61209,61213,61217,61218,61219,61221,61222,61227,61229,61235,61236,61238,61239,61241,61246,61259,61262,61264,61272,61273,61274,61275,61278,61283,61285,61293,61295,61296,61298,61299,61301,61311,61313,61314,61315,61318,61319,61321,61340,61342,61350,61353,61356,61359,61360,61365,61372,61373,61381,61385,61387,61388,61390,61393,61394,61401,61403,61408,61412,61420,61427,61428,61429,61432,61440,61441,61445,61446,61448,61460,61463,61466,61467,61474,61477,61480,61485,61491,61494,61496,61500,61511,61515,61519,61520,61522,61525,61532,61533,61537,61540,61545,61546,61553,61554,61556,61561,61563,61565,61566,61572,61573,61575,61576,61579,61585,61587,61588,61590,61599,61600,61602,61609,61615,61621,61622,61626,61636,61644,61658,61661,61663,61671,61672,61678,61682,61692,61693,61694,61701,61702,61704,61717,61725,61726,61736,61737,61738,61741,61747,61751,61755,61763,61765,61767,61768,61769,61770,61776,61777,61781,61784,61786,61790,61791,61800,61801,61803,61804,61806,61819,61823,61825,61827,61829,61833,61834,61835,61839,61840,61846,61854,61857,61863,61868,61870,61872,61873,61883,61891,61893,61898,61900,61901,61906,61915,61916,61919,61926,61927,61937,61941,61942,61947,61949,61952,61954,61955,61958,61969,61977,61980,61981,61994,61998,62003,62004,62008,62009,62015,62017,62018,62019,62020,62027,62032,62038,62039,62042,62048,62055,62065,62068,62072,62081,62088,62092,62094,62096,62106,62112,62120,62124,62128,62131,62141,62145,62147,62151,62152,62161,62165,62168,62170,62175,62183,62184,62186,62187,62211,62214,62217,62220,62222,62223,62226,62229,62230,62232,62233,62239,62241,62243,62244,62248,62249,62251,62253,62255,62258,62260,62262,62270,62282,62284,62285,62306,62307,62311,62315,62316,62320,62322,62326,62331,62341,62354,62364,62371,62376,62379,62383,62384,62392,62396,62399,62400,62403,62410,62414,62416,62417,62418,62439,62441,62445,62446,62452,62453,62456,62461,62462,62465,62466,62468,62470,62475,62476,62477,62488,62491,62493,62495,62508,62511,62536,62537,62552,62560,62564,62567,62571,62572,62573,62574,62577,62580,62582,62587,62589,62590,62592,62595,62604,62608,62609,62620,62623,62626,62632,62634,62637,62639,62643,62645,62646,62662,62663,62668,62672,62679,62682,62683,62684,62685,62689,62692,62693,62700,62701,62706,62707,62718,62719,62722,62743,62745,62751,62756,62759,62761,62763,62769,62774,62785,62788,62799,62804,62805,62806,62812,62813,62815,62821,62824,62825,62828,62829,62834,62838,62839,62842,62852,62867,62869,62876,62880,62881,62882,62887,62888,62890,62899,62905,62912,62913,62919,62920,62925,62927,62935,62938,62944,62946,62947,62952,62953,62970,62975,62976,62979,62986,62987,62989,62994,63004,63018,63021,63024,63026,63027,63036,63038,63039,63041,63044,63046,63049,63051,63052,63053,63054,63058,63062,63070,63077,63078,63079,63081,63084,63087,63090,63092,63096,63097,63102,63106,63113,63117,63119,63121,63122,63124,63128,63131,63135,63140,63150,63152,63157,63158,63162,63168,63171,63185,63195,63198,63200,63204,63210,63211,63213,63220,63222,63227,63239,63240,63241,63243,63248,63250,63252,63255,63260,63261,63267,63271,63275,63277,63279,63280,63282,63288,63289,63293,63295,63299,63300,63304,63306,63311,63312,63320,63323,63325,63328,63334,63337,63339,63345,63348,63350,63357,63367,63369,63379,63392,63398,63403,63407,63409,63412,63415,63425,63426,63427,63439,63442,63447,63457,63459,63466,63471,63473,63481,63484,63487,63505,63508,63518,63520,63523,63525,63535,63537,63539,63541,63549,63552,63559,63561,63562,63566,63567,63583,63585,63592,63598,63599,63600,63607,63610,63619,63620,63621,63622,63624,63626,63628,63634,63640,63649,63650,63655,63662,63670,63673,63679,63681,63682,63684,63687,63688,63698,63703,63708,63712,63721,63724,63730,63733,63745,63748,63751,63761,63764,63768,63769,63771,63772,63778,63779,63780,63786,63790,63803,63810,63811,63818,63826,63827,63837,63839,63851,63852,63857,63860,63862,63868,63871,63873,63875,63877,63882,63883,63886,63889,63891,63895,63896,63897,63899,63904,63906,63910,63912,63917,63920,63922,63925,63927,63931,63932,63934,63935,63958,63961,63966,63967,63970,63974,63979,63987,63997,64005,64006,64007,64014,64030,64033,64036,64038,64044,64046,64050,64060,64061,64063,64064,64070,64076,64080,64082,64083,64098,64104,64105,64106,64109,64110,64111,64113,64115,64116,64122,64127,64133,64134,64139,64140,64144,64151,64152,64159,64161,64165,64176,64177,64178,64180,64181,64188,64191,64192,64195,64200,64212,64216,64218,64219,64224,64225,64228,64229,64230,64237,64243,64245,64248,64249,64252,64255,64256,64257,64258,64259,64261,64268,64269,64273,64277,64280,64290,64292,64298,64300,64301,64306,64309,64316,64320,64321,64332,64335,64336,64339,64346,64351,64352,64355,64360,64363,64369,64375,64380,64381,64382,64388,64389,64401,64419,64421,64429,64433,64437,64444,64453,64459,64462,64464,64466,64467,64468,64476,64483,64485,64486,64488,64493,64494,64506,64512,64516,64517,64519,64527,64532,64533,64534,64538,64539,64544,64545,64547,64548,64550,64551,64556,64558,64566,64568,64575,64580,64582,64583,64587,64594,64596,64617,64623,64633,64638,64641,64643,64644,64648,64650,64653,64658,64663,64665,64674,64675,64677,64679,64682,64684,64687,64689,64697,64699,64703,64706,64710,64712,64718,64729,64736,64742,64743,64747,64748,64749,64752,64763,64764,64768,64774,64778,64782,64784,64793,64795,64798,64801,64805,64812,64829,64830,64833,64834,64838,64840,64845,64847,64851,64858,64861,64862,64863,64865,64868,64871,64872,64874,64875,64878,64879,64881,64885,64889,64892,64894,64900,64903,64904,64906,64908,64916,64924,64925,64926,64927,64931,64943,64945,64947,64948,64951,64954,64959,64961,64970,64973,64974,64978,64981,64998,64999,65004,65014,65021,65024,65026,65029,65030,65032,65034,65035,65051,65054,65056,65058,65060,65061,65063,65064,65067,65068,65071,65079,65080,65082,65083,65090,65097,65105,65106,65111,65114,65119,65120,65128,65133,65134,65137,65141,65142,65146,65152,65155,65158,65161,65164,65167,65172,65181,65182,65184,65188,65195,65202,65203,65211,65220,65225,65231,65239,65247,65256,65258,65260,65261,65267,65271,65273,65279,65283,65284,65285,65286,65293,65300,65310,65314,65320,65333,65334,65335,65337,65339,65341,65343,65346,65347,65348,65350,65352,65353,65360,65363,65376,65377,65389,65392,65394,65395,65396,65400,65401,65402,65404,65407,65415,65418,65422,65426,65435,65445,65446,65461,65464,65467,65468,65469,65471,65473,65478,65480,65481,65483,65486,65493,65495,65496,65501,65507,65510,65511,65516,65521,65523,65524,65542,65545,65546,65550,65553,65555,65557,65563,65584,65589,65590,65597,65600,65611,65618,65620,65627,65633,65638,65642,65644,65645,65646,65650,65652,65657,65662,65665,65666,65667,65671,65675,65677,65681,65682,65683,65685,65686,65694,65696,65698,65703,65704,65714,65723,65730,65731,65735,65738,65742,65748,65750,65753,65754,65756,65757,65762,65763,65765,65768,65772,65776,65784,65785,65788,65791,65799,65803,65812,65817,65818,65820,65822,65827,65829,65832,65834,65837,65838,65839,65840,65842,65851,65854,65856,65858,65863,65874,65875,65883,65884,65885,65888,65890,65892,65893,65895,65896,65909,65910,65915,65916,65920,65924,65934,65936,65937,65938,65944,65949,65951,65955,65961,65962,65966,65970,65977,65981,65992,66001,66004,66006,66007,66010,66012,66015,66019,66023,66025,66040,66041,66045,66066,66067,66072,66077,66079,66084,66086,66087,66088,66089,66091,66096,66098,66101,66109,66111,66112,66118,66129,66134,66140,66142,66152,66154,66155,66156,66158,66163,66166,66168,66172,66176,66177,66178,66191,66196,66200,66209,66215,66216,66219,66222,66223,66228,66229,66233,66234,66236,66240,66245,66251,66256,66261,66265,66269,66272,66275,66276,66278,66279,66282,66283,66287,66297,66298,66299,66305,66306,66313,66319,66322,66323,66325,66326,66328,66334,66342,66345,66347,66348,66349,66350,66352,66360,66362,66363,66372,66373,66374,66375,66377,66380,66392,66395,66397,66407,66413,66426,66432,66437,66444,66454,66455,66456,66457,66463,66464,66465,66467,66473,66479,66480,66486,66490,66501,66504,66507,66511,66513,66522,66529,66532,66533,66534,66538,66555,66558,66567,66568,66574,66575,66577,66580,66589,66596,66597,66599,66605,66610,66613,66618,66620,66622,66626,66629,66635,66640,66646,66656,66658,66660,66670,66671,66672,66675,66677,66686,66690,66694,66699,66701,66704,66705,66706,66707,66713,66718,66719,66720,66724,66732,66733,66734,66736,66737,66739,66746,66749,66751,66767,66769,66776,66777,66779,66780,66783,66787,66788,66791,66795,66796,66801,66804,66806,66809,66812,66822,66823,66824,66825,66832,66834,66835,66838,66839,66840,66842,66843,66844,66845,66855,66858,66860,66871,66875,66876,66877,66878,66879,66889,66898,66902,66910,66911,66912,66930,66932,66935,66936,66938,66939,66944,66947,66951,66954,66955,66959,66966,66968,66969,66972,66981,66984,66997,66998,67006,67012,67014,67018,67019,67022,67023,67035,67036,67039,67059,67063,67066,67069,67071,67072,67079,67081,67088,67100,67115,67118,67127,67129,67130,67131,67136,67139,67140,67143,67149,67150,67151,67152,67155,67156,67166,67167,67175,67185,67188,67191,67193,67198,67203,67210,67222,67235,67236,67242,67243,67248,67249,67251,67252,67256,67258,67260,67261,67268,67271,67274,67277,67278,67280,67284,67285,67286,67292,67293,67297,67303,67307,67311,67313,67323,67326,67337,67341,67345,67347,67352,67355,67356,67357,67361,67367,67368,67370,67374,67377,67378,67382,67384,67389,67392,67402,67414,67419,67430,67431,67433,67436,67443,67451,67463,67464,67467,67469,67473,67482,67489,67494,67497,67502,67503,67506,67511,67513,67514,67516,67517,67519,67520,67524,67525,67529,67530,67540,67546,67549,67552,67553,67554,67559,67576,67577,67595,67598,67601,67606,67608,67612,67613,67619,67623,67626,67636,67640,67645,67650,67654,67662,67665,67675,67687,67688,67692,67698,67705,67706,67712,67715,67718,67719,67721,67722,67727,67731,67732,67735,67741,67745,67746,67748,67750,67752,67754,67757,67763,67764,67769,67783,67785,67793,67798,67801,67807,67816,67826,67830,67838,67841,67843,67851,67854,67861,67863,67864,67865,67866,67876,67877,67880,67881,67882,67886,67887,67891,67899,67900,67901,67910,67914,67924,67930,67932,67937,67938,67945,67946,67948,67952,67955,67957,67963,67973,67975,67979,67982,67985,67987,67991,67998","Clipped-moment safe quote correction, adaptive stock and both quote sides: discovery n=400, paired mean=-1.1625706721105005, SE=1.1121061395252385, retail=0.4569918337072499, arb=-1.6195625058307508, failures=0.","Clipped-moment correction, stock only: discovery n=400, paired mean=-1.3757729500555005, SE=0.8845234744728321, retail=0.7449640272759998, arb=-2.120736977330751, failures=0.","Control: fixed spread-1 retail r=0.1265 and mean=4.488, no learning: discovery n=400, paired mean=0.23824621020424946, SE=0.7204592921155325, retail=-0.6650084848907497, arb=0.9032546950922495, failures=0.","Conditional partial-fill likelihood, stock only: discovery n=1000, paired mean=0.1390639473742994, SE=0.9078152721478023, retail=1.1445802189571002, arb=-1.0055162715836, failures=0.","Conditional partial-fill likelihood, both quote sides: discovery n=1000, paired mean=0.1891425191721999, SE=0.34545837965818316, retail=-0.9063904073221998, arb=1.0955329264767, failures=0.","Per-order conditional likelihood, full-strength stock only: discovery n=1000, paired mean=0.6306730958439997, SE=1.051378074415013, retail=1.3230013718988, arb=-0.6923282760532005, failures=0.","Per-order conditional likelihood, centered ask/bid and stock: discovery n=400, paired mean=0.5552051425722501, SE=2.366522484464565, retail=0.26550439766475004, arb=0.2897007448857496, failures=0.","Per-order conditional likelihood, full-strength asks and stock: discovery n=400, paired mean=0.21081694601699963, SE=1.8835230741585576, retail=0.5427411299147501, arb=-0.3319241839042503, failures=0.","Per-order conditional likelihood, half-strength asks and stock: discovery n=1000, paired mean=0.44476183522509966, SE=0.43625713421253937, retail=0.7520782963882997, arb=-0.3073164611795002, failures=0.","Per-order conditional likelihood, half-strength both quote sides and stock: discovery n=1000, paired mean=0.5765420475980997, SE=0.4735764350939456, retail=0.6372019004777, arb=-0.06065985290300024, failures=0.","One-sided downward stock adaptation plus half-strength asks: discovery n=1000, paired mean=0.4666609497021, SE=0.2460001457138374, retail=-0.14873764225159983, arb=0.6153985919375001, failures=0.","Half-strength asks/stock only in final 1000 steps below 5 cents: discovery n=1000, paired mean=0.1950928906026997, SE=0.38659273438441494, retail=0.7278355443625002, arb=-0.5327426537594002, failures=0.","Censor-aware likelihood with probability-based safe exhaustion classification, stock only: discovery n=1000, paired mean=2.1813669080684, SE=1.3667174879116994, retail=0.9146415090115001, arb=1.2667253990558998, failures=0.","Same classifier, half-strength asks and stock: discovery n=1000, paired mean=0.739012730499, SE=0.37099125111691134, retail=0.5172738843237, arb=0.22173884616979989, failures=0.","15-point quadrature every 100 steps, aggregate fills only at single-price sides: discovery n=1000, paired mean=0.3933165930182, SE=0.38374502688707024, retail=0.7215391185797999, arb=-0.3282225255777999, failures=0.","Diagnostic only, NOT submitted: exact retail configuration injected into half-strength ask/stock policy: discovery n=1000, paired mean=0.9064906857086001, SE=0.686157672598964, retail=1.1200554982583002, arb=-0.2135648125579002, failures=0.","Rejected clipped-moment estimator: n=300 first tuning seeds; pooled expected buy and sell flow, dollars/side/step; step 200: bias=0.002129366782287467, RMSE=0.193396311599441, MAE=0.15679525503724137, mean observations=0.6766666666666666; step 500: bias=0.008025060402182331, RMSE=0.18776705876454064, MAE=0.153462532117275, mean observations=5.233333333333333; step 1000: bias=0.04441964598834856, RMSE=0.44377712608693837, MAE=0.1820692229676807, mean observations=27.166666666666668. Constant-prior RMSE at every checkpoint=0.19318593074364454. Both directional estimates are the same because the simulator fixes buy probability at 0.5; actual latent target is arrival_rate*mean_notional/2.","Frozen estimator on BASE own fills, per-order censor-aware quadrature: n=300 first tuning seeds; pooled expected buy and sell flow, dollars/side/step; step 200: bias=-0.002314560858926281, RMSE=0.19461219469095833, MAE=0.15695093402181887, mean observations=20.506666666666668; step 500: bias=-0.007073829380339811, RMSE=0.1858302864775169, MAE=0.14879807835778378, mean observations=72.44; step 1000: bias=-0.01661692451285235, RMSE=0.17458850664655445, MAE=0.13832691970171943, mean observations=200.66666666666666. Constant-prior RMSE at every checkpoint=0.19318593074364454. Both directional estimates are the same because the simulator fixes buy probability at 0.5; actual latent target is arrival_rate*mean_notional/2.","Scorer reproduced exactly: 4000 seeds 4000..7999, workers=4, no sandbox, mean edge=98.4694596619638, failures=0. Simulator commit b244530ee2a6247b5f930830eeca9dd950da0e7e, Python standard library only.","Economic equivalence checks: assigning explicit non-probe ids preserved all result fields on 100 runs; frozen exact-math optimizations preserved all result fields versus the unoptimized quadrature variant on 100 runs. Preliminary CPU timing on first 30 tuning runs: base=15.574235853 seconds, frozen=15.347545657 seconds. Final seconds fields separately measure 200 complete runs per strategy in one process.","Frozen code reserved tuning validation (last 1036 spread-1 seeds, not used to find the change): {\"runs\":1036,\"mean\":1.7873440313440159,\"standard_error\":0.6442656590172311,\"retail\":0.7865928490944983,\"arb\":1.0007511822525095,\"failures\":0}","Frozen spread-isolation check: 300 runs each of spreads 2/3/4, first qualifying seeds from 60000 onward; all 900 complete SimulationResult dictionaries exactly match base, including retail/arb edges, wealth, inventory and failure fields; failures=0. All 9 source passages re-fetched and verified exactly.","Post-freeze unseen diagnostic, no retuning: {\"positive\":1079,\"negative\":844,\"unchanged\":46,\"median\":0.0009179807999999956,\"first_half_mean\":1.4018502212509147,\"second_half_mean\":1.1482058733030458,\"flow_quintile_means\":[1.039661056851399,0.8725243873723348,0.5134348117677667,0.012248920476903501,3.936351798077919]}","Selected: censor-aware 15-point Gauss-Legendre posterior over per-side Poisson intensity and mean lognormal notional; update every 100 steps; half-strength ask size and stock demand adaptation. First 1000 discovery seeds: paired mean=0.7979031462641999, SE=0.35192729536149375; first 400 gain=0.7985923856897501, next 600 gain=0.7974436533138332. Last 1036 tuning seeds reserved for subsequent validation. Reserved validation: {\"runs\":1036,\"mean\":1.7873440313440159,\"standard_error\":0.6442656590172311,\"retail\":0.7865928490944983,\"arb\":1.0007511822525095,\"failures\":0}. Unseen: {\"mean\":1.2749636378437785,\"standard_error\":0.22866124461633183,\"retail\":0.9547171308253937,\"arb\":0.3202465070183341,\"failures\":0} Final timing, 200 unseen spread-1 runs per strategy in one process, no competing batch jobs: {\"base\":97.14125820901245,\"yours\":95.32359191693831}. Frozen strategy is faster in this measurement."],"next":"Improve exhausted-quote classification using a posterior probability of arbitrage rather than a hard safety margin; estimate m using exact compound-lognormal sums or calibrate the three-term approximation. Early flow estimates remain near the prior, so test confidence-weighted activation. Use fresh unseen seeds after this result; do not tune on 60000..67999."}