# Merge 3 — r2-fresh-b The JSON below merges the supplied item results without rerunning simulations or recomputing scores. All row metrics come from the corresponding input’s `paired` object; `h_seeds`, `h_n`, and `h_complete` copy `seeds`, `n`, and `complete`. Keys identify the supplied items. `mechanism` is the first 200 characters of `approach`; the retail-generator’s structured approach is serialized as JSON before truncation. `next` is truncated to 300 characters. Top code and hashes are copied verbatim from the selected inputs. For reference-mean flags, the common full-row value is `99.6958781523823`. Literal unequal values, including `99.69587815238229` and rounded `99.6959`, are flagged; no tolerance or inferred correction is applied. Scoring reports `99.53422961247875`, also unequal. No row is removed. These flags do not independently establish that a mechanism measurement is wrong. The requester reports source-recheck problems for collateral-allocator (two sources), fill-priority (two), scoring (one), and competitor (one). The specific failed passages and source identities were not supplied in these inputs. Their simulator explanations and graft rationales are therefore treated as qualified item claims, including the top-ranked competitor estimator’s crossing interpretation. No missing source passage is reconstructed. References to separate `sources.json` files are not independently verified here. This merge relies only on the ten supplied results; it does not endorse their external-source claims. Source mapping for every row, its notes, and selected code (each link is the supplied result’s named repository source; the readable snapshot is `.imd/reads/artifacts/item-`): - [f-improve-when-queue-long](../../items/f-improve-when-queue-long/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-collateral-allocator](../../items/f-collateral-allocator/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-one-sided](../../items/f-one-sided/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-order-age-refresh](../../items/f-order-age-refresh/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-complete-set](../../items/f-complete-set/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-audit-fill-priority](../../items/f-audit-fill-priority/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-audit-retail-gen](../../items/f-audit-retail-gen/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-audit-arbitrageur](../../items/f-audit-arbitrageur/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-audit-scoring](../../items/f-audit-scoring/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. - [f-audit-competitor](../../items/f-audit-competitor/result.json): `approach`, `paired`, `graft`, `next`, `code`, and `code_sha256`. ```json { "rows": [ { "key": "f-audit-competitor", "mechanism": "Blind competitor-ladder audit. S0 quotes around the visible midpoint, using one-to-two typical retail tickets of size rather than large exposure that an arbitrageur can consume in full. S1 changes onl", "code_sha256": "eac4e22a59a291df1413275c327d61ab25bfb2792596f95f24d890875cc5b08b", "h_seeds": [ 200000, 200999 ], "h_n": 1000, "h_complete": true, "mechanism_diff": 35.6444743113832, "mechanism_se": 3.7645511946271233, "mechanism_retail_diff": 8.6550883031914, "mechanism_arb_diff": 26.9893860081846, "reference_diff": -152.5603923628106, "reference_se": 6.571232549532504, "b_mean": 99.6958781523823, "failures": [], "graft": "Track previous competitor bid/ask and a fair-price estimate. On ask rising alone set p=ask-0.5 ticks; on bid falling alone set p=bid+0.5. Otherwise relax toward midpoint, clipping to [bid+0.5,ask-0.5]. Inward quote changes may be opposite-side replenishments. Feed p into existing sizing/quoting; keep everything else unchanged.", "next": "No promotion is claimed; reserved finalist seeds were never used. Graft the estimator into a stronger capital-management baseline and measure paired incremental value separately. Retail depletion and absent boundary quotes can produce false or censored crossing signals; test a probabilistic crossing", "flag": null }, { "key": "f-one-sided", "mechanism": "Blind construction from pinned simulator only. S0 estimates probability by smoothing the competitor interval, its movement, and fill imbalance; it posts two passive quotes sized from retail share dema", "code_sha256": "c7a2294db5148572b5225ecdc42c786a4da3d7cbce872ffc2dfa5a1c9febbaf7", "h_seeds": [ 200000, 200999 ], "h_n": 1000, "h_complete": true, "mechanism_diff": 28.4694987255857, "mechanism_se": 1.291425530691067, "mechanism_retail_diff": -2.0145466948174, "mechanism_arb_diff": 30.4840454203934, "reference_diff": -102.5048745195422, "reference_se": 5.499450420418756, "b_mean": 99.6958781523823, "failures": [], "graft": "After calculating normal bid/ask prices and sizes, compare estimated probability minus bid price with ask price minus estimated probability. Keep normal size on the larger-margin side; cap the other at 0.05 shares. Leave estimator, prices, and cash limits unchanged; fills will feed back differently.", "next": "Do not promote this standalone strategy: holdout S1 mean -2.81 is far below reference B 99.70. The one-sided gate improves its own baseline by 28.47 (SE 1.29), mainly reducing arbitrage loss by 30.48 while losing 2.01 retail edge. Next, graft the gate onto a stronger estimator and evaluate on separa", "flag": null }, { "key": "f-complete-set", "mechanism": "Literal complete-set arbitrage does not exist here: the API is passive-only, nothing can be lifted, and the competitor book was crossed on only 29 of 240,000 tuning-seed steps. The book's equivalent: ", "code_sha256": "4587c61432f18e0c9e33061def6661cfffd7fbcc01c209f7e29ab391767b9c15", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": 15.3204, "mechanism_se": 1.5768, "mechanism_retail_diff": 38.3008, "mechanism_arb_diff": -22.9803, "reference_diff": -65.6599, "reference_se": 3.855, "b_mean": 99.6959, "failures": [], "graft": "Track NO lots and their cost. While no>yes, post a bid at floor(min(fair-0.5, 100*(0.99-avgNOcost))) if above the competitor bid, sized min(12/max(p,.05), no-yes). Pay for it first; give uncovered asks half of (cash-bid cost-100). Covered asks need no cash.", "next": "Graft onto the current best and measure paired there; the gain depends on how often that strategy runs short of cash, which was not measured because B's code was not read. RESERVE rose at every step and the variant budget ended there, so a larger value is untested. The reserve and the set bid were c", "flag": "b_mean unequal to common full-row b_mean 99.6958781523823; preserved literally, without rounding tolerance" }, { "key": "f-improve-when-queue-long", "mechanism": "Blind S0 passive quoting behind the observed competitor best by one tick, with size larger near the midpoint; S1 changes only the quote tick: when inferred best-level size is at least 0.90 shares, imp", "code_sha256": "164e3bf421f8870cae4b58d838d19b21a9558a793c6610f9243e7d37a326eac7", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": 13.8750163264264, "mechanism_se": 1.1080948504478247, "mechanism_retail_diff": 3.6033509491395996, "mechanism_arb_diff": 10.2716653772908, "reference_diff": -112.467541302388, "reference_se": 6.3806458745624335, "b_mean": 99.69587815238229, "failures": [], "graft": "Read competitor_best_bid_ticks and competitor_best_ask_ticks. Estimate best-level shares as 48.0 divided by price. If that estimate is >= 0.90, quote one tick inside that side; otherwise quote one tick behind it. Keep the existing strategy's sizing and inventory limits.", "next": "The mechanism improved S0 on the prescribed 1,000 paired holdout seeds, but remains far below the supplied B reference; test a mechanism with directly observable queue size if the API is extended.", "flag": "b_mean unequal to common full-row b_mean 99.6958781523823; preserved literally, without rounding tolerance" }, { "key": "f-audit-arbitrageur", "mechanism": "{\"name\": \"Full-sweep marginal retail-tail exposure cap\", \"blindness\": \"Built from the pinned simulator and its README/rules only; the supplied reference was accessed only as fixture.H numeric data. No", "code_sha256": "3555e077a3946c7baee5ecc011341153f8a74ee836be301b88a94b5e32d236ec", "h_seeds": [ 200000, 200999 ], "h_n": 1000, "h_complete": true, "mechanism_diff": 10.1517497548782, "mechanism_se": 0.47492885312875416, "mechanism_retail_diff": -0.2243609679304, "mechanism_arb_diff": 10.3761107228079, "reference_diff": -108.6786106362596, "reference_se": 5.505568976759615, "b_mean": 99.6958781523823, "failures": [], "graft": "Keep prices unchanged. Estimate per-share expected loss L from the next probability move past each quote. Cap size at the retail-notional tail quantile where arrival_rate/2 * quote_margin * P(retail_notional > size*conversion) equals risk_multiplier*L. Full sweeps make every extra share bear L; queue depth offers no protection.", "next": "The cap improves this independent S0 by more than two paired standard errors. Test it as a graft on a stronger probability estimator using new authorized tuning/holdout seeds; retain it only if paired gains replicate. S1 trails supplied reference B, so do not submit S1 as a replacement for B. Finali", "flag": null }, { "key": "f-audit-retail-gen", "mechanism": "{\"mechanism\": \"Lognormal marginal-fill sizing, with side-specific retail size conversion.\", \"audit\": \"Pinned retail.py samples Poisson arrivals, independent Bernoulli sides, and lognormal notionals wi", "code_sha256": "ab25358da54a116b52a14e3ff7b0e8f7cb493caa0d423c1d38170c3c8b280400", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": 1.8732341278019, "mechanism_se": 0.14374148418939942, "mechanism_retail_diff": -2.5557101156283, "mechanism_arb_diff": 4.4289442434324, "reference_diff": -105.1284176733217, "reference_se": 6.103915320570419, "b_mean": 99.6958781523823, "failures": [], "graft": "For a quote ahead of competitor liquidity, replace mean-flow size by the lognormal share-size quantile with survival A/(side_arrival_rate*edge). Use notional/ask for retail buys and notional/max(p_est,0.05) for retail sells. Estimate A from the host model; retain its quotes, collateral caps, and probability estimate.", "next": "The tail rule clears a two-SE gain against S0 on this holdout; test it as a sizing-only graft using the host probability and adverse-loss model. This does not establish transfer to a stronger strategy. Do not promote the standalone S1 over B.", "flag": null }, { "key": "f-audit-scoring", "mechanism": "Blind engine-audit mechanism: the simulator submits passive orders before advancing the latent process, but scores every fill against the post-advance probability and lets arbitrage sweep stale favora", "code_sha256": "182eaf12a25643c1823430f0e1473b928507ae64e813bfe5caa0e4838c7cd5f3", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": 0.0811321440683, "mechanism_se": 0.03710700637513639, "mechanism_retail_diff": -0.04052142033609999, "mechanism_arb_diff": 0.1216535644041, "reference_diff": -100.2574288960915, "reference_se": 5.731347603240803, "b_mean": 99.53422961247875, "failures": [], "graft": "After computing the other strategy's passive bid and ask ticks, add one tick to each distance from its probability estimate (or midpoint proxy), preserving its sizing and inventory guards. This sacrifices some retail fills to avoid fills whose post-step score edge is erased by the process move.", "next": "The mechanism improved the paired holdout but remains far below the supplied B reference; test it only as an arbitrage-loss reduction graft and retain the reference strategy as incumbent.", "flag": "b_mean unequal to common full-row b_mean 99.6958781523823; preserved literally, without rounding tolerance" }, { "key": "f-audit-fill-priority", "mechanism": "Engine audit of same-tick fill allocation at commit b244530: _best_order picks min (ask) / max (bid) price, ties broken by RestingOrder.sequence (strict FIFO price-time, no pro-rata). Every order, com", "code_sha256": "e9dcc925af8b3e4bc544bc762cf237a454b2ad6e698eb767ec1de4371cbd7d94", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": -1.29e-06, "mechanism_se": 9.6e-07, "mechanism_retail_diff": -1.48e-06, "mechanism_arb_diff": 1.9e-07, "reference_diff": -99.2527, "reference_se": 5.7357, "b_mean": 99.6959, "failures": [], "graft": "Give each order a client id, tagged senior if placed strictly inside the competitor's best on its side. Each step, if the competitor best now equals a senior resting order's tick (cb==bid or ca==ask) and edge vs fair >= KEEP_M, keep it rather than re-quote 1 tick inside: you are ahead of the competitor in FIFO at a better price. Never CancelAll and re-place unchanged orders.", "next": "Negative result in this setting. My S0 uses a competitor-midpoint fair estimate that is too poor: with M=1 arb loss swamps retail edge (-1.88). With M>=2 it rarely quotes, so the senior-at-competitor-tick case almost never comes up: S1 differs from S0 on 6 of 1000 holdout seeds. Retest the rule graf", "flag": "b_mean unequal to common full-row b_mean 99.6958781523823; preserved literally, without rounding tolerance" }, { "key": "f-collateral-allocator", "mechanism": "Blind baseline estimates probability from the static competitor quote boundaries, quotes around that estimate, and scales quantity by modeled retail edge versus one-step adverse-selection loss. S1 alo", "code_sha256": "b752830e27feff1b6ae135f94775b11241b4c7715202d4b70e71b80a0eb94cbf", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": -0.0012405603923000017, "mechanism_se": 0.0006636302224588415, "mechanism_retail_diff": -0.0003440473981999996, "mechanism_arb_diff": -0.0008965129940999983, "reference_diff": -100.0638487834241, "reference_se": 5.742667411207072, "b_mean": 99.6958781523823, "failures": [], "graft": "After choosing bid and ask prices, estimate each side’s positive next-step edge per share. Divide by its locked cash per share (bid price or 1 minus ask price), then split the cash budget in proportion to those rates; cover asks with existing YES first. This blind test found no gain, so validate before use.", "next": "Do not graft this allocator yet. The best tuning setting mostly suppresses quotes; on holdout only 5/1000 seeds differ and its paired gain is negative. The more active tuning settings also lose, mainly through additional arbitrage. A future mechanism should first improve conditional probability esti", "flag": null }, { "key": "f-order-age-refresh", "mechanism": "S0 keeps one passive buy and sell quote around the visible competitor midpoint, replaces a filled side, and uses a 1.5-share size to limit adverse selection. S1 is identical except it cancels every li", "code_sha256": "d04654fd4de41bb925564bb7a26caead3a2712a5e674af1b288fed50e858c6e8", "h_seeds": "200000..200999", "h_n": 1000, "h_complete": true, "mechanism_diff": -5.0503233843932005, "mechanism_se": 0.19008064010686557, "mechanism_retail_diff": 4.282135232951901, "mechanism_arb_diff": -9.3324586173401, "reference_diff": -111.05576062761591, "reference_se": 5.833126473550443, "b_mean": 99.69587815238229, "failures": [], "graft": "Keep a max_age constant. Before the existing quote-maintenance logic, emit CancelOrder(order_id) for every own order where state.step - order.submitted_step >= max_age; then treat those ids as inactive so the normal placement logic reposts them.", "next": "Do not promote this mechanism: the frozen 20-step refresh reduced paired holdout edge. A future independent test could make cancellation conditional on a changed visible competitor quote rather than refreshing on age alone.", "flag": "b_mean unequal to common full-row b_mean 99.6958781523823; preserved literally, without rounding tolerance" } ], "top": [ { "key": "f-audit-competitor", "code": "import math\nfrom orderbook_pm_challenge.types import CancelAll, PlaceOrder, Side\n\nclass Strategy:\n # S0 uses the visible midpoint; S1 changes only estimate().\n mechanism = True\n margin = 1.0\n notional = 4\n relaxation = 0.0\n\n def __init__(self):\n self.previous = None\n self.price = None\n\n def estimate(self, bid, ask):\n midpoint = (bid + ask) / 2\n if not self.mechanism:\n return midpoint\n if self.previous is None:\n self.price = midpoint\n else:\n old_bid, old_ask = self.previous\n # Arbitrage removes all asks below p and all bids above p.\n # Inward changes can instead be next-step opposite-side refills.\n up = ask > old_ask\n down = bid < old_bid\n if up and not down:\n self.price = ask - 0.5\n elif down and not up:\n self.price = bid + 0.5\n else:\n self.price += self.relaxation * (midpoint - self.price)\n self.price = min(ask - 0.5, max(bid + 0.5, self.price))\n self.previous = (bid, ask)\n return self.price\n\n def on_step(self, state):\n bid = state.competitor_best_bid_ticks\n ask = state.competitor_best_ask_ticks\n bid = 0 if bid is None else bid\n ask = 100 if ask is None else ask\n p = self.estimate(bid, ask)\n # Widen near expiry as diffusion per remaining step rises.\n width = self.margin + 0.35 * math.sqrt(2000 / max(20, state.steps_remaining))\n buy = min(99, max(1, math.floor(p - width)))\n sell = min(99, max(1, math.ceil(p + width)))\n actions = [CancelAll()]\n cash = max(0, state.cash - 0.02)\n # Cap exposure at a few typical retail tickets; bound collateral.\n for side, tick, denom in ((Side.BUY, buy, max(0.05, p / 100)),\n (Side.SELL, sell, max(0.05, p / 100))):\n q = self.notional / denom\n unit = tick / 100 if side == Side.BUY else 1 - tick / 100\n covered = state.yes_inventory if side == Side.SELL else 0\n q = min(q, covered + cash * 0.48 / unit)\n q = math.floor(q * 100) / 100\n if q >= 0.01:\n actions.append(PlaceOrder(side, tick, q))\n cash -= max(0, q - covered) * unit\n return actions\n", "code_sha256": "eac4e22a59a291df1413275c327d61ab25bfb2792596f95f24d890875cc5b08b" }, { "key": "f-one-sided", "code": "import math\nfrom orderbook_pm_challenge.types import CancelAll, PlaceOrder, Side\n\n\nclass Strategy:\n WIDTH = 1.7\n ONE_SIDED = True\n PROBE = 0.05\n\n def __init__(self):\n self.p = None\n self.last_bid = None\n self.last_ask = None\n\n def on_step(self, state):\n b = state.competitor_best_bid_ticks\n a = state.competitor_best_ask_ticks\n lo = (b if b is not None else 0) / 100\n hi = (a if a is not None else 100) / 100\n mid = (lo + hi) / 2\n if self.p is None:\n self.p = mid\n else:\n # Bound the old estimate by current information, then relax to midpoint.\n p = min(hi, max(lo, self.p))\n if self.last_bid is not None and self.last_ask is not None:\n # A swept ask is evidence of an upward move; a swept bid, downward.\n delta = ((b or 0) - self.last_bid + (a or 100) - self.last_ask) / 200\n p += 0.5 * delta\n if state.sell_filled_quantity > 0 and state.buy_filled_quantity == 0:\n p += 0.002\n elif state.buy_filled_quantity > 0 and state.sell_filled_quantity == 0:\n p -= 0.002\n self.p = min(hi, max(lo, 0.75 * p + 0.25 * mid))\n self.last_bid, self.last_ask = b or 0, a or 100\n p = min(0.995, max(0.005, self.p))\n bid = min(99, max(1, math.floor(100 * p - self.WIDTH)))\n ask = min(99, max(1, math.ceil(100 * p + self.WIDTH)))\n # Retail share demand, tempered as one-step uncertainty rises near expiry.\n horizon_scale = max(0.15, math.sqrt(state.steps_remaining / 2000))\n size = min(50.0, 8.0 / max(0.08, p)) * horizon_scale\n qb = qa = size\n if self.ONE_SIDED:\n # The only mechanism change: retain normal size on the better side.\n buy_edge = p - bid / 100\n sell_edge = ask / 100 - p\n if buy_edge >= sell_edge:\n qa = min(qa, self.PROBE)\n else:\n qb = min(qb, self.PROBE)\n cash = max(0.0, state.cash - 0.01)\n qb = min(qb, cash * 0.45 / (bid / 100))\n qa = min(qa, state.yes_inventory + cash * 0.45 / (1 - ask / 100))\n actions = [CancelAll()]\n if qb >= 0.01:\n actions.append(PlaceOrder(Side.BUY, bid, qb))\n if qa >= 0.01:\n actions.append(PlaceOrder(Side.SELL, ask, qa))\n return actions\n", "code_sha256": "c7a2294db5148572b5225ecdc42c786a4da3d7cbce872ffc2dfa5a1c9febbaf7" } ], "notes": "Reported S1−S0 holdout components, not independently replicated: arbitrage loss fell for competitor estimation, one-sided sizing, queue-long improvement, arbitrageur tail caps, retail-generator tail sizing, scoring widening, and (negligibly) fill-priority retention. Retail edge rose for competitor estimation, queue-long improvement, complete-set cash logic, and age refresh. Complete-set and age refresh increased arbitrage loss; collateral allocation worsened both components. One-sided sizing, arbitrageur caps, retail tail sizing, scoring widening, and fill-priority retention sacrificed retail edge. See each named input’s paired fields, mapped below. Rows flagged for reference-mean discrepancies remain descriptive evidence only. Top ranks compare gains over different independently built S0 baselines, not absolute strategy quality or incumbent gains. All reported reference_diff values are negative; no finalist-seed promotion is established. Source-recheck failures weaken simulator interpretations from collateral-allocator (2), audit-fill-priority (2), audit-scoring (1), and audit-competitor (1); reported numerical results remain attributed claims, not verified measurements." } ```