Software · Quant research
CZCE Top Market-Maker Study 郑商所做市对标
In two days, one trader worked out from 28 million order-book rows how the exchange’s top-ranked market maker earns, and rebuilt its level in simulation. The Zhengzhou desk went on to trade one of its recommendations.
01System architecture
Pin down the target, prove the simulator on live orders, then let 14 strategies compete.
Nobody outside the leader can see its orders. The evidence is the benchmarks the exchange shares with its market makers, the desk’s own engine logs and public order-book data, so the design is a chain of proofs: reproduce the exchange’s P&L definition exactly, make a simulator agree with live orders, and only then search for the strategy that reaches the leader’s level.
From the exchange
Benchmarks and statements
The market-maker benchmarks the exchange shares with its members, and settlement statements. None of those figures appear on this page.
Step 1 · the target
The number to beat, defined exactly
The exchange’s P&L definition, reproduced on 81 of 81 product-days, so that every simulated book is scored in the same units as the benchmark.
Step 4 · the verdict
Replication scorer
Scores every book against the leader day by day: monthly ratio, daily correlation, share of the leader’s profitable days reached at 70% or more.
Delivered
Nine reports
Two stage reports, the outright and spread back-tests, the matcher validation, the replication, the trader’s two questions, the layer study and the five-level back-test, with the caveats written in.
Market data
Order-book data
28 million rows: five-level books on the designated contracts and the best level on the main ones, from a one-click, read-only pull.
Step 3 · simulator
Outright simulator
A market-making quoting strategy with inventory skew, replayed on single-contract books with queue, latency and cancel models.
Step 3 · the search
14 candidate books
Every plausible strategy, judged on the same data and the same P&L definition; the trading rules run on the same simulators. Six are ruled out; four are adopted, one is a supplement, three are set aside.
The desk
Product trader
Reads the reports and asks what a practitioner asks: main contracts or designated ones, and what about the one-quote rule?
The desk’s engine
Engine logs
Two months of logs: every order, fill and cancel, and the spread books every 250 ms.
Step 2 · simulator
Spread matcher v3.1
Infers spread trades from the two legs’ volume, because the exchange publishes no spread trade prints. Checked order by order against live orders.
Step 2 · the gate
Order-by-order validation
Replays live orders and checks the totals, the kind of fills and, in the end, each order’s fate against what happened at the exchange. Three matcher versions failed; the fourth agrees on 79 to 82% of orders.
Simplified: the spread matcher also reads the legs’ cumulative volume from the order-book data, and the hypothesis tests that rule candidates out are not drawn. Everything on the diagram is offline analysis; nothing here sends an order.
Why validate before searching?
A simulator that flatters every strategy will happily explain any rival. So the first acceptance test was not about the leader at all: replay the desk’s own live orders and reproduce what the exchange did with each of them. Two matcher versions passed on totals and were thrown out because they produced the wrong kind of fills, and a third was caught crediting fills to orders that were already dead.
Why two simulators?
Zhengzhou lists calendar spreads as books of their own and publishes no trade prints for them, so spread fills have to be inferred from the legs. Single contracts do print trades, and there a quoting strategy can be replayed directly. One P&L definition, the exchange’s, marks both.
What is observed and what is simulated
Observed: the exchange’s benchmarks, the desk’s own orders and every order-book snapshot. Simulated: the fills a different strategy would have received. The leader’s own orders were never observed, so the result is a sufficient explanation, not a transcript of what it did.1
02The story
Two days, 28 million order-book rows, and the leader’s level rebuilt in simulation.
The Zhengzhou exchange ranks its market makers and shares benchmark results with them.2 Shuo set out to explain how the leader on glass, methanol and soda ash earns: he opened the question himself, on his own initiative, on products outside his own book. In two days he worked out, from two months of order logs and 28 million market snapshots, what the leader’s playbook is, and showed in a simulator validated on live orders that the same playbook reaches the leader’s level.1
01
The problem
A market maker earns a small margin on each trade by always standing ready to buy and to sell. The Zhengzhou Commodity Exchange ranks its market makers and shares benchmark results with them, so every member knows the leader’s level and nobody knows how it is reached.2
- The leader’s orders are invisible: the benchmarks give totals, never trades.
- The usual suspects were all plausible: faster machines picking off stale quotes, a cleverer arbitrage between a spread and its legs, momentum trading, bigger bets on direction.
- Guessing wrong is expensive: each theory implies a different strategy to build.
02
What he built
Shuo treated it as a forensic case with a strict order of proof, and built every piece himself: the parsers, both simulators, the scorer and the reports, from scratch in two days, on top of the live-hog replica and validation tools from his own earlier projects.3
- First, the yardstick. He reproduced the exchange’s profit definition exactly, on 81 of 81 product-days, so that any simulated strategy could be scored the exchange’s way.4
- Second, a simulator that has to earn trust. Zhengzhou publishes no trade records for its calendar spreads (packages that buy one delivery month and sell another), so he invented a way to infer those trades from the two underlying contracts, then made the simulator replay live orders and checked, order by order, whether each met the same fate as at the exchange; the final version agrees on about four orders in five. Three earlier versions were thrown out: two matched the totals for the wrong reasons, and a third was caught crediting trades to orders that were already dead.5
- Third, a fair contest. Fourteen candidate strategies were tested on the same data and the same profit definition, against a bar he fixed in advance: reach at least 70% of the leader’s result on a daily basis.6
The answer is almost embarrassingly simple. Picture two stalls. One stands at the market entrance and serves every passer-by who wants a little of something. The other is at the back of a long line and only gets customers when a busload arrives and buys out everyone in front, usually because the price is about to move. The leader’s playbook is the first stall: quote the designated single contracts, the ones the exchange names for its market makers, at the best price, with size.7 An order resting at the back of a long calendar-spread queue is the second stall: it fills mainly when a sweep is about to move the price.
03
What changed
The desk got a measured answer in place of guesswork, in two days, and acted on it.
- The Zhengzhou desk traded a recommendation from the study.8
- The surviving strategy reached the leader’s level in simulation on all three products, and reached 70% of the leader’s daily result on most of its profitable days on each.1,9 Re-run on the following month, out of sample with the sizes fixed beforehand, it cleared the bar on two products and missed it on the third, and the report says so.10
- Six popular explanations were ruled out with evidence, among them spread-versus-leg arbitrage, far-month sniping, momentum and directional bets.6
- Shuo overturned two of the study’s own early conclusions with its own checks: a suspected second trading engine, and a finding that one layer of orders earned everything.
- The product’s trader replied with two practitioner questions the same afternoon and got simulated answers that evening, followed that night by a back-test showing that occupying five price levels, with standing orders deeper in the queue, adds a double-digit percentage on top.11
The study closes with a concrete next step: a small live trial on one contract, to replace the simulator’s assumptions with a measured number.1
2days
from opening the question to a replication report on the product trader’s desk, by one trader3
14
candidate strategies tested on the same data and P&L definition against a bar fixed in advance; six ruled out6
28million
order-book rows replayed, beside two months of engine logs12
81 / 81
product-days on which the exchange’s own profit definition was reproduced exactly, before anything was simulated4
79–82%
of live spread orders given the same fate, filled or unfilled, by the final matching simulator as by the exchange5
4
versions of the matching simulator built; three discarded on evidence before one passed order-by-order validation5
03Evidence
Rebuilding the leader’s level, in simulation
Each row sets the simulated book’s trading profit against the leader’s for one product: the hollow dot is the calibration month, the filled dot the following month, out of sample. The shaded zone is below the leader.
Simulated trading profit, relative to the leader
In simulation the strategy left standing reaches 1.07 to 1.26 times the leader on all three products in sample; out of sample the book stays above 70% of the leader on every product but reaches only about three quarters of its level on two (0.71× and 0.74×), and misses the daily bar on one.
Show the dataHide the data
| Product | In sample | Out of sample | Change |
|---|---|---|---|
| Product A | 1.24× | 1.62× | +0.38× |
| Product B | 1.07× | 0.71× | −0.36× |
| Product C | 1.26× | 0.74× | −0.52× |
04Functions
One question, answered in the order the evidence allowed.
A study has no screens. These are its five stages in the order the desk met them. Every chart is drawn for this page: result charts use synthetic data and say so directly below, and the queue charts use public exchange order-book data.
A
Fix the yardstick
Before any theory, the study reproduces the exchange’s own profit definition to the last unit, so every later comparison is in the benchmark’s units.
- The exchange’s trading P&L equals closing P&L plus mark-to-market P&L from the settlement statement, gross of fees: exact on 81 of 81 product-days4
- Two months of raw engine logs parsed in 149 seconds: every order, fill and cancel12
- The leader’s reported footprint and benchmark scores set the target profile; none of those figures are reproduced here2
B
Find out where a quote’s margin goes
Every fill is followed forward in time to see how much of the quoted margin (half the gap between the best buy and sell prices) is still there seconds later.
- A fill from the back of a long spread queue earns the full quoted margin at the moment of the trade and gives most of it back within seconds: it happens mainly when a sweep is about to move the price13
- On the designated single contracts, the resting side of a best-price trade still holds more than half of the margin after five seconds on two of the three products, on public order-book data13
- A suspected second trading engine was checked with the trader and against trade timestamps, found wrong, and withdrawn in writing
Margin still held five seconds after a fill
Five seconds after a fill, back-of-queue spread fills keep about a fifth of the margin; best-price fills on the single contracts keep 33 to 65%.
| Product | Spread-queue fills | Best-price fills |
|---|---|---|
| Product A | 19% | 51% |
| Product B | 16% | 33% |
| Product C | 21% | 65% |
C
Rebuild the leader’s book in simulation
Fourteen candidate strategies compete on identical data; the one left standing quotes the designated single contracts at the best price, and reaches the leader’s level.
- All three products at or above the leader’s level for the month, in simulation1
- At least 70% of the leader’s daily result on most of its profitable days on every product, against a bar fixed before the search9
- Re-run on the following month, out of sample: the bar is cleared on two products and missed on the third10
Enlarge
Enlarge
D
Answer the trader’s questions
The product’s trader read the report and replied with two objections from the trading seat; both were answered by simulation the same evening.
- Main contracts or the designated ones? At equal size the designated contracts earn a multiple of what the main contracts earn, in simulation
- The exchange allows one quote instruction per contract. Run only through quote instructions, most of the result is lost; a minimum-size quote for the obligation plus ordinary limit orders for the strategy keeps all of it
- Shuo’s own follow-up test, quoting no first level at all, exposed an accounting artifact in the study’s earlier claim; he corrected the accounting and re-reported
E
Go deeper in the queue
A desk proposal, which Shuo tied to his own early-queue research and tested the same night: occupy all five price levels and leave the orders on the third and fourth levels standing in the queue instead of re-pricing them.
- A double-digit percentage on top of the replicated book in the calibration month, and more out of sample, in simulation11
- Measured on public order-book data: a price three ticks (minimum price steps) away becomes the best price 68 to 71% of the time, and its queue grows 3.6 to 4.5 times on the way
- The gain comes from occupying the deep levels, not from seniority in the queue; refilling after partial fills adds inventory and nothing else
Queue advantage, single contracts
An order placed three ticks from the best price ends up ahead of roughly three quarters of the queue it will eventually stand in.
Show the dataHide the data
| Ticks from the best price | Glass | Methanol | Soda ash |
|---|---|---|---|
| 1 tick | 44% | 33% | 33% |
| 2 ticks | 61% | 30% | 58% |
| 3 ticks | 74% | 76% | 72% |
| 4 ticks | 81% | 79% | 74% |
05All screens
The day-by-day charts
Redrawn in English from synthetic data, in the layout of the charts in the delivered reports.
06Under the hood
For the technical reader: the model, the math and the code.
Under the hoodMatching model, order-by-order validation, the 14 hypotheses, out-of-sample results, ablations, sensitivity and code for the technical reader
Benchmark forensics by event-driven limit-order-book simulation, designed and built by one trader in two days. No predictive model is fitted here: the leader’s behavior is inferred by simulation and elimination, with the evaluation discipline of a machine-learning project. The steps are falsifiable in order: an exact accounting identity as ground truth; a matching model validated order by order against live orders with a confusion matrix of simulated against actual outcomes; an acceptance bar fixed before the search; 14 strategies compared on one data set; an out-of-sample window; ablations of each component; and a sensitivity table that says where the result breaks.
Data: two months of engine logs, parsed in 149 seconds, and 28 million order-book rows. Stack: about 50 Python 3.10 scripts, standard library only, multiprocessing across eight workers, and read-only MariaDB SQL pulls. Everything is aligned on exchange timestamps.
Charts, figure data and screenshots on this page are synthetic, illustrative or public market data. Methods and outcomes are described as they happened; the desk’s own figures are confidential and do not appear here. The matcher-validation chart and table measure the simulator itself.
The accounting identity comes first
The exchange defines a trading P&L per product for its market-maker benchmarks. Before comparing anything, the study establishes what that number is: closing P&L plus mark-to-market P&L from the broker’s settlement statement, gross of fees. The identity holds exactly on 81 of 81 product-days.
Every simulated book below is marked with this identity at the day’s settlement price, so a simulated number and a benchmark number are the same quantity.
Diagnosis: mark-outs, expressed as a share of the half-spread
For every fill, the mark-out follows the mid price forward and divides by the half-spread , so 100% means the full quoted margin is intact and 0% means it is gone.
- Back-of-queue spread fills start at about 100% and give most of it back within seconds. The reason is flow composition: an order at the back of a queue of hundreds to thousands of lots trades mainly when the whole level is taken, which is when the price is about to move through it.
- Age is the tell. Fills of orders that have rested for minutes keep more than half of the half-spread at five seconds; fills of orders a few seconds old keep about nothing. Re-pricing an order discards exactly the seniority that makes its fills worth having.
- The single contracts are a different market. On public order-book data the designated outright contracts are one tick wide 89 to 100% of the time (methanol’s far month 60%), 16 to 48% of their volume is prints of 20 lots or fewer, and the passive side of a best-price trade holds more than half of the half-spread after five seconds on two of the three products. Small prints only ever reach the front of the queue.
- The lesson is where quotes sit, not speed. Best-price quotes on the designated single contracts earn small, uninformed flow; orders at the back of long spread queues fill mainly when a sweep is about to move the price.
A matcher for books that publish no trades
Zhengzhou lists calendar spreads as order books of their own, one tick wide with hundreds to thousands of lots at the best price, and publishes no trade prints for them: no last price, no volume. The standard queue model, in which a print at a resting order’s price consumes the queue ahead of it, cannot be built.
The idea that replaces it: every spread trade also trades both legs, so the smaller of the two legs’ volume increments over a 250 ms snapshot interval is a tight upper bound on spread lots traded in that interval. On the day it was tested, every one of the desk’s spread fills sat in a window where that bound was at least the fill’s size, while a random one-second window shows a median of zero. With the decrease in displayed volume at the order’s price, the inferred flow and the share of it that hit this side of the book, the queue ahead of a resting order shrinks only by the part of the decrease that trades can explain. The remaining rules:
- Cross: the opposite best reaches the resting price, so the order fills at its own price.
- Through: the level vanishes and the touch moves past. It is a sweep, and a full fill, only if the inferred flow covers at least half the level; otherwise others canceled and the order is left alone at the best.
- Touch only, FIFO: the queue is consumed only while the price is at the touch, in time priority behind the desk’s own earlier orders.
- Latency: a decision reaches the book 0.1 s later. At zero delay a visible share of lots was mislabeled as aggressive and simulated P&L was inflated several-fold.
- v3.1 additions: each order’s actual lifetime, the exact snapshot interval in which each order died, fractional arrival and cancel windows inside an interval, and an effective queue at joining of 0.7 times the displayed size.
def inferred_spread_flow(snapshots, near_leg, far_leg, window=1):
"""Upper bound on spread lots traded in each snapshot interval."""
flow = [0] # nothing is known before the first snapshot
for prev, now in pairs(snapshots): # consecutive order-book snapshots
d_near = traded_volume(near_leg, prev.time, now.time)
d_far = traded_volume(far_leg, prev.time, now.time)
flow.append(min(d_near, d_far)) # every spread trade prints on both legs
if window > 1: # optional smoothing over the last few intervals
flow = rolling_sum(flow, window)
return flow
def traded_volume(leg, t0, t1):
"""Increase in a leg's cumulative volume between two times, never negative."""
return max(0, leg.cumulative_volume_at(t1) - leg.cumulative_volume_at(t0))Validation: three versions discarded, on evidence
The acceptance test replays one month of the desk’s own spread orders through the matcher and compares with what the exchange did. Matching totals is not enough. The test that mattered is the order-fate matrix, a method carried over from Shuo’s live-versus-backtest work on live hog: a confusion matrix over individual orders, actual outcome against simulated outcome. counts orders unfilled in both, filled in both, phantom fills (the model fills an order the exchange did not) and missed fills. A model can hit total lots exactly while and cancel; agreement cannot be gamed that way.
That is how v3 was caught: half of its lot ratio of 1.0 came from late fills, credited after the live order had already died, because the model let orders live for an hour. The direction of the remaining error is stated, not hidden: on the desk’s own orders the final matcher still over-credits P&L on two of the three products. That matters when reading the headline result.
Matcher v3 before and after actual order lifetimes
Matcher v3 matched live volume almost exactly until each order was held to its actual lifetime; then it filled only 54 to 60% of the lots.
| Product | Orders live up to an hour | Actual order lifetimes | Change |
|---|---|---|---|
| Glass | 1.01 | 0.60 | −0.41 |
| Methanol | 0.98 | 0.54 | −0.44 |
| Soda ash | 1.00 | 0.54 | −0.46 |
| Version | What it matched | Why it was kept or discarded |
|---|---|---|
| v1 · one-parameter queue | Filled lots within a few percent of live | Discarded with v2: the same queue-shrink idea, which cannot tell trades from cancels |
| v2 · level-shrink | Total lots and P&L | Discarded: wrong fill mix. Its fills lost their edge far faster than live fills did, and a replica of the quoting strategy on it lost money |
| v3 · leg-flow inference | Lots 1.01 / 0.98 / 1.00 of live | Caught by the fate matrix: about half the lots were credited after the live order had died. Held to each order’s actual lifetime it filled only 0.60 / 0.54 / 0.54 |
| v3.1 · actual lifetimes | Order-fate agreement 82% / 79% / 79%; strategy replica lots 1.00 / 1.01 / 0.94 of live | Kept. It still over-credits P&L on two of the three products, and the report says so |
The outright simulator, and what it was not calibrated on
The outright simulator replays a market-making quoting strategy on single-contract books, including an inventory skew that moves the quote center against the position. Its matching rules are V6, the successor Shuo built on live hog to the improved matcher of his daily FAK report: a queue that starts at the displayed size plus a share of later growth (α), a two-price allocation of each interval’s volume (a colleague’s idea), a cross rule, attrition from visible cancels with exponent γ = 3, 0.10 s arrival and cancel windows, and a survival rule for aggressive fill-and-kill orders: such an order fills only if its target level is still displayed at the next snapshot, because live fill-and-kill orders mostly fill when the level survives and rarely when it has vanished. On live hog those rules raised order-fate agreement by a wide margin, in sample and out of sample, and removed almost all phantom fill-and-kill fills. An alternative cross rule tested on the same data scored lower, so the V6 rule stayed.
The limit is stated plainly: those rules were calibrated on live-hog orders on the Dalian exchange, and no ground truth exists yet for best-price quoting on these Zhengzhou single contracts. An earlier first pass, run on Shuo’s validated live-hog replica (a grid of 12 configurations across 24 contracts in three minutes on eight workers), therefore applied a conservative capture haircut; the final book is reported without it.
Fourteen hypotheses, one bar
The acceptance bar was set before the search: at least 70 to 80% of the leader’s result on a daily basis. The benchmark profile narrowed the field first: it fits a liquidity provider, not a directional trader. Then every candidate was judged on the same data and P&L definition, and every trading rule ran on the same matchers.
Why these sizes, and not simply bigger? Size is not tuned for profit. Per contract, the book takes the size whose simulated market share best matches the leader’s reported footprint, so the comparison is like for like. Bigger is not better: on the product whose designated contract is also its main contract, the book starts losing money as size grows, because that contract carries informed flow.
| # | Candidate | Verdict | Deciding evidence |
|---|---|---|---|
| 1 | Join the best price on the designated outright contracts | Adopted | Reaches the leader’s level with one uniform size on two levels; these books are one tick wide 89–100% of the time (methanol’s far month 60%) |
| 2 | Keep orders within two ticks; skew only new orders | Adopted | Lifts the same test book clearly: re-pricing discards queue seniority, and fills of long-resting orders keep more than half of the half-spread against about none for young ones |
| 3 | Improve inside wide spreads | Adopted | Little change on the one-tick near months; with rule 2 it turns the far-month contracts from losses to profits on two products |
| 4 | Two price levels instead of one | Adopted | A large gain against one level: the second level catches the pull-back after a one-tick move |
| 5 | Pool inventory across a product’s contracts | Set aside | A modest gain, bought with a much larger peak position per contract |
| 6 | Volatility-adaptive size | Set aside | Right direction, too small to matter |
| 7 | Momentum skew | Rejected | Large simulated losses in both months: these books mean-revert at one minute |
| 8 | Simply bigger size | Set aside | Helps two products up to a point; the third starts losing as size grows |
| 9 | Spread quoting alongside, never paused | Supplement | Adds a meaningful share on top of the outright book |
| 10 | Spread-versus-legs arbitrage | Rejected | 12 executable snapshots in a month, all on one spread; the spread book sits inside the leg-implied book 99% of the time |
| 11 | Far-month lead-lag sniping | Rejected | Lag correlation ≤ 0.11; the far month follows a front-month tick within 1 s only 12–49% of the time |
| 12 | Wide quotes for a bigger edge | Rejected | Negligible market share, P&L about zero |
| 13 | Directional or overnight exposure | Rejected | Inconsistent with the benchmark profile |
| 14 | Turnover without edge | Rejected | Zero P&L by construction, so it cannot explain a result |
Result: the leader’s level, in simulation
Books are scored by the monthly ratio and the daily hit rate , the share of the leader’s profitable days on which the simulated book reaches at least 70% of it. The following month is the out-of-sample window: the book keeps the sizes set in the calibration month. One rule was added after seeing that window, a standard roll-week precaution that cuts size on delivery-month and newly listed contracts, and the report says so.
Read the table as level, not path. The daily correlation between the replicated book and the leader is weak: the simulation reaches the leader’s level over the month without tracking its day-to-day pattern. On every product it is ahead of the leader on most days; Product B is ahead on the fewest, falls short of 70% of the leader on more days, and loses with it on its worst day. One out-of-sample day is not explained at all, and the report says that too.
| Book | Period | Product A | Product B | Product C |
|---|---|---|---|---|
| Outright book · monthly ratio R | In sample | 1.24× | 1.07× | 1.26× |
| Outright book · daily hit rate H | In sample | 72% | 63% | 75% |
| Outright book + spread quoting · R | In sample | 1.49× | 1.33× | 1.59× |
| Outright book · R, roll-week rule | Out of sample | 1.62× | 0.71× | 0.74× |
| Outright book · daily hit rate H | Out of sample | 78% | 44% | 67% |
| Outright book + spread quoting · R | Out of sample | 1.98× | 1.04× | 1.01× |
Where it breaks: sensitivity and failure modes
A simulated ratio above 1.0 is a statement of sufficiency, not a forecast, and the study lists why.
- No market impact. Simulated orders do not change anyone else’s behavior.
- Borrowed matching rules. The outright rules come from a Dalian contract; nothing on these Zhengzhou contracts can validate them yet.
- Known over-credit. On the desk’s own spread orders the companion matcher over-credits P&L on two of the three products.
- No haircut in the headline. The final book is reported without the first pass’s conservative capture haircut; applying it would put the same book below the leader’s level.
- One product depends on speed. One contract is both designated and the main contract, and carries informed flow.
The study’s own recommended next step was therefore a small live A/B on one contract, to replace the model haircut with a measured capture ratio.
One test book under four matching assumptions
Products A and C stay above the leader under every assumption; Product B falls below zero when orders reach the exchange 0.25 s later.
Show the dataHide the data
| Product | Baseline | Slower link | Faster queue | Longer queue |
|---|---|---|---|---|
| Product A | 1.82× | 1.49× | 2.11× | 1.49× |
| Product B | 1.17× | −0.20× | 1.38× | 0.99× |
| Product C | 1.87× | 1.33× | 2.25× | 1.55× |
Two conclusions the study overturned itself
The second engine. The first stage report inferred a second trading engine from volume that the engine log did not explain. Shuo checked the inference with the product’s trader, then re-tested it against trade timestamps. It was wrong, and the claim was withdrawn in writing.
The second layer. An early finding said the whole of the spread book’s profit came from orders one level behind the best price. Shuo ran the direct test: do not quote the first level at all. Building it exposed an accounting artifact. Sessions had been started flat and leftovers marked at the day’s settlement price; second-level fills happen at the extremes of a sweep while settlement sits near the day’s average, so “settlement minus fill price” was positive by construction. The fix is a carry convention, in which positions are carried across sessions and days and daily P&L telescopes to the exchange’s definition.
Under carry accounting the picture is different and more useful: neither layer works alone. A first-level fill is adversely selected; the second-level order exists only because the inventory skew placed it after a sweep, fills at the extreme from the front of its queue, and earns as the price reverts. Round trips between two best-price fills, the large majority of lots, earn about nothing; the profit is in round trips with a second-level leg. On single contracts, by contrast, a best-price-only book keeps most of the result on two of the three products, where the flow at the best price is small and uninformed. The replicated outright book is essentially unchanged by the accounting correction.
| Book, with one layer removed | Product A | Product B | Product C |
|---|---|---|---|
| Spread book, first level only | 0.32× | 0.11× | 0.30× |
| Spread book, second level only | −0.25× | 0.15× | 0.41× |
| Single-contract book, best price only | 0.61× | 0.37× | 0.56× |
The trader’s questions, and five levels
Main or designated contracts? Main contracts earn a similar edge per lot but far fewer fills per lot of size, because their best level is two to three times thicker. At equal size the designated book earns a multiple of the main-contract book, in simulation.
One quote instruction per contract. A designated market maker must keep a minimum size on both sides, within a maximum spread, for a minimum share of trading time; that is the obligation. A new two-sided quote instruction cancels the old one on both sides, so a one-sided fill or a price change sends both sides to the back of the queue. Ordinary limit orders coexist with it. Running the strategy only through quote instructions loses most of the result, and more still if the quote is re-priced actively; a minimum-size resting quote for the obligation with the strategy on ordinary limit orders keeps all of it. The rule is a non-issue if the quote carries only the obligation.
Five levels and deep standing orders. On public order-book data a level three ticks from the best becomes the best 68 to 71% of the time (median wait 86 seconds on methanol, 9 minutes on soda ash, 18 on glass), and its queue grows 3.6 to 4.5 times on the way. Re-placing the deep orders every tick gives almost the same result as keeping them, so the money is in occupying the levels, not in seniority. A cap on net inventory leaves the gain almost unchanged, so it is not bought with risk; refilling after partial fills only adds inventory. The cost is a modest rise in message traffic. On spread books only the five levels help; the wait there is too long for deep standing orders to add anything, though they cut cancels sharply.
Queue advantage, spread books
On the calendar-spread books an early order gains nothing one tick away and never more than on the single contracts; methanol reaches only 37% at four ticks.
Show the dataHide the data
| Ticks from the best price | Glass | Methanol | Soda ash |
|---|---|---|---|
| 1 tick | 0% | 0% | 0% |
| 2 ticks | 31% | 6% | 22% |
| 3 ticks | 58% | 22% | 60% |
| 4 ticks | 76% | 37% | 74% |
| Change to the replicated outright book | Product A | Product B | Product C |
|---|---|---|---|
| Five levels only, in sample | +13% | +21% | +14% |
| Standing orders at levels 3–4 only, in sample | +5% | +9% | +6% |
| Both, in sample | +19% | +34% | +22% |
| Both, out of sample | +30% | +70% | +44% |
Built with
- Python 3.10 (standard library only)
- Event-driven limit-order-book simulation
- Queue-position, latency and cancel-attrition models
- Trade-flow inference from leg volumes
- Order-by-order validation (confusion matrix) on live orders
- Hypothesis testing on tick data
- Out-of-sample testing
- Ablation and sensitivity analysis
- Market microstructure
- Mark-out (adverse-selection) analysis
- Data pipeline: log parsing, 28 M tick rows
- multiprocessing
- SQL / MariaDB
- Reproducible data pulls
07Releases
Shipped in versions, like a product.
- Study openedData inventory, exact P&L definition, mark-out diagnosis and the first stage report. A second-engine inference is raised and checked with the trader the same evening.
- Replication reportSecond stage report withdraws the second-engine claim in writing. Spread matcher v3.1, outright simulator, 14 strategies scored, milestone reached in simulation and sent to the product’s trader. The same day: answers to the trader’s two questions, the layer study with its accounting correction, and the five-level back-test.
- Follow-upAt the trader’s request, nine calendar-spread combinations on the three products were run through the SPD Parameter Optimizer. The result was recorded as inconclusive, with that model’s limits on these books written in.
- 1Simulation results, not live trading results. Charts, figure data and screenshots on this page are synthetic, illustrative or public market data. Methods and outcomes are described as they happened; the desk’s own figures are confidential and do not appear here. The simulation has no market impact and applies no haircut; its outright matching rules were calibrated on a Dalian live-hog contract; on the desk’s own spread orders the companion matcher over-credits P&L on two of the three products. The leader’s orders were never observed: the result shows that this strategy is sufficient to reach the leader’s level, not that it is what the leader does. No live profit figure is claimed for the recommendation the Zhengzhou desk traded.
- 2The exchange shares market-maker benchmarks with its members; none of those figures appear here.
- 3Study opened on the afternoon of September 9, 2026; the replication report reached the product’s trader on September 10, and the follow-up answers, the layer study and the five-level back-test were finished that night. Glass, methanol and soda ash are products outside his own book.
- 4Exchange trading P&L = closing P&L + mark-to-market P&L from the broker’s settlement statements, gross of fees, matched exactly on 81 of 81 product-days.
- 5Order-by-order validation on one month of the desk’s spread orders: the final matcher gives 82% / 79% / 79% of orders (glass / methanol / soda ash) the same outcome, filled or unfilled, as the exchange did, and a replica of the quoting strategy on it reproduces live monthly volume at 1.00 / 1.01 / 0.94 of actual. This validation covers the spread simulator; the single-contract simulator’s matching rules were calibrated on live-hog orders on the Dalian exchange.
- 6Fourteen candidate strategies judged on the same data and the same P&L definition against the same bar: four adopted, one kept as a supplement, three set aside, six rejected. Ten ran through the simulators, two were tested directly on the order books, one against the benchmark profile and one from the accounting. The full list with the deciding evidence for each is under the hood.
- 7The leader’s quoting is inferred: the benchmarks give totals and scores, never orders. The study treats the benchmark leader as one market maker; the benchmarks do not prove that.
- 8The desk’s Zhengzhou trader traded a recommendation from this study. Which recommendation, its sizes and its results are not shown, and no live profit figure is claimed. Every result ratio on this page is an illustrative value generated for this page; the matcher-validation ratios measure the simulator itself, and the queue figures are public market data.
- 9The bar of 70 to 80% of the leader’s result on a daily basis was set before the search. In simulation the outright book cleared it on every product in the calibration month. The level is reached; the day-to-day pattern is not reproduced. The day-by-day charts on this page are redrawn from synthetic data.
- 10The out-of-sample window is the first trading days of the following month. The book keeps the sizes set in the calibration month; a roll-week rule that reduces size on delivery-month and newly listed contracts was added after that run, as a standard risk control. In simulation the period total stayed above 70% of the leader’s on every product; the book cleared the daily bar on two products and missed it on the third, where its daily hit rate fell well below the calibration month’s.
- 11Simulated change relative to the replicated outright book, carry accounting; the table under the hood carries illustrative values. Queue measurements are from public exchange order-book data. The two changes were a desk proposal that Shuo tied to his early-queue research and tested the same night.
- 12Two months of engine logs, parsed in 149 seconds, and 28 million order-book rows across the three products, with five price levels on the designated contracts.
- 13Mark-outs as a share of the half-spread (half the gap between the best bid and the best offer): how much of the quoted margin a fill still holds when it is valued at the mid price a moment later. The chart’s values are illustrative. The single-contract statement is measured on public order-book data: the passive side of all best-price trades on the designated contracts of two of the three products.