Options MM Analysis

Software · Quant research

Options MM Analysis 期权做市分析

The trading engine’s per-contract profit counters start again from zero whenever the engine restarts. Shuo rebuilt a full day of copper, gold and silver options P&L from 16.7 million log lines, reconciled it with the engine to the cent, and mapped where the cost of the quoting obligation falls: contract by contract, session by session.

  • Framed, designed and built by Shuo Huang
  • Restart-proof P&L attribution, by contract and session
  • 16.7M log lines, 0 parse errors
  • Reconciled with the engine to the cent
  • 54 automated checks, 0 failures
  • SHFE copper, gold and silver options
  • First report Sep 2026

01System architecture

Four small programs turn 16.7 million raw log lines into a P&L map that refuses to print unless every check passes.

The engine’s per-contract profit counters are scoped to one run of the engine: after a restart they begin again from zero and do not include positions carried in. That suits live monitoring, not a full day’s attribution. So the pipeline rebuilds P&L from the exchange’s fill confirmations and the order book, and keeps the engine as a witness (it still supplies the commission, stitched across restarts).

Trading engine

One day of engine logs

2.58 GB, 16.7M lines: every fill confirmation, a profit sweep about once a second, position prints, and the five-level order book every half second.

Step 1

Log parser

Streams the logs once into fills, profit and position tables. Every row keeps its source file and line. One unparseable line fails the whole run.

Step 2

Mark extractor

The last order-book mid at or before each session boundary, for every contract that traded.

Step 3

P&L rebuild

Rebuilds P&L from fills and boundary marks, stitches fees across engine restarts, and splits the day into night, reopen gap and three day sessions.

The gate

Verification log

54 pass/fail checks, the bucket identities and a money reconciliation for every contract against the engine’s own counters.

Derived tables

Contract × session tables

Lots, gross, fees, net and per-lot P&L by contract, by call/put series and by product.

Step 4

Report builder

Two editions of one report: net of fees for the desk, and gross of fees to lay beside a colleague’s independent run. Every figure is computed, none typed.

About 1,000 lines of standard-library Python with no third-party packages, so it runs on a standard desk PC with nothing installed. The pipeline re-runs on any day’s log archive in four commands; the first report covered one trading day.

Why not just read the engine’s profit table?

Because its counters live only as long as one run of the engine. A restart sets every contract’s profit counters back to zero and leaves out the positions the previous run still held, so summing them silently drops money that was made or lost. The first version leaned on them; a closer look at the points where they dropped, and at the positions open across those points, exposed the gap.

Why a gate instead of a warning?

A P&L report with one wrong cell is worse than no report, because people act on it. The report builder opens the verification log first and refuses to build if it contains a single failure, then re-asserts that gross minus fees equals net before rendering anything.

Why two editions?

A colleague ran the same check independently. The gross-of-fees edition exists to lay the two side by side, and its banner lists the three definitional choices most likely to explain a gap: lots counted on both sides, positions marked at the order-book mid, and the overnight reopen gap kept in its own bucket.

02The story

Profit counters that reset on every restart, rebuilt to the cent from 16.7 million log lines.

A market maker is rewarded by the exchange for keeping prices on the screen, and must trade a required amount whether or not each trade pays. Shuo asked the question a strategist asks: if the quoting is mandatory, where is it cheapest to do? To answer it he first had to see that the trading engine’s own profit table starts over at every restart, then rebuild the day’s profit and loss from the raw record. The result is a map for the desk’s copper, gold and silver options, one cell per contract and trading session, with every contract’s total reconciled against the engine’s own books.

  1. 01

    The problem

    An options market maker on the Shanghai Futures Exchange must keep buy and sell prices on the screen and trade a required volume on designated contracts. Meeting that duty costs money on some contracts and at some hours, and almost nothing on others.1 A daily total says what the duty cost; it does not say which contract, which session.

    Think of a delivery company that must serve every district but can choose which trucks run which shift. Before it can plan, it needs the cost of each district on each shift. Here a district is an option contract, a shift is one of the day’s four trading sessions, and the cost is profit or loss per lot, one lot being one contract traded.

    • The engine’s built-in profit table looked like that answer, but it is built for a single run: it behaves like a cash register that starts its running total again every time it is switched off and on, and forgets the stock already on the shelf2
    • The raw record was 16.7 million log lines for a single day3
  2. 02

    What he built

    Shuo framed the task as a constrained optimization, meet the obligations at the lowest loss, and built its first input: a per-lot P&L for every contract in every trading session.4

    His first version read the engine’s profit table. A closer look at the points where its counters dropped showed why that cannot work for a whole day: they start again from zero whenever the engine restarts, and leave out the positions it was already holding. So he stopped using the table as the source of P&L and kept it as a witness.

    The final four-step pipeline reads one day’s engine-log archive, rebuilds P&L from the exchange’s own fill confirmations and the order-book mid price at each session boundary, then checks itself with 54 automated checks and a money reconciliation against the engine for every contract.5 If one check fails, no report is produced.

    The result matched the engine to the cent, contract by contract; the few contracts that differed did so by precisely the P&L of positions carried across a restart, which a restarted run’s counters do not include.6

  3. 03

    What changed

    The desk had a ranked, color-coded answer the same evening,7 and it showed that the cost of the obligation is far from evenly spread:

    • Cost concentrates. A few sessions and a few contracts carried a disproportionate share of the day’s cost, while others cost little.
    • Commission is a large part of the bill, so a per-lot loss cannot be read as a trading loss until the two are split.8
    • The same obligation volume is not the same bill in every product and every session, which is just what an allocation can use.

    The desk’s figures stay confidential; the charts below show the structure of the report on synthetic data.

    Shuo then added a gross-of-fees edition, so a colleague’s independent run could be laid beside it, and split the ranking into one chart per product; both were ready seven minutes after he started on them.9 The map is the cost side of the optimization; the exchange obligation figures are the constraint side.10

16.7M

engine-log lines parsed for one trading day, with zero parse errors3

0

failures across 54 automated checks and a money reconciliation for every contract5

1¢

the precision of the reconciliation with the trading engine, contract by contract; every exception fully explained6

2.58GB

of raw logs streamed in a single pass at constant memory, every row traceable to its file and line

≈1,000

lines of standard-library Python, no third-party packages: a new day is four commands

7min

to add a second edition and per-product ranking charts, the evening of the first report9

03Evidence

What the report shows

The three charts are drawn from synthetic data with the structure of the report. Methods and outcomes are described as they happened; the desk’s own figures are confidential and do not appear here.

Why a run-scoped counter cannot give a day’s P&L

One fictitious option contract over a night and a day session: the lots a counter that restarts with the engine would show, against the lots the exchange confirmed for the same contract.

One contract’s traded lots: a run-scoped counter against the exchange’s fills

The counter starts again from zero at each restart, so at the close it shows only 33% of the lots the contract traded.

Data: One contract’s traded lots: a run-scoped counter against the exchange’s fills
SeriesTime, from the night open to the next day’s closeShare of the contract’s lots for the day (%)
Exchange fills00.0%
Exchange fills3018.7%
Exchange fills6030.1%
Exchange fills9041.3%
Exchange fills12051.8%
Exchange fills15057.3%
Exchange fills18063.0%
Exchange fills21065.1%
Exchange fills24067.4%
Exchange fills72067.4%
Exchange fills75071.4%
Exchange fills78075.4%
Exchange fills79577.7%
Exchange fills81077.7%
Exchange fills84081.6%
Exchange fills87086.9%
Exchange fills99086.9%
Exchange fills1,02089.8%
Exchange fills1,05096.7%
Exchange fills1,080100.0%
Run-scoped counter00.0%
Run-scoped counter3018.7%
Run-scoped counter4323.6%
Run-scoped counter44–
Run-scoped counter440.0%
Run-scoped counter606.4%
Run-scoped counter9017.7%
Run-scoped counter12028.2%
Run-scoped counter15033.7%
Run-scoped counter18039.3%
Run-scoped counter21041.4%
Run-scoped counter24043.8%
Run-scoped counter476–
Run-scoped counter7120.0%
Run-scoped counter7200.0%
Run-scoped counter7504.0%
Run-scoped counter7808.0%
Run-scoped counter79510.3%
Run-scoped counter81010.3%
Run-scoped counter84014.1%
Run-scoped counter87019.5%
Run-scoped counter99019.5%
Run-scoped counter1,02022.4%
Run-scoped counter1,05029.3%
Run-scoped counter1,08032.6%
Synthetic data. Illustrative values, generated to show the effect: cumulative lots as a share of the contract’s lots for the day (both sides counted), with one restart during the night session and one before the day session. The first erases 24% of the day’s lots from the counter, the second everything traded up to the night close. The profit and commission counters of the same sweep restart at the same moments. The method is as built; the desk’s own figures are confidential. In the data table, time is in minutes after 21:00.2

Where the cost of quoting sits

Cost per lot for three anonymous products in each trading session, indexed so that the day’s average loss per lot is 100. Below zero is a profit.

Cost per lot by session and product, indexed

Night is the costliest session for all three products, Product B makes money in two of its three day sessions, and 10:30–11:30 is the cheapest session for Products A and C.

Show the dataHide the data
Data: Cost per lot by session and product, indexed
SessionProduct AProduct BProduct C
Night146281130
09:00–10:15117−51105
10:30–11:30559690
13:30–15:0095−5897
Synthetic data. Illustrative values, generated to show the effect. Each cell is the net cost per lot in that session (commission included, lots counted on both sides) divided by the day’s average cost per lot, ×100; a negative value is a profit. The method is as built; the desk’s own figures are confidential.7

Commission is a large part of the bill

Each product’s cost per lot, split into trading loss and commission, on the same index: the day’s average loss per lot is 100.

Cost per lot by product, trading and commission, indexed

Products A and C cost about the same per lot for opposite reasons: commission is 57% of A’s loss and 19% of C’s.

Data: Cost per lot by product, trading and commission, indexed
ProductTrading lossCommissionTotal
Product A4660106
Product B401252
Product C8820108
All three6832100
Synthetic data. Illustrative values, generated to show the effect: cost per lot divided by the day’s average, ×100, with lots counted on both sides. Each part is rounded to a whole number, so a stack can differ by one from the product’s index. Across the three products commission is 32% of the loss. The method is as built; the desk’s own figures are confidential.8

04Functions

From the session map down to a single contract

A

The session map: which shift costs what

One table shows which product loses how much per lot in each of the four trading sessions, colored so the expensive shifts are visible at a glance. The heat map under Evidence shows the same layout on synthetic data.

  • Red is a loss per lot, blue a profit; the deeper the color, the larger the number
  • Fee per lot sits beside net and gross-of-fees per-lot P&L, so commission is never mistaken for trading loss
  • The overnight reopen gap has its own column and carries no lots, so it cannot distort a session average

B

Rank the contracts within each product

Every option contract is ranked from worst to best per lot inside its own product, because ranking one metal’s options against another’s answers no question the desk can act on.

  • One chart per product, each on its own scale
  • Each row carries its lot count and net result, so a bad number on a small sample is visible as such
  • Losses run left of the zero line and profits right, so the contracts that pay stand out at a glance
A horizontal bar chart titled Product B options, worst to best per lot, marked Synthetic data. Six fictitious option contracts: five red bars extend left of a vertical zero line for losses per lot, the longest at the top (−203 on the index); one blue bar at the bottom extends right for a profit (+78). Enlarge
Synthetic data. A redraw of the report’s ranking chart for one anonymous product, on generated inputs. Red bars run left for a loss, the blue bar runs right for a profit. Results carry a P&L sign and are indexed so that −100 is the day’s average loss per lot; the Evidence charts flip the sign to show cost.11
  1. Marker 1: Worst per lot in this product: about twice the day’s average loss per lot.
  2. Marker 2: Under each contract: its lots and net result, so sample size is read with the bar.
  3. Marker 3: The zero line. Loss to the left, profit to the right. Bar lengths compare only within this product.

C

The decision surface: every contract in every session

Every traded contract down, four sessions across, one per-lot number and one lot count in every cell: the cost table a constrained optimizer would read.

  • Cells with fewer than 30 lots are marked †: shown for completeness, never read as a finding
  • Subtotal rows per product tie the matrix back to the session map above
  • A call/put split shows which side of the book a loss comes from
A heat matrix marked Synthetic data. 21 fictitious option contracts in rows, grouped as Products A, B and C with a subtotal row for each; columns for whole day, night and three day sessions. Most cells are shades of red; the blue cells all sit in the Product B block, mostly in its 09:00–10:15 and 13:30–15:00 columns. 12 cells with fewer than 30 lots carry a dagger. Enlarge
Synthetic data. A redraw of the report’s contract × session matrix on generated inputs: three anonymous products, each closed by a subtotal row. Each cell holds the per-lot result in that session, indexed so that −100 is the day’s average loss per lot, beside its lots in small gray type.11
  1. Marker 1: Session columns: night, 09:00–10:15, 10:30–11:30, 13:30–15:00, after a whole-day column.
  2. Marker 2: Product A subtotal: red in every session, lightest at 10:30–11:30.
  3. Marker 3: A blue cell on 19 lots. Every cell under 30 lots carries a †: displayed, flagged, not a finding.
  4. Marker 4: Worst contract per lot of the day (−203), on 122 lots: a number to read with its sample size.
  5. Marker 5: Product B subtotal: in profit at 09:00–10:15 and at 13:30–15:00, after the costliest night of the three.
  6. Marker 6: Subtotal rows tie every block back to the session map.

D

Proof before publication

The report prints its own audit trail, and it exists only because that trail is clean: 54 checks, a money reconciliation for every contract, zero failures.

  • Fills tied to the engine’s lot counters contract by contract, across every reset; a shortfall passes only when a reset explains it, and it is flagged and traced12
  • Contract multipliers inferred from the engine’s own amounts rather than assumed (to 1 part in 10,000), and session buckets that add back to the whole day by construction
  • Every fill and engine reading traces to a source file and line number in the raw log; no figure is typed by hand

05All screens

Two views of the program.

06Under the hood

The accounting, the restart stitch and the proof

Under the hoodModels, math and code for the technical reader

For the quant or engineer: the optimization this feeds, the data, the accounting identity, the restart problem and its stitch, the verification design, and what the report showed.

The objective this feeds

An exchange-designated options market maker must quote and trade designated series to the exchange’s standards. A loss on an obligated series is partly the price of the obligation, so the right question is not how do we stop losing but where is obligation volume cheapest. With xis the lots traded in contract i during session s, and cis the per-lot loss there, the desk’s problem is a constrained cost minimization. This project estimates the cost vector c; the obligation set O comes from the exchange’s market-maker terms.10

Per-lot is the natural unit because obligations are stated in volume and quoting duty. Lots are counted on both sides (buys plus sells), which is the desk’s own convention for average P&L, so every figure can be laid beside the desk’s sheets. A reader who counts one side sees half the lots and twice the per-lot loss.

minx∑i,scisxissubject tox∈O,0≤xis≤uis
c: per-lot loss by contract and session (this project). O: the exchange’s quoting and volume obligations. u: how much volume a session’s order book can actually absorb.

Data: four record types from one log

The source is one day’s log archive from the options trading engine: 2.58 GB, 16.7 million lines, parsed with zero errors in a single streaming pass (constant memory, one regular expression per record type). The parser fails loudly: a line that carries a record marker but does not parse is written out, counted, and makes the run exit non-zero. Every parsed row keeps its source file and line number, and every mark its order-book timestamp, so any figure traces back to the raw log.

The whole pipeline is about 1,000 lines of standard-library Python (csv, re, collections), with no pandas or NumPy, so it runs on a standard desk PC with nothing installed. Each step is a command with explicit inputs and outputs, so a new day is four commands on a new archive.

The four record types the pipeline reads, described generically.
Record typeWhat it carriesUsed for
Fill confirmationsThe exchange’s own fill returns: contract, trade ID, direction, offset type, price, volume, exchange timeThe ground truth, deduplicated on (contract, trade ID, direction)
Profit sweepA per-contract sweep about once a second: cumulative buy and sell lots and amounts, mark-to-market P&L, commissionCommission, and the engine’s side of every reconciliation
Position printsPosition state after each fillRead, then deliberately not used as a check: their scope is narrower than a trading day
Order-book snapshotsFive-level order book per quoted contract every 0.5 sSession-boundary mid prices only

The accounting identity

P&L is defined as the day’s trading P&L: the cash flow of the day’s fills plus the net position, built from those fills starting flat, marked at the order-book mid. For contract i with multiplier mi, let Cb be the signed cash of fills in bucket b (sells positive), qb the net position at the end of the bucket and Mb the mid at its closing boundary.

The buckets are night, overnight reopen gap, 09:00–10:15, 10:30–11:30 and 13:30–15:00. The gap bucket has no fills: it is the night-close position times the move from the night close to the day open. Because each bucket opens at the previous bucket’s closing mark, the sum telescopes to the whole-day figure identically, by construction; the log records the identity for every contract and for the day.

Four choices are deliberate:

  • Mid, not settlement. The engine’s own P&L is marked at mid, so mid marks make the rebuild comparable to the engine contract by contract. The final mark is the last mid of the day; a settlement mark would differ only on contracts that end the day with a position.
  • A separate gap bucket. A position left at the night close is repriced at the open with no trading in between. Folding that into either session would corrupt a per-lot figure meant to describe trading in that session.
  • Today’s trades only. The measure covers the day’s own trades from a flat start; positions carried from earlier days are outside these logs and outside this measure.
  • No lot-matching rule. Cash plus position at mark gives total P&L without choosing FIFO or average cost, so there is no convention to argue over when reconciling, and a price move on inventory lands in the session in which it happened, not in the session that later closed the position.

Marks. For each traded contract, the mark at a boundary is the last half-second order-book snapshot at or before it, M=(bid1+ask1)/2, falling back to the last traded price only if one side of the book is empty. A coverage check requires a mark at every boundary for every contract.

Commission. Fees come from the engine’s own per-fill fee calculation, which applies the exchange’s fee rule by offset type, not from a rate card. The engine’s cumulative commission counter is stitched across restarts and differenced at each session cut to give Fb.12

Gb=mi(Cb+qbMb−qb−1Mb−1),∑bGb=mi(∑bCb+qendMfinal),ab=Gb−FbLbbuy+Lbsell
G: gross P&L of a bucket. F: commission accrued in the bucket. a: net per-lot P&L, with lots counted on both sides. The day starts flat, so the first bucket’s opening term is zero.
Pseudo-code
position, prev_mark = 0, 0.0                 # the day starts flat
for bucket in (NIGHT, REOPEN_GAP, MORNING_1, MORNING_2, AFTERNOON):
    fills = fills_in(contract, bucket)       # the reopen gap has none
    cash = signed_cash(fills)                # sells positive
    position_now = position + net_lots(fills)
    gross[bucket] = multiplier * (cash
                                  + position_now * closing_mid(bucket)
                                  - position * prev_mark)
    position, prev_mark = position_now, closing_mid(bucket)

gross_day = sum(gross.values())              # telescopes to cash + final position at the last mid
net_per_lot = {b: (gross[b] - fees[b]) / lots_both_sides(b) for b in gross}
Pseudo-code. The five buckets for one contract, simplified.

The restart problem, and the stitch

The first version summed deltas of the engine’s own profit sweep, offsetting each counter drop. A closer look at those drops, and at the positions open across them, found what that still misses: the profit counters live only as long as one run of the engine. Each start sets every contract’s counters back to zero, and the new run does not include any position the old one still held. The position prints are scoped more narrowly still. Any day-level P&L read from these counters is therefore either stitched across restarts or incomplete.

Version two inverts the roles. Fills and marks are the measurement; the engine is the witness. A reset is detected where a contract’s cumulative lot counter decreases, which a counter that can only grow never does inside a run. The finished epoch’s final values are banked and the series continues. Commission has no mark-to-market component, so summing it across epochs with an offset loses nothing, and the stitched cumulative commission is what gets differenced at each session cut. The engine’s day P&L, summed over epochs, is kept only as the comparison figure: the gap between it and the rebuild is precisely the P&L of the positions held across a restart.

The blind spot. A counter drop cannot show a reset when the new run’s first reading already exceeds the old run’s last. The lot check is built to flag that very case.12

Alternatives considered.

  • Read the engine table directly. Incomplete across restarts, and silently so: nothing in the table says a restart happened.
  • Use the position prints as an independent end-of-day check. Their scope is narrower than a trading day, so no check is made against them.
  • Mark at settlement. Breaks contract-level comparability with the engine’s side of the reconciliation, which is marked at mid.
Pseudo-code
for contract, sweep in profit_sweeps.items():        # readings in time order
    fee_offset, banked_pnl, epochs = 0.0, 0.0, 1
    previous = None
    for reading in sweep:
        if previous and reading.lots < previous.lots:
            # a counter that can only grow went down: a new run began
            banked_pnl += previous.pnl               # bank the finished run's finals
            fee_offset += previous.fees
            epochs += 1
        stitched_fees[contract].append((reading.time, reading.fees + fee_offset))
        previous = reading
    engine_day_pnl[contract] = banked_pnl + previous.pnl
Pseudo-code. Epoch detection and commission stitching, simplified.

Verification design

Every check writes its result to a log; the report builder opens that log first and refuses a dirty one.5 Fills are exchange returns, so they are treated as ground truth and the engine’s counters are tested against them, never the reverse.

The lot check is restart-aware rather than lenient: a shortfall in the engine’s counters passes only if it is non-negative on both sides, falls on a contract whose counters reset, and stays within a small fixed tolerance. An engine that counted trades the fills never showed would fail. On the day analyzed it flagged a handful of lots traded just before a reset the counters could not show: their trading P&L is in the rebuild, which works from fills.12

Pseudo-code
log = read(verification_log)
if count_failures(log) != 0:
    stop("verification not clean: refuse to build the report")
assert abs(total_gross - total_fees - total_net) < rounding_tolerance
build_report(tables)
Pseudo-code. The gate, simplified: nothing after it runs on a log with a failure.
54 pass/fail checks, the bucket identities (true by construction, recorded for the audit trail) and a money reconciliation for every contract: zero failures. Source: the run’s verification log.
CheckWhat it assertsResult
V1 · lotsFills equal the engine’s cumulative buy and sell counters summed across restart epochs, per contractPass on every contract; one small shortfall flagged and traced
V2 · multiplierThe contract multiplier inferred from the engine’s traded amounts over the fills’ cash equals the exchange multiplier to 1 part in 10,000Pass on every contract with complete lot counts
V3 · moneyRebuilt net P&L against the engine’s epoch-summed net P&L, per contractEqual to the cent, contract by contract; each exception equals the restart carry to the cent
V4 / V5 · telescopingSession buckets add back to the day, per contract and for the total: an identity of the bucket design, recorded in the logPass, by construction
Marks coverageEvery traded contract has a mid at every session boundaryPass, no carried-forward mark needed
Report gateThe report builder runs only if the log shows zero failures, and re-asserts gross − fees = netReport built

What the report showed

In words: the cost of the obligation was far from evenly spread. It concentrated in particular sessions and contracts, and commission was a large part of it.7 The value of the attribution is the relative ordering: which cells are deep red and which are light, so obligation volume can be moved from the first to the second where the rules allow.

The desk’s figures are confidential. The table reads the same kinds of finding off the generated data set behind the charts and screens on this page.

Synthetic data. Illustrative values from the page’s generated data set, showing the kinds of finding the report states. The method is as built; the desk’s own figures are confidential.
FindingFigureReading
Commission share of the net loss32%A per-lot loss is not a trading loss until the two are split1
Commission share by productA 57%, B 22%, C 19%Two products with a similar cost per lot can lose for opposite reasons
Cost per lot by product (day’s average = 100)A 105, B 51, C 108The same obligation volume is not the same bill
Night session27% of the lots, 41% of the lossThe costliest session for all three products
Product B, day sessionsProfitable in 2 of 309:00–10:15 and 13:30–15:00 positive; 10:30–11:30 negative
Cheapest session for Products A and C10:30–11:30: 38% and 70% of the night cost per lotIt carries 17% of the lots, so how much obligation it can absorb depends on book activity13
Contracts in profit on the day1 of 21A loss on the day’s own trades is normal for a market maker1
Thin cells12 of 84 flagged †Under 30 lots: displayed, never read as a finding

Limits, stated plainly

  • One day. Cells under 30 lots are flagged in the report and are not findings. The pipeline re-runs on any day’s archive; the ranking should be read across more days before volume is moved.
  • Relative, not absolute. Exchange fee reductions and market-maker incentives sit outside the engine logs, so the map ranks contracts and sessions against each other; it does not state the desk’s full economics.
  • It ranks, it does not prescribe. An obligated market maker cannot simply stop quoting a costly session. Turning the ranking into an allocation needs the obligation figures as constraints.10
  • Capacity. A cheap session is often a thin one. The upper bounds uis in the program above are an empirical question about book depth by session.

Built with

  • Python (standard library only)
  • P&L attribution
  • Options market making
  • Market microstructure
  • Mark-to-market accounting
  • Reconciliation
  • Streaming log ETL (2.58 GB, 16.7M lines)
  • Regular expressions
  • Data pipelines
  • Data lineage (file and line per row)
  • Data-quality gates
  • Automated verification
  • Constrained optimization (problem framing)
  • Data visualization

07Releases

Shipped in versions, like a product.

  1. Report, net of feesEngine logs parsed; P&L rebuilt from fills and session-boundary marks because the engine’s counters are scoped to a single run; verification clean; per-contract and per-session report delivered the same evening.
  2. Gross-of-fees reconciliation editionA second edition gross of fees for comparison with a colleague’s independent run, and the contract ranking split into one chart per product. Ready eleven minutes after the first report.
  1. 1A loss on the day’s own trades is normal for an exchange market maker: commissions here are the engine’s computed fees before market-maker fee reductions, and exchange incentives sit outside the engine logs. The analysis measures the relative cost of contracts and sessions, not the desk’s overall economics.
  2. 2The engine’s per-contract counters can only grow within one run, so a drop marks the start of a new run: the counters begin again from zero and do not include positions carried in. The first chart under Evidence shows the mechanism on synthetic data.
  3. 3One trading day of SHFE copper, gold and silver options: 2.58 GB of engine logs, 16.7 million lines, parsed in one streaming pass with zero parse errors.
  4. 4Shuo set the objective, the two dimensions of the report, the reconciliation edition and the chart design, and built the pipeline. A colleague ran an independent check of the same day in parallel.
  5. 5The run’s verification log holds 54 pass/fail checks (lot counts against the engine and contract-multiplier checks), the bucket identities, which hold by construction and are recorded for the audit trail, and a money reconciliation against the engine for every contract. Zero failures. The report cannot be built from a log with a failure.
  6. 6Per-contract net P&L rebuilt from fills and session-boundary mid prices, compared with the engine’s own profit counters summed across restart epochs. The two agree to the cent contract by contract; each of the few exceptions differs by precisely the P&L of the position held across a restart, which a restarted run’s counters do not include.
  7. 7The findings describe one trading day’s own trades: cash flow of the day’s fills plus positions marked at the order-book mid, with lots counted on both sides. Cells with fewer than 30 lots are flagged in the report. One day is a thin sample; the pipeline is built to re-run on each day’s archive.
  8. 8Commission as computed by the trading engine, before market-maker fee reductions, set against the net loss on the day’s own trades. The split charted on this page uses synthetic data.
  9. 9Seven minutes from specification to the finished edition, which was ready eleven minutes after the first report.
  10. 10The exchange obligation figures had not been supplied when the report was delivered, so the analysis ranks contracts and sessions and does not yet solve the allocation.
  11. 11Charts, 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.
  12. 12A reset is found as a drop in a counter that can only grow, so it is invisible when the new run’s first reading already exceeds the old run’s last. The restart-aware lot check exists for that case: it flags the lots traded before such a reset, whose trading P&L is in the rebuild from fills. Their fees are absent from the rebuild and from the engine-side figure alike, an amount too small to change any figure in the report.
  13. 13From the generated data set. A cheap session that carries a small share of the lots has untested capacity to absorb more volume: that is the upper bound u in the optimization above.
Previous
Previous

DCE Level-2 Receiver

Next
Next

CZCE Top Market-Maker Study