# Merge 2: spread-4 queue priority Select **q4-ahead**, unchanged, as the best eligible spread-4 file on the evidence supplied. It reports a paired unseen gain of **0.17255959975495247 per spread-4 run**, SE **0.05609359681034755**, zero failures, identical results on 900 other-spread runs, and slightly faster paired timing. q4-bids is a smaller positive alternative. q4-demand has the largest measured gain but fails the explicit no-slower condition. q4-life returns the unchanged base after its experimental strategy lost. These are reported local measurements, not an independently reproduced simulation or a leaderboard result. [A, B, D, L] All four inputs concern **spread 4**, not four different spreads. Select one; their gains cannot be summed. No combined tranche/retention/demand strategy was evaluated. With the task's equal spread weights, the selected gain contributes about **0.04313989993873812** to an all-spread expectation (0.17255959975495247 / 4). That arithmetic is not a new score or evidence of first place. The requester supplies the 107.17 and 109.59 leaderboard figures; neither is verified here. ## Evidence and provenance Sources are the supplied JSON records. Trial indexes below are zero-based. All inputs matched the supplied SHA-256 hashes; all strategy code parsed and matched its reported code hash. These checks do not certify behavior. - [L] [item-q4-life](../../../../.imd/reads/artifacts/item-q4-life), original `artifacts/goal/items/q4-life/result.json`. - [A] [item-q4-ahead](../../../../.imd/reads/artifacts/item-q4-ahead), original `artifacts/goal/items/q4-ahead/result.json`. - [B] [item-q4-bids](../../../../.imd/reads/artifacts/item-q4-bids), original `artifacts/goal/items/q4-bids/result.json`. - [D] [item-q4-demand](../../../../.imd/reads/artifacts/item-q4-demand), original `artifacts/goal/items/q4-demand/result.json`. The task flags one source each behind L and B as unreadable, changed, or unsupported on recheck. Neither delivered JSON contains a source URL list, the disputed passage, or the identity of that source. Consequently those external citations cannot be repaired or confirmed from the supplied records. Treat L/B numerical measurements as worker reports, not independently corroborated findings; their simulator/mechanism claims retain that provenance limitation. No unsupported external quotation is repeated here. Their agreement with A is useful context, not a substitute for raw simulation records. A/D are also self-reported experiments; absence of a warning does not independently validate them. The requester names the [simulator](https://github.com/danrobinson/prediction-market-challenge) and [base](https://api.imd.fun/artifacts/41fa8829432f502a00c5302c0e2200b475c5c2e100a2a16b086aaab0ce62a395). These were not fetched here. A/L report simulator commit `b244530ee2a6247b5f930830eeca9dd950da0e7e`, 2000-step runs and no sandbox. ## Comparable results and eligibility All records report the same spread-4 unseen baseline: mean **163.47813945343543**, retail **191.20763318061364**, signed arbitrage **-27.729493727194825**. Unseen scoring covers all **2009 spread-4 seeds in 60000..67999**. Each reports zero candidate failures and 900 identical non-target results (300 per other spread). These finite checks do not establish identity on every possible seed. [A/B/L `approach`; D `approach`, `holdout`, `others_identical`; all `base_unseen`] | Item | Unseen mean | Paired gain | SE | Retail delta | Signed arb delta | Decision | |---|---:|---:|---:|---:|---:|---| | [L] q4-life | 163.47813945343543 | 0.0 | 0.0 | 0.0 | 0.0 | Unchanged fallback; no gain | | [A] q4-ahead | 163.6506990531904 | 0.17255959975495247 | 0.05609359681034755 | 0.2216695056799397 | -0.0491099059248383 | Select | | [B] q4-bids | 163.52993146776436 | 0.051792014328919854 | 0.012644173743880268 | 0.09115884220389603 | -0.0393668278740158 | Positive alternative | | [D] q4-demand | 164.06906427645012 | 0.5909248230146836 | 0.19743783993870737 | -1.2474939821301518 | 1.8384188051388293 | Exclude: slower | Table values come directly from each record's `holdout` and `diff`. Positive arb delta means reduced arbitrage loss. A and B earn additional retail edge while accepting some additional arbitrage loss; D moves in the opposite direction. Without seed-level paired differences between candidates, no significance claim about A outperforming B is justified. | Item | Paired base seconds | Candidate seconds | Timing interpretation | |---|---:|---:|---| | q4-life | 595.4729134468362 | 575.7384612760507 | Identical code; variation, not a speedup | | q4-ahead | 294.15425222413614 | 291.83430307451636 | 200 target runs; slightly faster | | q4-bids | 67.5692147470545 | 66.84266982902773 | Reported faster; timing sample details absent | | q4-demand | 144.19885997008532 | 145.2658611133229 | 200 target runs; 0.74% slower | Timing is comparable only within pairs. A reports alternating order, warmups and lower CPU time; L calls its identical-code difference variation. D used the unpatched engine for timing but did not time other spreads. B supplies no timing protocol. These samples do not guarantee universal speed. [A/L/D `approach`; A trial 87; B `seconds`] **Scorer discrepancy:** A, B and L report reproducing the required 4000-run, seeds 4000..7999, workers=4 result **98.4694596619638**. D's `base_mean_edge` **113.9414113871885** is only a 200-run CLI sample starting at 4000: the longer attempts hit its command limit. It explicitly disclaims reproducing the author figure. This is a different sample, not a conflicting estimate from the specified scorer check. D also used equivalent-loop patches for two engine scans during scoring, with exact equality checked on only eight seeds against the unpatched engine. This further limits its comparability. [A/L `approach`; B trial 0; D `approach`] ## What to retain, and what failed **A: preserve priority by splitting existing quantity.** At spread 4, split a new bid into two cent-quantized halves only when there is a real rival ask (`ca <= 99`), the bid is above the rival bid and exactly `ca - 4`, quantity is at least four shares, and total notional is at least `4 * P['m']` ($20). Keep aggregate quantity and the sizing rule unchanged. On later target shrinkage, the manager can cancel a tail tranche while retaining the earlier tranche ahead of replenishment. Reported discovery gain is 0.16017483584296874 on 128 runs; independent tuning validation is 0.16580731308913887 on 488 runs in 14000..15999. The file was frozen before unseen scoring. Its 64-run diagnostic raises front-bid step share from 0.166671875 to 0.174, while average reserved cash falls from 22.336927876562495 to 22.23691695. [A `approach`, code, trials 11, 74, 88] A rejects artificial tick-0/100 source lots, broad enlargement, and slower two-sided splitting. The ledger preserves all negative, noisy and invalid variants. [A `tried`] **B: guarded retention is a smaller alternative.** At an existing front bid at `cb`, with estimated probability at least two ticks higher, multiply the keep target by four, capped at 3000 shares; never add behind the rival. This remains a bounded keep rule. Unused tuning validation gains about 0.059, SE 0.021. Broad enlargement and weaker guards expose jump losses, including a reported 275 loss to arbitrage. [B `approach`, code, trials 2–9; source warning applies] **L: lifetime sizing did not validate.** Its frozen experimental candidate loses **3.3483234647361373**, SE **1.510332187739084**, on 2009 unseen runs: retail +2.2084078648600793, signed arb -5.55673132959786. Restoring arithmetic reproduces every result, implicating policy. The delivered code is unchanged base, hash `dcf68e0c9a7b06f90cf70a833357b60e2208b5b3e2971e7dddf02986d4747076`; its zero gain is separate from the failed experiment. Its 9000..10999 validation range overlaps 8000..15999 tuning. Longer seat lifetimes alone did not improve edge per position. All valuation, flow and tranche variants remain in the ledger. [L `approach`, trials 0–50; source warning applies] **D: thin-flow reduction is promising but too slow.** After >=64 observations and fitted BUY flow <0.45 dollars/step, cap ordinary sizes by fitted-demand versions of the base rule. Its discretized posterior and observation threshold are approximate heuristics. The two 300-run tuning halves gain 0.3923329087306663 and 0.31040315320933354; uncertainty exceeds each mean. Lowest-flow quartile gains about 1.91/1.60, others about zero to -0.22. Broad grafting, stock and ungated sizing did not validate. Speed repairs reduce overhead from 9.5% to 0.74%, still ineligible; optimizations touch other spreads. [D `approach`, code, trials 0–7] These findings agree on avoiding broad extra inventory exposed to jumps. They do not establish that every lifetime or stock-sizing approach fails: each negative conclusion is restricted to its tested variants. A/B preserve existing priority with restrained exposure; D reduces surplus exposure in thin markets. Their policies interact through the same spread-4 orders and cannot be stacked with assumed additive gains. L's fallback and D's scorer/runtime failures must remain visible in any later selection. ## Follow-up carried forward A proposes ask-side tranches only after eliminating their overhead, and avoiding splits on ammunition bids likely to be swept. B proposes inferring remaining rival ask notional to enlarge bids only shortly before replenishment, plus a jump-aware distance guard. L proposes a conservative mixture bound for jump-crossing loss while retaining the ordinary one-step core. D proposes a tighter low-flow cutoff or posterior probability gate, checking whether retail can be retained, and sharing posterior tables in any future stack. These are untested proposals, not selected changes. Fresh seeds outside the consumed tuning/unseen ranges are needed for a new combined policy. [A/B/L/D `next`] ## Selected strategy, preserved verbatim This block is A's complete `code`, SHA-256 `04ef81f760b2ae1c3802ba120998ae4621d8e9c8e04478395671ecbebd36ef3d`. It is included because source inputs are not delivered automatically. No hybrid or leaderboard submission was made. ```python """Crossing-cover strategy with large spread-four destination bid tranches.""" import math from orderbook_pm_challenge.strategy import BaseStrategy from orderbook_pm_challenge.types import CancelOrder, PlaceOrder, Side P = dict(lam_r=0.25, m=5.0, sig_n=1.2, lam_j=0.0019, sig_j=0.35, sig=0.02, qmax=3000.0, rmin=2, kA=0.7, kL=0.15, pL=0.05, ammo=1.0, ydem=0.4, W=200.0, fy=0.6, ammo_q=60.0, ammo_pmax=0.05, ammo_maxpay=0.02, 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, ydf=0.6, Wf=2000.0, g_hi=0.15, g_lo=0.15, qf=400.0, pmaxf=0.05, pre_gap=1.0, 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) SQ2 = math.sqrt(2.0) SQ2PI = math.sqrt(2.0 * math.pi) def cdf(x): return 0.5 * (1.0 + math.erf(x / SQ2)) def pdf(x): return math.exp(-0.5 * x * x) / SQ2PI def inv(p): p = min(max(p, 1e-9), 1 - 1e-9) t = math.sqrt(-2.0 * math.log(min(p, 1 - p))) x = t - (2.515517 + 0.802853 * t + 0.010328 * t * t) / (1 + 1.432788 * t + 0.189269 * t * t + 0.001308 * t ** 3) x = -x if p < 0.5 else x for _ in range(2): d = pdf(x) if d < 1e-12: break x -= (cdf(x) - p) / d return x def lpm(k): return pdf(k) + k * cdf(k) def fl(q): return math.floor(q * 100 + 1e-9) / 100 NODES = [(-2.2, .06), (-1.3, .17), (-0.6, .27), (0.6, .27), (1.3, .17), (2.2, .06)] PROBE = 0.01 class Strategy(BaseStrategy): def __init__(self): self.n = 0 self.ahead = set() # main orders placed strictly ahead of any competitor order at their tick self.res = {} # order id -> uncovered quantity at placement self.bc = None # belief: sub-tick grid centres (ticks) self.bw = None # belief: weights self.st = 0.5 # last one-step sd in ticks self.pcb = self.pca = None self.pb = set() self.pa = set() self.tb = 0 self.s = None # competitor spread parameter self.flow_notional = 0.0 self.flow_exposure = 0 self.last_ask_tick = None self.last_quote_exposed = False self.last_flow_ca = None self.last_flow_cap = 0.0 self.last_flow_correction = 1.0 self.params = P.copy() def _oid(self, tag): self.n += 1 return tag + str(self.n) def on_step(self, state): BUY, SELL = Side.BUY, Side.SELL probe_limit = PROBE + 1e-9 H = max(1, state.steps_remaining) cb = state.competitor_best_bid_ticks or 0 ca = state.competitor_best_ask_ticks or 100 if self.s is None: self.s = max(1, (ca - cb + 1) // 2) if self.s == 1: self.params.update({'dmin': 0.3, 'pfl': 1e-06}) if self.s == 3: self.params.update({'flow_prior': 200, 'flow_level': 0.6, 'flow_strength': 1.0, 'flow_safety': 2.0, 'flow_exposure_min': 5.0}) P = self.params if self.s == 3 and self.last_quote_exposed and ca <= self.last_flow_ca + 1: self.flow_exposure += 1 self.flow_notional += min(self.last_flow_cap, state.sell_filled_quantity * self.last_ask_tick / 100.0) * self.last_flow_correction lo, hi = cb, ca if self.s == 4: bids, asks, sb, sa = [], [], set(), set() for o in state.own_orders: if o.side is BUY: if o.price_ticks > lo: lo = o.price_ticks if o.remaining_quantity <= probe_limit: sb.add(o.price_ticks) else: bids.append(o) else: if o.price_ticks < hi: hi = o.price_ticks if o.remaining_quantity <= probe_limit: sa.add(o.price_ticks) else: asks.append(o) else: for o in state.own_orders: if o.side is BUY: lo = max(lo, o.price_ticks) else: hi = min(hi, o.price_ticks) if P['pinf'] > 0: if self.s != 4: sb = {o.price_ticks for o in state.own_orders if o.side is BUY and o.remaining_quantity <= probe_limit} sa = {o.price_ticks for o in state.own_orders if o.side is SELL and o.remaining_quantity <= probe_limit} ea = self.pa - sa eb = self.pb - sb if sa and ea: lo = max(lo, min(max(ea), hi)) if eb and (sb or min(eb) <= P['p1t']): hi = min(hi, max(min(eb), lo)) if P['jumpinfo'] > 0 and self.pcb is not None: if ca > self.pca + 1: lo = max(lo, ca - 1) if cb < self.pcb - 1: hi = min(hi, cb + 1) self.pcb, self.pca = cb, ca if lo > hi: lo, hi = hi, lo # sub-tick belief over p_(t-1): predict with one-step noise, truncate to [lo, hi] wid = max(hi - lo, 1e-6) nb = max(2, min(48, int(round(wid * P['bins'])))) cs = [lo + (i + 0.5) * wid / nb for i in range(nb)] if self.bc is None or P['filt'] <= 0: ws = [1.0 / nb] * nb else: sg = max(self.st, 0.6 * wid / nb) k = -0.5 / (sg * sg) ws = [] uni = P['uni'] * sg previous = tuple(zip(self.bc, self.bw)) if self.s == 4 else None exp = math.exp for c in cs: t = uni for ci, wi in (previous if previous is not None else zip(self.bc, self.bw)): d = c - ci d2 = d * d * k if d2 > -12.5: t += wi * exp(d2) ws.append(t) tot = sum(ws) ws = [w / tot for w in ws] self.bc, self.bw = cs, ws mean_t = sum(c * w for c, w in zip(cs, ws)) var_t = max(sum(c * c * w for c, w in zip(cs, ws)) - mean_t * mean_t, 0.0) phat = min(max(mean_t / 100.0, 0.002), 0.998) var = P['sig'] ** 2 + P['lam_j'] * P['sig_j'] ** 2 sd = math.sqrt(H * var) self.tb = self.tb + 1 if hi <= 1 else 0 if self.tb > 0 and P['zd'] > 0: # below the last tick there is no probe: the score keeps walking away from it phat = min(phat, max(P['pfl'], cdf(inv(0.01) - P['zd'] * 0.02 * math.sqrt(self.tb) / sd))) z = inv(phat) Z = z * sd sp = pdf(z) / sd * P['sig'] self.st = sp * 100.0 s = math.sqrt(sp * sp + var_t / 1e4 + 1e-8) sd1 = math.sqrt(max(1.0, H - 1.0) * var) jp = [(cdf((Z + n * P['sig_j']) / sd1), w) for n, w in NODES] lj = P['lam_j'] def AB(x): k = (x - phat) / s a = s * lpm(k) b = a - (x - phat) ja = sum(w * max(0.0, x - p) for p, w in jp) jb = sum(w * max(0.0, p - x) for p, w in jp) return (1 - lj) * a + lj * ja, (1 - lj) * b + lj * jb if H == 1: def AB(x): return (1 - phat) * x, phat * (1 - x) rho = P['lam_r'] * 0.5 mu = math.log(P['m']) - 0.5 * P['sig_n'] ** 2 kA = P['kL'] if phat < P['pL'] else P['kA'] def qsize(loss, gain, px): loss *= kA if gain <= 0: return 0.0 tail = loss / (rho * gain) if tail >= 1.0: return 0.0 return min(P['qmax'], math.exp(mu + P['sig_n'] * inv(1 - max(tail, 1e-6))) / px) ptk = phat * 100 def qbid(t): if not 1 <= t <= 99: return 0.0 a, b = AB(t / 100.0) if phat * 100 - t < P['dmin']: return 0.0 if P['nb1'] > 0 and self.s == 1 and t == 1 and ptk < 1.0: return 0.0 if phat < P['pL']: ytg = P['ydem'] * min(H, P['W']) / max(ca - 1, ptk + 1) * 100.0 a *= (P['kLb'] if state.yes_inventory < ytg else P['kLf']) / P['kL'] return qsize(a, b, max(phat, 0.05)) def qask(t): if not 1 <= t <= 99: return 0.0 a, b = AB(t / 100.0) if t - phat * 100 < P['dmin']: return 0.0 return qsize(b, a, t / 100.0) if self.s != 4: bids = [o for o in state.own_orders if o.side is BUY and o.remaining_quantity > probe_limit] asks = [o for o in state.own_orders if o.side is SELL and o.remaining_quantity > probe_limit] sticky = P['sticky'] > 0 def top(orders, comp, step): 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']: return comp return comp + step bid_t = top(bids, cb, 1) ask_t = top(asks, ca, -1) qb = qbid(bid_t) qa = qask(ask_t) Y = state.yes_inventory if ask_t == 1 and H > P['H1'] and P['pre'] > 0: qa = qa if Y >= P['a1'] > 0 else 0.0 # let the competitor's 2-tick ask erode instead of fronting it for nothing # ammunition: hold YES so that low asks are covered ptick = phat * 100 amt = 0 qam = 0.0 if P['ammo'] > 0 and ask_t >= 2 and phat < max(P['ammo_pmax'], P['pmaxf']): wealth = state.cash + Y * phat x = max(ask_t, ptick + 1) / 100.0 capw = P['fy'] * wealth / max(phat, 0.005) target = min(P['ydem'] * min(H, P['W']) / x, capw) full = min(P['ydf'] * min(H, P['Wf']) / x, capw) if phat < P['pmaxf'] else 0.0 t = max(1, min(99, int(math.ceil(ptick + 1e-9)))) g = t - ptick if Y < full and g <= P['g_hi'] and bid_t <= t < ask_t: amt, qam = t, min(P['qf'], full - Y) # a tick p has just crossed: nearly free elif Y < target and phat < P['ammo_pmax'] and bid_t <= t < ask_t and t / 100.0 - phat < P['ammo_maxpay']: amt, qam = t, min(P['ammo_q'], target - Y) elif Y < full and t >= 2 and 1.0 - g <= P['g_lo']: amt, qam = t - 1, min(P['qf'], full - Y) # rest just under p: filled only on the crossing, or by retail 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']: amt, qam = 1, min(P['ammo_q'], P['pre'] - Y) q1 = 0.0 if P['ydf1'] > 0 and P['m1'] < ptick < P['g1'] + 1.0 and amt != 1: stock_rate = P['ydf1'] if self.s == 3: flow = (self.flow_notional + P['flow_prior'] * P['flow_level']) / (P['flow_prior'] + self.flow_exposure) scale = max(0.5, min(2.0, flow / P['flow_level'])) stock_rate *= 1.0 + P['flow_strength'] * (scale - 1.0) q1 = max(0.0, stock_rate * min(H, P['Wf']) / (self.s / 100.0) - Y) # Bridge expected retail demand until another tick crossing is available. if 0.02 < phat < 0.1: ct = max(2, min(99, int(math.floor(ptick)))) wealth = state.cash + Y * phat goal = min(1 * qa, 0.3 * max(wealth, 0.0) / phat) if Y < goal and ct < ask_t: amt, qam = ct, min(3000.0, goal - Y) # order management actions = [] free = state.free_cash - 2.0 keep_ask = 0.0 new_b = [] new_a = [] def cancel(o): nonlocal free actions.append(CancelOrder(o.order_id)) x = o.price_ticks / 100.0 if o.side is BUY: free += x * o.remaining_quantity else: free += (1 - x) * min(self.res.get(o.order_id, 0.0), o.remaining_quantity) self.ahead.discard(o.order_id) self.res.pop(o.order_id, None) for o in state.own_orders: if o.remaining_quantity <= probe_limit: cancel(o) kept_ids = set() def manage(orders, t, q, comp): kept = 0.0 for o in orders: if o.price_ticks == t and q > 0 and kept + o.remaining_quantity <= max(q * P['keep_hi'], 1.0): kept += o.remaining_quantity kept_ids.add(o.order_id) else: cancel(o) return kept kb = manage(bids, bid_t, qb, cb) ka = manage(asks, ask_t, qa, ca) add_b = (qb - kb) if (kb < qb * P['keep_lo'] and bid_t != cb) else 0.0 add_a = (qa - ka) if (ka < qa * P['keep_lo'] and ask_t != ca) else 0.0 budget = P['fb'] * max(free, 0.0) cost = add_b * bid_t / 100.0 + qam * amt / 100.0 if cost > budget: f = budget / cost add_b *= f qam *= f cost = budget out = [] q1 = min(q1, P['f1'] * max(budget - cost, 0.0) * 100.0) if q1 >= 0.01: out.append(PlaceOrder(side=BUY, price_ticks=1, quantity=fl(q1))) free -= fl(q1) / 100.0 + 1e-6 if amt and qam >= 0.01: q = fl(qam) out.append(PlaceOrder(side=BUY, price_ticks=amt, quantity=q)) free -= q * amt / 100.0 + 1e-6 if bid_t >= 1 and add_b >= 0.01: q = fl(add_b) total_q = q if self.s == 4 and ca <= 99 and bid_t > cb and bid_t == ca - 4 and q >= 4.0 and q * bid_t / 100 >= 4 * P['m']: head = fl(q / 2) oid = self._oid('b') out.append(PlaceOrder(side=BUY, price_ticks=bid_t, quantity=head, client_order_id=oid)) self.ahead.add(oid) q = fl(q - head) oid = self._oid('b') out.append(PlaceOrder(side=BUY, price_ticks=bid_t, quantity=q, client_order_id=oid)) free -= total_q * bid_t / 100.0 + 1e-6 if bid_t > cb: self.ahead.add(oid) if ask_t <= 99 and add_a >= 0.01: x = ask_t / 100.0 covk = sum(o.remaining_quantity - min(self.res.get(o.order_id, 0.0), o.remaining_quantity) for o in asks if o.order_id in kept_ids) cov = max(0.0, Y - covk - 0.1) unc = max(0.0, add_a - cov) if unc > 0: ub = max(0.0, free - (1 - P['fu']) * max(state.cash, 0.0)) if x >= P['xu'] else 0.0 if H < P['Hu'] and phat < 0.05: ub = max(0.0, free * (1 - H / P['Hu'])) unc = min(unc, ub / (1 - x)) q = fl(min(add_a, cov + unc)) if q >= 0.01: oid = self._oid('a') out.append(PlaceOrder(side=SELL, price_ticks=ask_t, quantity=q, client_order_id=oid)) r = max(0.0, q - cov) self.res[oid] = r free -= r * (1 - x) + 1e-6 if ask_t < ca: self.ahead.add(oid) # probes: tiny orders that the arbitrageur removes when p crosses them f = int(math.floor(ptick + 1e-9)) r = max(int(P['rmin']), int(math.ceil(2.0 * s * 100))) self.pb = set() self.pa = set() if free > 1.0: for t in range(f, f + r + 1): if cb < t < ca and 1 <= t <= 99: out.append(PlaceOrder(side=BUY, price_ticks=t, quantity=PROBE)) self.pb.add(t) for t in range(f + 1 - r, f + 2): if cb < t < ca and 1 <= t <= 99: out.append(PlaceOrder(side=SELL, price_ticks=t, quantity=PROBE)) self.pa.add(t) if self.s == 3: self.last_ask_tick = ask_t self.last_flow_ca = ca exposed_qty = ka + sum(o.quantity for o in out if o.side is SELL and o.price_ticks == ask_t and o.quantity > PROBE) self.last_flow_cap = exposed_qty * ask_t / 100.0 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'] if self.last_quote_exposed: logcap = math.log(self.last_flow_cap) mu_flow = math.log(P['m']) - 0.5 * P['sig_n'] ** 2 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'])) self.last_flow_correction = min(3.0, P['m'] / max(clipped, 0.01)) return actions + out ``` ## Complete experiment ledger All `tried` entries follow verbatim, in order. They remain worker reports subject to the source limitations above. Worker cache files are not delivered. Only A’s strategy code is embedded. ### q4-life **0.** eligiblefast1 (same replenishable-tick rule at scale 1): tuning seeds 8000_16000, spread 4, n=200, paired mean=-8.970933453224502, SE=5.237620658204073, retail=4.154451558718999, arb=-13.125385011932499, failures=0. **1.** eligiblefast (scale-0.25 reserve only for replenishable asks>=5 and bids<=95): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.11583157877350146, SE=1.4613911573831713, retail=2.144321010148999, arb=-2.260152588923, failures=0. **2.** eligibleflow (replenishable-tick scale-0.25 reserve with guarded clipped-fill-corrected per-run flow learning): tuning seeds 8000_16000, spread 4, n=200, paired mean=0.11985205611449955, SE=1.5718811016965868, retail=2.375070419571999, arb=-2.2552183634635, failures=0. **3.** eligibleflowopt (replenishable-tick scale-0.25 reserve with guarded clipped-fill-corrected per-run flow learning; exact arithmetic optimization): tuning seeds 8000_16000, spread 4, n=40, paired mean=2.583890574892502, SE=2.016262056502265, retail=2.3474434647024984, arb=0.23644711017749948, failures=0. **4.** eligiblevalue (overshoot valuation only at replenishable ticks): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.5420966563009995, SE=1.2915790693756368, retail=1.4414147464869966, arb=-1.9835114027925003, failures=0. **5.** fast01 (same reserve, scale 0.05): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.07116983341350096, SE=0.21961213169104635, retail=0.056685712672500055, arb=-0.12785554609000002, failures=0. **6.** fast1 (loss/gap hazard lifetime reserve, scale 1): tuning seeds 8000_16000, spread 4, n=200, paired mean=-29.276638738018995, SE=14.308181775272741, retail=4.344381919947998, arb=-33.6210206579655, failures=0. **7.** fast2 (same reserve, scale 0.25): tuning seeds 8000_16000, spread 4, n=200, paired mean=-9.354589902099502, SE=6.353506408554484, retail=2.2301189416894998, arb=-11.584708843793, failures=0. **8.** front1 (scale-1 reserve only at existing rival front): tuning seeds 8000_16000, spread 4, n=200, paired mean=-2.7152403590065006, SE=0.6784767715843286, retail=0.46809546366049903, arb=-3.1833358226654997, failures=0. **9.** highfast (scale-0.25 reserve above probability 0.05): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.057249068750501404, SE=0.5845944624728496, retail=0.967554871552498, arb=-1.0248039403044995, failures=0. **10.** hightail (continuous-tail reserve above probability 0.05): tuning seeds 8000_16000, spread 4, n=200, paired mean=-1.1563537056610003, SE=1.385666000483477, retail=0.5874459415574997, arb=-1.7437996472234998, failures=0. **11.** highvalue (overshoot reserve above probability 0.05): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.0020644010304990256, SE=0.6159787702255597, retail=1.1332292157614985, arb=-1.1352936167994998, failures=0. **12.** life1 (discrete-jump first-passage lifetime target, scale 1, 20000-share cap): tuning seeds 8000_16000, spread 4, n=200, paired mean=-27.0739053079435, SE=12.670420978078699, retail=3.579839889386499, arb=-30.653745197321, failures=0. **13.** low1 (scale-1 reserve only below probability 0.1): tuning seeds 8000_16000, spread 4, n=200, paired mean=-27.084389458997997, SE=14.26396126451206, retail=3.4568129883134997, arb=-30.541202447322497, failures=0. **14.** lowfront1 (same front-only reserve below probability 0.1): tuning seeds 8000_16000, spread 4, n=200, paired mean=-2.7185530927685, SE=0.6780659058839181, retail=0.4646161126984984, arb=-3.1831692054649996, failures=0. **15.** narrowfast (scale-0.25 reserve only at competitor quote gap<=5 ticks): tuning seeds 8000_16000, spread 4, n=200, paired mean=-9.354452006123001, SE=6.3535074302167756, retail=2.2301189416894998, arb=-11.5845709478165, failures=0. **16.** narrowtail (continuous-tail reserve at quote gap<=5): tuning seeds 8000_16000, spread 4, n=200, paired mean=-1.2387974192825013, SE=1.4482255219876954, retail=0.620390320219999, arb=-1.8591877395114997, failures=0. **17.** narrowvalue (overshoot reserve at quote gap<=5): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.9900782346484996, SE=1.3164230267186905, retail=1.4730667604014966, arb=-2.4631449950519997, failures=0. **18.** premium (continuous-tail target values only the one-tick queue-priority premium): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.20823797197199873, SE=0.32286240151987783, retail=0.04900686425400007, arb=-0.2572448362229994, failures=0. **19.** premiumflow (one-tick premium with per-run flow learning): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.24495053087700078, SE=0.31692930653451995, retail=0.02013618830449955, arb=-0.2650867191849997, failures=0. **20.** premiumnarrow (one-tick premium restricted to quote gap<=5): tuning seeds 8000_16000, spread 4, n=200, paired mean=-1.2363632234904989, SE=1.341291601794871, retail=0.044870679122000184, arb=-1.2812339026079993, failures=0. **21.** premiumsplit (one-tick premium with core/reserve tranches): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.20838289980899968, SE=0.32286367963495266, retail=0.04922753954399996, arb=-0.2576104393474994, failures=0. **22.** safefast (scale-0.25 reserve, gap>3 posterior SD and uncertainty-adjusted diffusion): tuning seeds 8000_16000, spread 4, n=200, paired mean=-4.209326263939501, SE=3.3384283155978416, retail=0.741097000405, arb=-4.9504232643465, failures=0. **23.** safetail (same safety gate with continuous-tail valuation): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.05579673362999994, SE=0.6905613457503084, retail=0.6058516982104989, arb=-0.6616484318340001, failures=0. **24.** safevalue (same safety gate with overshoot valuation): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.7901920886509994, SE=0.8692409767961822, retail=0.5480573068915008, arb=-1.3382493955544998, failures=0. **25.** tail025 (same continuous tail, scale 0.25): tuning seeds 8000_16000, spread 4, n=200, paired mean=0.033051733992000024, SE=0.032590446400003775, retail=0.03229142192299992, arb=0.0007603120680000974, failures=0. **26.** tail025opt (same continuous tail, scale 0.25; exact arithmetic optimization): tuning seeds 8000_16000, spread 4, n=40, paired mean=0.0024205577850009872, SE=0.002584280649933144, retail=-0.0016266660350002127, arb=0.0040472238150002175, failures=0. **27.** tail1 (continuous Gaussian latent jump tail, sigma 0.6, scale 1): tuning seeds 8000_16000, spread 4, n=200, paired mean=-1.2387577962230012, SE=1.448177257599763, retail=0.6261834855669989, arb=-1.8649412817999995, failures=0. **28.** tail_at (replace ordinary target only at existing rival front): tuning seeds 8000_16000, spread 4, n=200, paired mean=-6.358922670304001, SE=1.4657671621407, retail=-4.861645861560001, arb=-1.4972768087489998, failures=0. **29.** tail_exact (replace ordinary target with continuous-tail target everywhere): tuning seeds 8000_16000, spread 4, n=200, paired mean=-12.739364325515501, SE=2.630472291779543, retail=-22.338972604855, arb=9.5996082793735, failures=0. **30.** tail_low (replace ordinary target with continuous-tail target only for asks below probability 0.05): tuning seeds 8000_16000, spread 4, n=200, paired mean=-4.502212694104002, SE=2.075634915156972, retail=-7.054504512454, arb=2.5522918183645, failures=0. **31.** tail_lowhalf (low-ask replacement target at scale 0.25): tuning seeds 8000_16000, spread 4, n=200, paired mean=-19.887314247182502, SE=4.734307277376333, retail=-25.153799456040502, arb=5.266485208881001, failures=0. **32.** tailflow (low-ask replacement target with guarded clipped-fill-corrected per-run flow learning): tuning seeds 8000_16000, spread 4, n=200, paired mean=-2.093654807035, SE=4.0063408331931525, retail=-7.173253862113, arb=5.079599055088, failures=0. **33.** tailfront (continuous tail only at existing front): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.40422047723550136, SE=0.5555259255228817, retail=0.31377445226149847, arb=-0.7179949295014998, failures=0. **34.** tailsplit (continuous-tail reserve split into original one-step core plus lifetime tranche): tuning seeds 8000_16000, spread 4, n=200, paired mean=-1.2553697913240012, SE=1.445759682504231, retail=0.6300845403674983, arb=-1.8854543316979997, failures=0. **35.** value1 (conditional-overshoot marginal survival valuation, scale 1): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.9943835214564999, SE=1.3162823142482227, retail=1.4775375299444968, arb=-2.4719210514045, failures=0. **36.** value3 (same valuation, scale 3): tuning seeds 8000_16000, spread 4, n=200, paired mean=-12.931868635470003, SE=5.27053982690322, retail=3.930716028308498, arb=-16.862584663768, failures=0. **37.** valueflow (overshoot reserve with per-run flow learning): tuning seeds 8000_16000, spread 4, n=200, paired mean=-1.3543223816400003, SE=1.4932328569855189, retail=1.3727183941629995, arb=-2.7270407758139994, failures=0. **38.** valuefront (same valuation only at existing front): tuning seeds 8000_16000, spread 4, n=200, paired mean=-0.6397946642645005, SE=0.5942964334322326, retail=0.45920896089899815, arb=-1.0990036251654995, failures=0. **39.** eligiblefast (scale-0.25 reserve only for replenishable asks>=5 and bids<=95): tuning seeds 9000_11000, spread 4, n=400, paired mean=-0.09860881649424934, SE=0.9157563985723558, retail=1.320344283336501, arb=-1.41895309982625, failures=0. **40.** eligibleflow (replenishable-tick scale-0.25 reserve with guarded clipped-fill-corrected per-run flow learning): tuning seeds 9000_11000, spread 4, n=400, paired mean=0.18083224406125012, SE=0.711523593701385, retail=1.382130489404502, arb=-1.2012982453395, failures=0. **41.** fast01 (same reserve, scale 0.05): tuning seeds 9000_11000, spread 4, n=400, paired mean=-0.03880957884850028, SE=0.1627616043654035, retail=0.053320104136500325, arb=-0.09212968298424996, failures=0. **42.** tail025 (same continuous tail, scale 0.25): tuning seeds 9000_11000, spread 4, n=400, paired mean=-0.0006186158359996341, SE=0.0006640697093860962, retail=0.010793454246749743, arb=-0.011412070081499978, failures=0. **43.** Front-position diagnostic, first 30 spread-four tuning seeds: positions are main orders placed without a rival ahead and later observed at the rival best tick; edge sums own fills q*(p-price) for buys and q*(price-p) for sells. Base {"positions": 4222, "initial": 51.11413074372335, "filled": 14.96053292278541, "edge": 0.4965475692183387, "retail": 0.5149687657556327, "arb": -0.018421196537293953, "lifetime_steps": 14.670298436759829}; aggressive life1 {"positions": 5217, "initial": 92.7079125934445, "filled": 13.408198198198198, "edge": 0.4719411342764013, "retail": 0.485755823692097, "arb": -0.01381468941569575, "lifetime_steps": 21.873107149702893}. **44.** Flow-aware front-position diagnostic, first 30 tuning runs, same definition as above: {"positions": 4236, "initial": 61.66730642115203, "filled": 15.564386213408877, "edge": 0.5392405590990845, "retail": 0.5565761015803286, "arb": -0.01733554248124408, "lifetime_steps": 17.349386213408877}. **45.** Single frozen experimental candidate, SHA256 446e44d9cda52b4bed53dfee2fc05cd2d689b4bb6fd766fc49ccbe7b6e5ddaab, unseen spread-four n=2009, paired mean=-3.3483234647361373, SE=1.510332187739084, retail=2.2084078648600793, arb=-5.55673132959786, failures=0. **46.** Same frozen quoting policy with original arithmetic restored, independently rescored, SHA256 2f152a8f0e5d4bfb036618f3df83cd254c4fc44e3b7716c7a03481afdd319bbc, unseen spread-four n=2009, paired mean=-3.3483234647361373, SE=1.510332187739084, failures=0. **47.** Arithmetic-only repair: all 2009 unseen SimulationResult objects matched exactly between cached/inlined and original-arithmetic implementations; both independently replayed all seeds, with no quote-policy change. **48.** Final one-process timing record for fallback: {"runs_each": 200, "seeds": [60000, 60199], "seconds": {"base": 595.4729134468362, "yours": 575.7384612760507}, "cpu_seconds": {"base": 280.4675322390008, "yours": 266.26393209200023}, "identical": 200, "failures": 0, "base_failures": 0, "method": "elapsed engine construction+run, one process, balanced permutations of three strategies, one warmup each"}. **49.** Experimental implementation timing frozen: {"runs_each": 200, "seeds": [60000, 60199], "seconds": {"base": 595.4729134468362, "yours": 600.821925265016}, "cpu_seconds": {"base": 280.4675322390008, "yours": 281.6125549239998}, "identical": 169, "failures": 0, "base_failures": 0, "method": "elapsed engine construction+run, one process, balanced permutations of three strategies, one warmup each"}. **50.** Experimental implementation timing rawfrozen: {"runs_each": 200, "seeds": [60000, 60199], "seconds": {"base": 457.53154194378294, "yours": 463.15241725579835}, "cpu_seconds": {"base": 268.7882964329997, "yours": 272.7643407379997}, "identical": 169, "method": "elapsed engine construction+run, one process, alternating two strategies, one warmup each"}. ### q4-ahead **0.** Additional real-source destination orders, distance >=3.5 [pilot]: {"n":128,"failures":0,"mean":-0.0330306949632814,"standard_error":0.02296946485447079,"retail":-6.562500000018012e-05,"arb":-0.03296506996328131} **1.** Additional real-source destination orders, distance >=3.9 [pilot]: {"n":128,"failures":0,"mean":0.0,"standard_error":0.0,"retail":0.0,"arb":0.0} **2.** Additional real-source destination orders when inferred interval is within one tick of source lot [pilot]: {"n":128,"failures":0,"mean":-0.011223863545310936,"standard_error":0.8134644452684049,"retail":0.43623232192031014,"arb":-0.4474561854914063} **3.** Ask-only additional destination orders, >=3 ticks, real source lots [pilot]: {"n":128,"failures":0,"mean":0.11545249566875224,"standard_error":0.7905826651110023,"retail":0.2180838593562475,"arb":-0.10263136369453126} **4.** Two equal destination tranches on bids only, total notional >=$20 [pilot]: {"n":128,"failures":0,"mean":0.15971233629687498,"standard_error":0.05659787371084956,"retail":0.1571710546421853,"arb":0.002541281643749873} **5.** Same bid-only $5 rule with lookup caching; same pilot results [pilot]: {"n":128,"failures":0,"mean":0.3036144196914076,"standard_error":0.0935671836766393,"retail":0.2660576336710936,"arb":0.03755678600703097} **6.** Bid-only additional destination orders, >=3 ticks, real source lots [pilot]: {"n":128,"failures":0,"mean":-0.020593121137498317,"standard_error":0.299830791736327,"retail":0.47222129437890403,"arb":-0.49281441552968747} **7.** Raise cap to 12000 only for real lowest-ask future/front seat; no pilot changes [pilot]: {"n":128,"failures":0,"mean":0.0,"standard_error":0.0,"retail":0.0,"arb":0.0} **8.** Double real tick-5 pre/front asks when estimated p<0.02 [pilot]: {"n":128,"failures":0,"mean":0.3710243109460941,"standard_error":0.49736763516727733,"retail":0.41878669501796884,"arb":-0.04776238405546873} **9.** Quadruple real tick-5 pre/front asks when estimated p<0.02 [pilot]: {"n":128,"failures":0,"mean":0.15212853467031318,"standard_error":0.48943058079641216,"retail":0.333903498196093,"arb":-0.18177496350703126} **10.** Boundary cap plus stand aside at p<0.002 and H>600; no pilot changes [pilot]: {"n":128,"failures":0,"mean":0.0,"standard_error":0.0,"retail":0.0,"arb":0.0} **11.** Bid-only equal tranches at real future destination ca-4, source ask <=99, total notional >=$20; fixed before unseen [pilot]: {"n":128,"failures":0,"mean":0.16017483584296874,"standard_error":0.05659637196501902,"retail":0.15763355418827904,"arb":0.002541281643749873} **12.** Same two-sided $5 rule with lookup caching; same pilot results [pilot]: {"n":128,"failures":0,"mean":0.5340464372085949,"standard_error":0.1510781193665596,"retail":0.5750142540648416,"arb":-0.040967816866406145} **13.** Allow front orders to remain up to 3x current target [pilot]: {"n":128,"failures":0,"mean":-0.10079300043984227,"standard_error":0.42932088106429106,"retail":1.5258221829828116,"arb":-1.626615183440625} **14.** Same two-tranche rule, exact aligned-grid convolution reuse; REJECT: slower timing [pilot]: {"n":128,"failures":0,"mean":0.5340464372085949,"standard_error":0.1510781193665596,"retail":0.5750142540648416,"arb":-0.040967816866406145} **15.** Two equal destination tranches on both sides, total notional >=$10 [pilot]: {"n":128,"failures":0,"mean":0.501892280925001,"standard_error":0.14229579540226592,"retail":0.5449339230078096,"arb":-0.043041642090624915} **16.** Two equal destination tranches on both sides, total notional >=$20 [pilot]: {"n":128,"failures":0,"mean":0.3548215345875008,"standard_error":0.10600699944482604,"retail":0.2951506830390591,"arb":0.059670851530468756} **17.** Same two-tranche $5 rule with direct order placement [pilot]: {"n":128,"failures":0,"mean":0.5340464372085949,"standard_error":0.1510781193665596,"retail":0.5750142540648416,"arb":-0.040967816866406145} **18.** Halve pre/front capacity [pilot]: {"n":128,"failures":0,"mean":-7.773222135541406,"standard_error":1.7667134781383762,"retail":-16.158512831150784,"arb":8.385290695670312} **19.** Double pre/front capacity at distance >=1 [pilot]: {"n":128,"failures":0,"mean":-7.934378824296093,"standard_error":2.3848160945741705,"retail":5.788141156810935,"arb":-13.722519981144531} **20.** Double ask-only pre/front capacity at distance >=1 [pilot]: {"n":128,"failures":0,"mean":-7.027693290800779,"standard_error":2.36222754621284,"retail":1.42362873103125,"arb":-8.451322021846876} **21.** Double bid-only pre/front capacity at distance >=1 [pilot]: {"n":128,"failures":0,"mean":-1.8717391264890626,"standard_error":0.6543995813728642,"retail":2.946631503138279,"arb":-4.818370629649219} **22.** Double pre/front capacity at distance >=3 [pilot]: {"n":128,"failures":0,"mean":-1.9722002287328113,"standard_error":1.2402887088688188,"retail":1.922290845391407,"arb":-3.8944910741296876} **23.** Quadruple pre/front capacity at distance >=2 [pilot]: {"n":128,"failures":0,"mean":-18.426707080616406,"standard_error":3.004944646720914,"retail":5.037651630912498,"arb":-23.464358711571094} **24.** Eightfold pre/front capacity at distance >=3 [pilot]: {"n":128,"failures":0,"mean":-17.957834721142188,"standard_error":3.442994887414335,"retail":2.6950135661281243,"arb":-20.65284828728047} **25.** Two equal destination tranches on both sides, total notional >=$48 [pilot]: {"n":128,"failures":0,"mean":-0.01147038707421888,"standard_error":0.02859735403358513,"retail":-0.016915530461718564,"arb":0.0054451433843749715} **26.** Move main quote to real future tick instead of adding second order; distance 2 [pilot]: {"n":128,"failures":0,"mean":-9.333516566192186,"standard_error":0.8726971140155804,"retail":-8.228425249265628,"arb":-1.1050913169421874} **27.** Move main quote to real future tick instead of adding second order; distance 3 [pilot]: {"n":128,"failures":0,"mean":-4.6010454326499985,"standard_error":0.7789772539897948,"retail":-3.9426101409109395,"arb":-0.6584352917609374} **28.** Move main quote to real future tick instead of adding second order; distance 3; existing front seats only [pilot]: {"n":128,"failures":0,"mean":-4.413243646893748,"standard_error":0.7809703188394016,"retail":-3.7263693677484384,"arb":-0.6868742791625} **29.** Same two-tranche $5 rule plus merged order scans and cached prior-grid tuples [pilot]: {"n":128,"failures":0,"mean":0.5340464372085949,"standard_error":0.1510781193665596,"retail":0.5750142540648416,"arb":-0.040967816866406145} **30.** Additional future-tick orders, distance >=1 tick, full base size [pilot]: {"n":128,"failures":0,"mean":-8.270175120897655,"standard_error":0.9483092246364468,"retail":-2.959729202769533,"arb":-5.310445918115625} **31.** Additional future-tick orders, distance >=2, quarter size [pilot]: {"n":128,"failures":0,"mean":-4.2062608809828115,"standard_error":0.8803526183285102,"retail":-5.923903241744534,"arb":1.7176423608101563} **32.** Additional future-tick orders, distance >=3; REJECT: missing source lots treated as ticks 0/100 [pilot]: {"n":128,"failures":0,"mean":1.779811214136722,"standard_error":0.7654038911644607,"retail":2.3074818551710914,"arb":-0.5276706410390626} **33.** Ask-only >=3 additional-order rule; REJECT: missing source lots [pilot]: {"n":128,"failures":0,"mean":1.7814950714171884,"standard_error":0.7296946416082744,"retail":1.7736648036499978,"arb":0.007830267780468775} **34.** Bid-only >=3 additional-order rule; REJECT: missing source lots [pilot]: {"n":128,"failures":0,"mean":-0.07997334369687362,"standard_error":0.2970427026880433,"retail":0.44546234923984157,"arb":-0.5254356929507813} **35.** Same >=3 additional-order rule with idle-loop optimization; REJECT: missing source lots [pilot]: {"n":128,"failures":0,"mean":1.779811214136722,"standard_error":0.7654038911644607,"retail":2.3074818551710914,"arb":-0.5276706410390626} **36.** Additional destination orders >=3 ticks away, actual rival source lots only [pilot]: {"n":128,"failures":0,"mean":0.18846389627265842,"standard_error":0.8046008517869557,"retail":0.8041231572859354,"arb":-0.6156592610328127} **37.** Additional future-tick orders, distance >=1, one-tenth size [pilot]: {"n":128,"failures":0,"mean":-8.326102203445313,"standard_error":1.0597588359890027,"retail":-10.403997086899219,"arb":2.077894883482031} **38.** Enlarge only before rival arrival (size reverts on arrival): seat05 [pilot]: {"n":128,"failures":0,"mean":-6.310214316696875,"standard_error":1.773070829009367,"retail":-14.932858920535159,"arb":8.622644603894532} **39.** Enlarge only before rival arrival (size reverts on arrival): seat2 [pilot]: {"n":128,"failures":0,"mean":-13.652549059176561,"standard_error":2.217496899949547,"retail":-0.2505199783789064,"arb":-13.40202908080625} **40.** Enlarge only before rival arrival (size reverts on arrival): seat2k [pilot]: {"n":128,"failures":0,"mean":-13.040021449796093,"standard_error":2.4307262268523515,"retail":5.532735052352342,"arb":-18.572756502173437} **41.** Enlarge only before rival arrival (size reverts on arrival): seat4 [pilot]: {"n":128,"failures":0,"mean":-41.38450999544922,"standard_error":4.561210539522662,"retail":-3.034204165361723,"arb":-38.35030583004141} **42.** Enlarge only before rival arrival (size reverts on arrival): seat4ask [pilot]: {"n":128,"failures":0,"mean":-29.052724717938283,"standard_error":4.183439653087198,"retail":-8.89724490563594,"arb":-20.155479812260158} **43.** Enlarge only before rival arrival (size reverts on arrival): seat4bid [pilot]: {"n":128,"failures":0,"mean":-15.816428976439843,"standard_error":1.888657591772254,"retail":-0.5142490370929693,"arb":-15.302179939353126} **44.** Enlarge only before rival arrival (size reverts on arrival): seat4d0 [pilot]: {"n":128,"failures":0,"mean":-49.473280927178905,"standard_error":4.202273885194395,"retail":-1.6193445886046907,"arb":-47.85393633854687} **45.** Enlarge only before rival arrival (size reverts on arrival): seat4d2 [pilot]: {"n":128,"failures":0,"mean":-25.75604578831328,"standard_error":2.632910786686583,"retail":-5.256895061138285,"arb":-20.499150727149217} **46.** Enlarge only before rival arrival (size reverts on arrival): seat8 [pilot]: {"n":128,"failures":0,"mean":-92.4855986961539,"standard_error":7.466498514592308,"retail":-10.546543782001564,"arb":-81.93905491412188} **47.** Enlarge only before rival arrival (size reverts on arrival): seat8d3 [pilot]: {"n":128,"failures":0,"mean":-18.71665906314531,"standard_error":3.0390255809609013,"retail":-2.5464284501585945,"arb":-16.17023061296328} **48.** Additional destination orders only while holding current front seat; distance >=2; REJECT: missing source lots [pilot]: {"n":128,"failures":0,"mean":-3.441084017809374,"standard_error":0.9746232767439736,"retail":-0.024724413497657582,"arb":-3.4163596042570314} **49.** Additional destination orders only while holding current front seat; distance >=2; actual source lots only [pilot]: {"n":128,"failures":0,"mean":-5.257823764128905,"standard_error":0.9775805265535427,"retail":-1.8426682012890643,"arb":-3.415155562811719} **50.** Additional destination orders only while holding current front seat; distance >=3; REJECT: missing source lots [pilot]: {"n":128,"failures":0,"mean":1.906089814894532,"standard_error":0.7614760094214625,"retail":2.3788436113007787,"arb":-0.4727537963945314} **51.** Additional destination orders only while holding current front seat; distance >=3; actual source lots only [pilot]: {"n":128,"failures":0,"mean":0.32069510314687666,"standard_error":0.8092263931604664,"retail":0.8814762307054665,"arb":-0.5607811275664063} **52.** Smoothly grow real destination/front capacity from 1x at distance 3 to 2x at distance 4 [pilot]: {"n":128,"failures":0,"mean":-0.2577731685046857,"standard_error":0.7926233490242619,"retail":1.7098330309242187,"arb":-1.96760619945} **53.** Smoothly grow real destination/front capacity from 1x at distance 3 to 3x at distance 4 [pilot]: {"n":128,"failures":0,"mean":-1.9022853282414047,"standard_error":1.1478324726322795,"retail":2.0234246408453136,"arb":-3.9257099691007813} **54.** Future-destination order split into 10/30/60 percent tranches [pilot]: {"n":128,"failures":0,"mean":0.2844628441765636,"standard_error":0.14624062406126553,"retail":0.4457787358492169,"arb":-0.16131589166718782} **55.** Same three tranches plus doubling before arrival [pilot]: {"n":128,"failures":0,"mean":-9.182581900766406,"standard_error":2.240468878079268,"retail":3.289959263574997,"arb":-12.472541164365625} **56.** Two destination tranches: 25 percent then 75 percent, >=$5 [pilot]: {"n":128,"failures":0,"mean":0.12040183048281487,"standard_error":0.09778717703454312,"retail":0.2254721643289045,"arb":-0.1050703338421876} **57.** Same three tranches plus 4x pre/post-arrival size at distance >=2 [pilot]: {"n":128,"failures":0,"mean":-18.24834287252578,"standard_error":3.1014746997146467,"retail":5.428805177773435,"arb":-23.677148050328125} **58.** Two destination tranches: 75 percent then 25 percent, >=$5 [pilot]: {"n":128,"failures":0,"mean":0.35441505724375016,"standard_error":0.1641319996111408,"retail":0.5843445063265613,"arb":-0.2299294490796875} **59.** Two equal destination tranches on asks only, total notional >=$5 [pilot]: {"n":128,"failures":0,"mean":0.295555285997657,"standard_error":0.12454952329374087,"retail":0.31957190525937307,"arb":-0.024016619263281268} **60.** Two equal destination tranches on bids only, total notional >=$5 [pilot]: {"n":128,"failures":0,"mean":0.3036144196914076,"standard_error":0.0935671836766393,"retail":0.2660576336710936,"arb":0.03755678600703097} **61.** Two equal future-destination tranches, minimum four shares [pilot]: {"n":128,"failures":0,"mean":0.5322364972265642,"standard_error":0.1537998319581469,"retail":0.5751218681703103,"arb":-0.04288537095312492} **62.** Four equal future-destination tranches, minimum eight shares [pilot]: {"n":128,"failures":0,"mean":0.40263024390937724,"standard_error":0.18154223777320078,"retail":0.9215735767242179,"arb":-0.5189433328148441} **63.** Eight equal future-destination tranches, minimum sixteen shares [pilot]: {"n":128,"failures":0,"mean":0.3444188403203135,"standard_error":0.20313840161217298,"retail":1.0592748633671858,"arb":-0.7148560230312501} **64.** Two equal destination tranches, total notional >= assumed mean retail order $5 [pilot]: {"n":128,"failures":0,"mean":0.5340464372085949,"standard_error":0.1510781193665596,"retail":0.5750142540648416,"arb":-0.040967816866406145} **65.** Two-share anchor followed by the rest of the future-destination order [pilot]: {"n":128,"failures":0,"mean":-0.07959382450781187,"standard_error":0.06558524609476954,"retail":-0.057749923289062866,"arb":-0.02184390121093735} **66.** Double real tick-5 pre/front asks when estimated p<0.02 [validation]: {"n":661,"failures":0,"mean":0.06986006839924357,"standard_error":0.39021532346315563,"retail":0.5830906700871406,"arb":-0.5132306016848714} **67.** Same two-tranche $5 rule with direct order placement [validation]: {"n":661,"failures":0,"mean":0.2863755793948557,"standard_error":0.11663516717835355,"retail":0.5662314794022699,"arb":-0.2798559000152797} **68.** Additional future-tick orders, distance >=3; REJECT: missing source lots treated as ticks 0/100 [validation]: {"n":661,"failures":0,"mean":-0.3914835281956126,"standard_error":0.8198868963008447,"retail":2.8763384996750387,"arb":-3.267822027872617} **69.** Future-destination order split into 10/30/60 percent tranches [validation]: {"n":661,"failures":0,"mean":-0.07002059900998485,"standard_error":0.19253402006509446,"retail":0.5315582748748863,"arb":-0.6015788738931922} **70.** Two equal future-destination tranches, minimum four shares [validation]: {"n":661,"failures":0,"mean":0.26488349885491647,"standard_error":0.11582979619251661,"retail":0.5544642085237527,"arb":-0.2895807096739787} **71.** Two equal destination tranches on both sides, total notional >=$48 [validation2]: {"n":738,"failures":0,"mean":0.034844010853387314,"standard_error":0.026663028524228572,"retail":0.039856788844173756,"arb":-0.005012777992412017} **72.** Two equal destination tranches on bids only, total notional >=$5 [validation2]: {"n":738,"failures":0,"mean":0.32621537635420006,"standard_error":0.07156603076126304,"retail":0.2962651674348237,"arb":0.029950208922086607} **73.** Two equal destination tranches on bids only, total notional >=$20 [validation3]: {"n":488,"failures":0,"mean":0.16583784444323724,"standard_error":0.06292183124768809,"retail":0.15496302901536915,"arb":0.010874815418442381} **74.** Bid-only equal tranches at real future destination ca-4, source ask <=99, total notional >=$20; fixed before unseen [validation3]: {"n":488,"failures":0,"mean":0.16580731308913887,"standard_error":0.0629219927693215,"retail":0.15496302901536915,"arb":0.010844284064344019} **75.** Same >=3 additional-order rule with idle-loop optimization; REJECT: missing source lots [tune]: {"n":2043,"failures":0,"mean":-1.4265934815550658,"standard_error":0.8261636205825369,"retail":2.600184849869554,"arb":-4.026778331427509} **76.** bid-timing pilot timing: {"wall":{"base":61.643766783643514,"yours":61.57911495119333},"cpu":{"base":13.822515086999994,"yours":13.868329329999995,"runs":20}} **77.** bid20-timing pilot timing: {"wall":{"base":61.34124193061143,"yours":60.31905086012557},"cpu":{"base":13.667095317000001,"yours":13.381397484999988,"runs":20}} **78.** bidfast-timing pilot timing: {"wall":{"base":62.22642746241763,"yours":63.44133620429784},"cpu":{"base":13.624254605000003,"yours":13.596684846,"runs":20}} **79.** fullfast-timing pilot timing: {"wall":{"base":66.36208059033379,"yours":67.31026616180316},"cpu":{"base":13.585730130999996,"yours":13.945817172999996,"runs":20}} **80.** kernel-timing pilot timing: {"wall":{"base":101.80883803172037,"yours":104.8974393629469},"cpu":{"base":13.705857461999994,"yours":14.200055347000005,"runs":20}} **81.** lot48-timing pilot timing: {"wall":{"base":61.44434935040772,"yours":58.997285183053464},"cpu":{"base":13.382345948,"yours":13.340585814999997,"runs":20}} **82.** opt-timing pilot timing: {"wall":{"base":103.57655311888084,"yours":103.16528169158846},"cpu":{"base":13.887074632000008,"yours":14.055095081999996,"runs":20}} **83.** pre-timing pilot timing: {"wall":{"base":137.37058035843074,"yours":139.27380474703386},"cpu":{"base":13.780055360999995,"yours":14.091148544000003,"runs":20}} **84.** Diagnostic on first 64 spread-4 tuning seeds: {".cache/base.py":{"runs":64,"steps":128000,"reserved_cash":22.336927876562495,"future_reserved_cash":8.943800659374997,"front_bid_steps":0.166671875,"front_ask_steps":0.1713671875},".cache/kernel.py":{"runs":64,"steps":128000,"reserved_cash":22.426416690625,"future_reserved_cash":8.86831994765624,"front_bid_steps":0.1765859375,"front_ask_steps":0.179859375}} **85.** Arithmetic check: 299601 cent-quantity sizes from 4 to 3000 shares conserve total quantity after equal splitting; aligned-grid arithmetic alternative passed 10000 randomized exact-equality cases but was rejected as slower. **86.** Frozen real-source bid-only $20 candidate unseen evaluation: {"n":2009,"mean":0.17255959975495247,"standard_error":0.05609359681034755,"retail":0.2216695056799397,"arb":-0.0491099059248383,"failures":0} **87.** Frozen candidate final 200-run timing, alternating order in one process: {"wall":{"base":294.15425222413614,"yours":291.83430307451636},"cpu":{"base":131.15759489399977,"yours":130.01038047599997,"runs":200}} **88.** Frozen real-source bid-tranche candidate 64-run collateral/queue diagnostic: {".cache/base.py":{"runs":64,"steps":128000,"reserved_cash":22.336927876562495,"future_reserved_cash":8.943800659374997,"front_bid_steps":0.166671875,"front_ask_steps":0.1713671875},".cache/final.py":{"runs":64,"steps":128000,"reserved_cash":22.23691695,"future_reserved_cash":8.858086147656255,"front_bid_steps":0.174,"front_ask_steps":0.171171875}} **89.** Final decision: eligible: positive discovery, independent tuning-validation and unseen gains; zero failures; all 900 non-target records identical; wall time <= base ### q4-bids **0.** Scorer check: 4000 runs from seed 4000, --workers 4: 98.4694596619638 (matches author). Unseen = 2009 spread-4 seeds in 60000-67999; tuning = 2043 spread-4 seeds in 8000-15999 (diffs below are on tuning runs 0-599, base 145.0466, split by seed parity) **1.** Flow measurement (base, 400 tuning runs): rival bids take retail sells mainly at floor(p) and 1-4 ticks below; p>=20c: d0 284 sh/1.64$, d-1 216 sh/3.17$, d-2 124 sh/3.04$; p 1-2c d0 233 sh/1.32$ per run **2.** Life-size (x2) any bid at ca-4, the tick where the next rival bid lands: -6.27 (se 0.46), arb -6.99 **3.** x4 at ca-4: -23.46; x4 at ca-4 plus keep front: -20.32 **4.** x2 at ca-4 only when >=2 ticks under p: -4.18; x3 when >=3 ticks under: -2.06 (arb losses to jumps outweigh the extra retail) **5.** Same restricted to p<5c (x2/x4, >=1 tick): +0.014 / -0.28 (only 72 runs changed) **6.** Keep front order at cb at 4x one-step size, no distance guard: +0.03 (se 0.17; retail +0.54, arb -0.51; one run -90) **7.** Keep front x4 with >=1 tick guard: -0.27 (se 0.46; par1 +0.21 but one run -275 to arb); dollar cap on size had no effect **8.** Keep front x4 with >=2 tick guard (CHOSEN): +0.0305 se 0.017, both parity halves positive; x10 same (+0.0298); confirmed on unused tuning runs 600-1299: +0.059 se 0.021; unseen: +0.051792014328919854 se 0.012644173743880268 **9.** Front-only keep restricted to p<5c: +0.044 se 0.028 (10 runs changed) ### q4-demand **0.** Verbatim demand graft at s==4 (posterior sizing, stock, near-price target): part A 300 seeds mean +1.274812949576001 se 0.9029830479433238 retail -1.480418146218334 arb +2.755231095797333; part B 300 seeds mean -1.0791068147179994 se 1.3438314545861416 retail -1.5526588164169999 arb +0.47355200172266676. Rejected: lost on part B. **1.** Stock only (tick-1 stock 1.25 x fitted flow, near-price target .3+.5 x flow, own-bid gate): part A 300 seeds mean -0.1924383136340008 se 0.13535886791188245. Rejected, spread 4 stock sizing does not pay. **2.** Base's lognormal rule with fitted rate and mean, both ways (qs2): part A 300 seeds mean +1.0379682220830002 se 0.9805305089731766 retail -1.7930033660889997 arb +2.830971588176667. Not kept alone. Combined with stock: +0.9342280950409997 se 0.9946360367708087. **3.** qs2 with 0.85 loss factor to hold retail: part A 280 seeds mean +1.3569413068921419 se 0.961062635702969 retail -0.05; part B 300 seeds mean -0.8284193164136665 se 0.7294315033468177. Rejected: lost on part B. **4.** qs2 size only allowed up: part A 279 seeds mean -0.08305059040394379 se 0.217118292705503. Rejected. **5.** qs2 size only allowed down: part A 276 seeds mean +1.3954642653623182 se 1.0036140073753563; part B 300 seeds mean -0.529836695887001 se 0.743923040860674. Rejected: lost on part B; by true-flow quartile the gain sat in the thinnest quarter. **6.** KEPT: size down only when posterior is confident (>=64 observations) and fitted flow < 0.45: part A 300 seeds mean +0.3923329087306663 se 0.4905585670040766 retail -1.2627471876363336 arb +1.6550800963656667; part B 300 seeds mean +0.31040315320933354 se 0.3021050747687596 retail -1.1145426831003344 arb +1.4249458363013334. Thinnest true-flow quartile gains +1.91 on A and +1.60 on B, others about 0 to -0.22. **7.** Speed: first form of the frozen rule was 9.5% slower than the base over 60 tuning runs; behaviour-preserving rewrites brought it to +0.5% over 40 runs and +0.74% over the final 200 runs.