mr.piron.Back to the research desk
QUANTITATIVE SYSTEMS

A fill ledger that survives duplicate, reordered and replayed execution reports

A fill ledger that keeps the highest revision of each execution depends only on the set of reports received and is correct when that set is complete. A synthetic order with one correction illustrates this.

TECHNICAL RESEARCHResearch8 primary sources2,957 words
MR. PIRON / RESEARCH DESK14 min read
01020304050607080912345678ARTICLE, IN READING ORDER →↑ NUMBERED SOURCES01020304050607080912345678ARTICLE, IN READING ORDER →↑ NUMBERED SOURCES01020304050607080912345678ARTICLE, IN READING ORDER →↑ SOURCES
FIG. 0 EVIDENCE MAP · 9 SECTIONS · 8/8 SOURCES CITED · 11 CITATIONS · 8 EQUATIONS · 1 CODE LISTINGComputed from this article. Each bar is a section, as long as its share of the words. A curve joins a passage to a source it cites; a circle grows with the number of passages that cite it. Diamonds mark equations and squares mark code.
Sources cited, equations and code listings per section
SectionSources citedEquationsCode listings
1. A ledger whose state depends on executions, not deliveriesnone00
2. What broker documentation says a report carries1, 2, 3, 4, 500
3. Four ledgers written as folds over a streamnone30
4. Why the keyed merge ignores order and repetition620
5. The reconciliation break and its price in basis pointsnone30
6. A worked example over 2,184 delivery streamsnone01
7. When a break is real and what a replay repairs2, 5, 700
8. Validation by fault injection and a reproduction recordnone00
9. Assumptions and limitations of the keyed ledger1, 800

01 /A ledger whose state depends on executions, not deliveries

An execution adapter learns of fills from a stream of reports. This article designs its ledger for a stream that repeats a report, changes the order, or carries a correction of an earlier execution. It shows that a fill ledger keyed by execution, keeping the highest revision of each key, makes position and arrival-price shortfall functions of the set of reports received. When every report has been received, they equal the broker's own totals. Three simpler ledgers each fail on a nameable fault. Adding every report fails on a duplicate or a correction, and deduplicating by full identifier fails on a correction that arrives under a new identifier. Trusting the last cumulative quantity is right only when the report that arrives last carries the final total.

The keyed ledger also gives a reconciliation break a precise meaning and a price, which matters to transaction cost analysis because a cost report is computed from the ledger and inherits its errors. Taking the broker's record as complete and current, internal position can differ from it only through a missing execution, a missing correction or an execution that belongs elsewhere. Each moves measured shortfall by a closed-form amount. On the synthetic order used here, a lost fill of 120 shares, bought below the deadline mark, leaves a break of −120-120 shares and overstates shortfall by 2.4 basis points.

All numbers come from one Python program on synthetic reports, and no broker is contacted. The statement for arbitrary streams rests on a short algebraic argument, which the enumeration of 2,184 delivery streams exercises and does not replace.

02 /What broker documentation says a report carries

Interactive Brokers documents an execution object with an identifier, the number of shares filled, a price that excludes commissions, a cumulative quantity and an average price. Each partial fill has a separate identifier, and the client's order number may not be unique within an account. A flag indicates that the execution price may be changed [1].

The same broker's guide to execution details adds two behaviors. A correction is received as an additional callback, described as identical in every parameter except the identifier, which differs from the earlier one only in the digits after the final period. The example given is an identifier ending in .02 that corrects one ending in .01. Executions can also be requested on demand. With an empty filter the request returns all previous executions, and by default it delivers those that occurred since midnight for the account [2]. The guide does not say what a correction changes, and a correction that changes a share count, as in the worked example here, is an assumption, not documented behavior.

Order-level messages are a separate channel. The order status callback reports the filled and the remaining quantity of an order each time the order changes, and the documentation remarks that duplicate order status messages are frequent [3].

Alpaca's trade update stream sends fill and partial fill events that carry the price and the number of shares of that event and the total position after it. Its example message also carries an execution identifier [4]. The account activities interface lists a fill with an activity identifier, the quantity of the execution, a cumulative quantity and the quantity left to be filled [5].

None of the five pages read for this article states that reports arrive exactly once or in the order sent. None describes a duplicated or reordered execution report either: both are faults that the ledger of the next section is designed to tolerate, not documented behavior. The one documented repeat of an execution report is the on-demand request.

03 /Four ledgers written as folds over a stream

Fix one parent order with side dd, +1+1 for a buy and −1-1 for a sell, quantity QQ in shares, arrival price p0p_0 and deadline mark pTp_T in USD per share. A report is r=(k,v,q,p)r = (k, v, q, p): an execution key kk, a revision number vv, a share count q≥0q \ge 0 and a price pp. A stream s=(r1,…,rn)s = (r_1, \dots, r_n) lists reports in the order received, and U(s)U(s) is the set of distinct reports in it. Report ii also carries Fˉi\bar F_i, the broker's cumulative filled quantity when the report was sent.

Under the Interactive Brokers convention of the previous section, the part of an identifier before its final period can serve as kk and the digits after it as vv. That mapping is this article's reading of the documented example, not a rule the documentation states.

Three simple ledgers are folds that return a filled quantity. The additive ledger sums the shares of every report, the identifier ledger sums over distinct reports, which removes exact repeats, and the cumulative ledger keeps the broker's total from the last report received. Cash is tracked the same way, from q pq\,p and from a cumulative cash stamp.

Filled quantity of the three simple ledgersEQ. 3.1
Fadd(s)=∑i=1nqi,Fid(s)=∑r∈U(s)qr,Fcum(s)=FˉnF_{\mathrm{add}}(s) = \sum_{i=1}^{n} q_i, \qquad F_{\mathrm{id}}(s) = \sum_{r \in U(s)} q_r, \qquad F_{\mathrm{cum}}(s) = \bar F_n

qiq_i is the share count of the ii-th report received, qrq_r that of a distinct report rr, and Fˉn\bar F_n the broker's cumulative quantity stamped on the last report received.

The keyed ledger is a map LL from execution keys to rows (v,q,p)(v, q, p). Merging a report replaces the row of its key only when the key is new or the report's revision is higher. The ledger of a stream, L(s)L(s), is the empty map with every report of ss merged in turn. Filled quantity FF, gross cash AA and signed position NN are sums over the rows that survive.

Merge of one report into the keyed ledgerEQ. 3.2
L⊕(k,v,q,p)={L [ k↦(v,q,p) ]if k∉dom⁡L  or  v>vL(k),Lotherwise.L \oplus (k, v, q, p) = \begin{cases} L\,[\,k \mapsto (v, q, p)\,] & \text{if } k \notin \operatorname{dom} L \ \text{ or } \ v > v_L(k), \\ L & \text{otherwise.} \end{cases}

dom⁡L\operatorname{dom} L is the set of keys the ledger holds and vL(k)v_L(k) the revision stored for key kk. The bracket replaces the row of kk and leaves every other row as it is.

Filled quantity, gross cash and signed positionEQ. 3.3
F(L)=∑k∈dom⁡LqL(k),A(L)=∑k∈dom⁡LqL(k) pL(k),N(L)=d F(L)F(L) = \sum_{k \in \operatorname{dom} L} q_L(k), \qquad A(L) = \sum_{k \in \operatorname{dom} L} q_L(k)\, p_L(k), \qquad N(L) = d\, F(L)

qL(k)q_L(k) and pL(k)p_L(k) are the shares and price stored for key kk. FF is in shares, AA in USD, and NN is positive for a buy and negative for a sell.

04 /Why the keyed merge ignores order and repetition

Two properties of the merge carry the argument. Merging two reports in either order gives the same ledger, and merging a report a second time changes nothing. Both follow from the rule. For each key the ledger holds the row of highest revision among the reports merged so far, and a maximum depends neither on the order of its arguments nor on their repetition.

Merges commute and repeat without effectEQ. 4.1
(L⊕r)⊕r′=(L⊕r′)⊕r,(L⊕r)⊕r=L⊕r(L \oplus r) \oplus r' = (L \oplus r') \oplus r, \qquad (L \oplus r) \oplus r = L \oplus r

The identities hold for every ledger LL and all reports rr and r′r', provided two reports with the same key and revision are the same report.

Any stream can be turned into any other stream with the same distinct reports by swapping neighbors and by inserting or deleting an adjacent repeat. Neither step changes the result, so the ledger is a function of U(s)U(s) alone. This is the standard argument for updates that commute and are idempotent.

Keyed ledger as a function of the report setEQ. 4.2
L(s)(k)=(vmax⁡,q,p)where(k,vmax⁡,q,p)∈U(s),vmax⁡=max⁡{ v:(k,v,q′,p′)∈U(s) for some q′,p′ }L(s)(k) = (v_{\max}, q, p) \quad \text{where} \quad (k, v_{\max}, q, p) \in U(s), \qquad v_{\max} = \max \{\, v : (k, v, q', p') \in U(s) \text{ for some } q', p' \,\}

For every key that occurs in the stream, the ledger holds the shares and price of its highest revision vmax⁡v_{\max}, the maximum over all reports of that key. The right-hand side mentions the stream only through its set of distinct reports.

The argument needs one assumption about the source: a pair (k,v)(k, v) names one immutable report, and the revisions of a key are totally ordered. If two different reports share a key and a revision, the rule keeps whichever arrived first, and order matters again.

A recent preprint on identity lifecycle events, a different domain, builds its reconciliation on the same two layers: a stable identifier for the logical fact and an immutable identifier for each physical record. It states permutation invariance, replay idempotence and revision dominance as properties of its method, and notes that permutation invariance alone does not establish semantic correctness [6].

The identifier ledger illustrates that last point for fills. It is also a function of U(s)U(s), so no reordering or repetition changes it. It differs from the keyed ledger on the same stream by the shares of every superseded revision it has received, because it counts two revisions of one execution as two executions. On a complete stream that surplus is its error.

05 /The reconciliation break and its price in basis points

Let LL be the internal ledger and L⋆L^{\star} the broker's own record of the order, with key sets KK and K⋆K^{\star}. By assumption the broker's record is complete and current: it holds the highest revision of every execution published, and every internal row is a report the broker sent. The break BB is internal position minus broker position, in signed shares. It splits into three parts: keys both sides hold with different quantities, keys only the broker holds, and keys only the internal ledger holds.

The break and its three partsEQ. 5.1
B=N(L)−N(L⋆)=d[∑k∈K∩K⋆(qL(k)−qL⋆(k))−∑k∈K⋆∖KqL⋆(k)+∑k∈K∖K⋆qL(k)]B = N(L) - N(L^{\star}) = d \left[ \sum_{k \in K \cap K^{\star}} \big( q_L(k) - q_{L^{\star}}(k) \big) - \sum_{k \in K^{\star} \setminus K} q_{L^{\star}}(k) + \sum_{k \in K \setminus K^{\star}} q_L(k) \right]

With the broker's record taken as current, the first sum collects stale revisions, the second executions the internal ledger never received, the third executions that the broker does not attribute to this order.

An earlier article in this journal, "Execution research that reconciles: quantities, costs and decision clocks", set out the convention used here for arrival-price implementation shortfall. Fills are measured against the arrival price p0p_0, the unfilled remainder is marked at the deadline price, and the side sign makes a cost positive. That article writes FF for fees. Here FF is the filled quantity and fees are left out, so the shortfall is a function of the ledger totals FF and AA only.

Arrival-price shortfall of a ledger stateEQ. 5.2
C(F,A)=d [ A−F p0+(Q−F) (pT−p0) ],Cbps=104 CQ p0C(F, A) = d\, \big[\, A - F\, p_0 + (Q - F)\,(p_T - p_0) \,\big], \qquad C_{\mathrm{bps}} = \frac{10^{4}\, C}{Q\, p_0}

CC is in USD. A−F p0A - F\,p_0 is, before the side sign, the cost of the fills against the arrival price, and (Q−F)(pT−p0)(Q - F)(p_T - p_0) marks the unfilled remainder at the deadline price.

Subtract the shortfall of the broker's record from the shortfall of the internal ledger. The arrival price cancels, and the error is the signed cash difference minus the break valued at the deadline mark. For one surplus row of qq shares at price pp the error is d q (p−pT)d\,q\,(p - p_T), and for a missing row the sign flips. A stale row counts as a surplus of the old row and a deficit of the new one.

Shortfall error caused by a ledger differenceEQ. 5.3
ΔC=C(F,A)−C(F⋆,A⋆)=d (A−A⋆)−pT B,ΔCbps=104 ΔCQ p0\Delta C = C(F, A) - C(F^{\star}, A^{\star}) = d\,(A - A^{\star}) - p_T\, B, \qquad \Delta C_{\mathrm{bps}} = \frac{10^{4}\, \Delta C}{Q\, p_0}

Starred totals belong to the broker's record. The identity uses B=d (F−F⋆)B = d\,(F - F^{\star}). One surplus row of qq shares at price pp gives ΔC=d q (p−pT)\Delta C = d\,q\,(p - p_T).

Two consequences of the identity separate the two measurements. A fill lost at exactly the mark price leaves a break and no cost error. A lost correction that changes only a price leaves no break and a cost error equal to the signed cash difference. A zero break is therefore no evidence that the cost figure is right.

06 /A worked example over 2,184 delivery streams

The parent is a buy of 1,000 shares with arrival price 50.00 and deadline mark 50.30, all prices in USD per share. The broker reports four executions: 300 shares at 50.02, 200 at 50.05, 200 at 50.10 and 120 at 50.20. On the plain day that is all, and 820 shares are filled. On the amended day a second revision corrects the third execution to 150 shares at the unchanged price before the last fill is sent. Then 770 shares are filled and the true shortfall is 24.8 basis points.

Two features of the amended day are constructions of the example and not documented behavior. The correction changes a share count. The synthetic broker stamps each report with cumulative shares and cash, restated after the correction. The documentation of the second section has a cumulative quantity and an average price. No page read documents a cumulative cash amount or says how the cumulative quantity behaves after a correction, and the cumulative ledger's counts on the amended day depend on that restatement.

For each day the program builds every delivery order of the reports, and every order with one report delivered twice. That gives 24 and 240 streams for the plain day, 120 and 1,800 for the amended day, 2,184 in all. A ledger counts as right on a stream when its final shares and cash both equal the broker's.

The additive ledger is right on the 24 plain orders and on no other stream. The identifier ledger is right on every plain stream, with or without a duplicate, and on no amended stream. The cumulative ledger is right on 6 of 24 and 60 of 240 plain streams and on 24 of 120 and 360 of 1,800 amended streams. Those are exactly the streams whose last report is the last one the broker sent. The keyed ledger is right on all 2,184. These counts belong to this example: two days, one correction, at most one duplicate per stream.

One obvious repair of the cumulative ledger, keeping the largest total seen instead of the last, is not run by the program, and this example would not separate it from the keyed ledger. Every stream here contains every report, and the last fill of 120 shares exceeds the 50-share reduction made by the correction, so the final total is also the largest. That variant fails when a correction lowers the total after the last fill. Even when right, a total holds no rows and cannot say which execution a break belongs to.

Three damaged ledgers of the amended day are priced against the truth. A keyed ledger that never receives the 120-share fill has a break of −120-120 shares and a shortfall 2.4 basis points too high, because it marks at 50.30 the shares that were bought at 50.20. A keyed ledger that never receives the correction has a break of 50 shares and a shortfall 2.0 basis points too low. Since the correction leaves the price unchanged, the stale row amounts to 50 surplus shares at 50.10, below the mark. The identifier ledger on the complete stream has a break of 200 shares and a shortfall 8.0 basis points too low. After a full in-order replay of the amended day, the additive ledger holds 1,940 shares for a 1,000-share parent.

python60 LINES EXECUTED · PYTHON 3.12.3 · 9 ASSERTS PASSED
# Synthetic unit-check fixture; illustrative only, no live market data or performance claims.
from fractions import Fraction
from functools import reduce
from itertools import combinations, permutations
from math import factorial
Q, SIDE, usd = 1000, 1, lambda x: Fraction(str(x))  # a buy
P0, PT = usd(50.00), usd(50.30)  # arrival, deadline mark (USD/share)
FILLS = [("a", 1, 300, usd(50.02)), ("b", 1, 200, usd(50.05)), ("c", 1, 200, usd(50.10)),
    ("c", 2, 150, usd(50.10)), ("d", 1, 120, usd(50.20))]  # key, revision, shares, price
def merge(book, report):  # highest revision per key wins
    kept = book.get(report[0])
    return book if kept and kept[1] >= report[1] else {**book, report[0]: report}
def state(rows):  # (shares, cash); raw stream: additive ledger
    return sum(r[2] for r in rows), sum(r[2] * r[3] for r in rows)
keyed = lambda s: state(reduce(merge, s, {}).values())  # fold of the merge
by_ident = lambda s: state(set(r[:4] for r in s))  # one row per (key, revision)
last_cum = lambda s: s[-1][4:]  # last cumulative pair
emit = lambda fills: [f + keyed(fills[:i + 1]) for i, f in enumerate(fills)]  # restated stamps
bps = lambda amount: 10000 * amount / (Q * P0)  # USD to bps of notional
def cost(filled, paid, side=SIDE, pt=PT):  # shortfall, rest at the mark
    return bps(side * (paid - filled * P0 + (Q - filled) * (pt - P0)))
def gap(got, true):  # break, shortfall error, error by the identity
    brk, cash = SIDE * (got[0] - true[0]), SIDE * (got[1] - true[1])
    return brk, cost(*got) - cost(*true), bps(cash - PT * brk)
extra = lambda q, p: (SIDE * q, 10000 * SIDE * q * (p - PT) / Q / P0)  # q surplus shares at p
def orders(day):  # all orders; all with one report twice
    return [set(permutations(day)), set(s for r in day for s in permutations(day + [r]))]
plain, amended = emit(FILLS[:3] + FILLS[4:]), emit(FILLS)  # without, with the correction
true_plain, truth = state(FILLS[:3] + FILLS[4:]), state(FILLS[:2] + FILLS[3:])
cells = [(ss, t, day) for day, t in ((plain, true_plain), (amended, truth)) for ss in orders(day)]
sizes = [len(c[0]) for c in cells]
ledgers = {"additive": state, "by_identifier": by_ident, "last_cumulative": last_cum,
    "keyed": keyed}
right = {k: [sum(ledgers[k](s) == t for s in ss) for ss, t, day in cells] for k in ledgers}
books = [reduce(merge, sub, {}) for n in range(6) for sub in combinations(amended, n)]
lost, stale = [r for r in amended if r[0] != "d"], [r for r in amended if r[:2] != ("c", 2)]
cases = [gap(keyed(lost), truth), gap(keyed(stale), truth), gap(by_ident(amended), truth)]
old, new, late = FILLS[2:]
assert plain[-1][4:] == true_plain and amended[-1][4:] == truth
assert sizes == [factorial(n) * m for n in (len(plain), len(amended))
    for m in (1, n * (n + 1) // 2)] and len(books) == 2 ** len(amended)
assert all(merge(merge(b, x), y) == merge(merge(b, y), x) and merge(merge(b, x), x) == merge(b, x)
    for b in books for x in amended for y in amended)
assert right["keyed"] == sizes and right["by_identifier"] == sizes[:2] + [0, 0]
assert right["additive"] == sizes[:1] + [0, 0, 0]
assert all((last_cum(s) == t) == (s[-1] == day[-1]) for ss, t, day in cells for s in ss)
assert [c[:2] for c in cases] == [extra(-late[2], late[3]), extra(old[2] - new[2], old[3]),
    extra(old[2], old[3])] and all(c[1] == c[2] for c in cases)
assert cost(truth[0], 2 * P0 * truth[0] - truth[1], -1, 2 * P0 - PT) == cost(*truth)
assert keyed(lost + amended) == keyed(stale + amended) == truth
out = {"streams_per_cell": sizes, "streams": sum(sizes), "merge_checks": len(books) * 25,
    "filled_plain": true_plain[0], "filled": truth[0], "shortfall_bps": float(cost(*truth))}
for k in ledgers:
    out["right_" + k] = right[k]
for k, case in zip(("lost_fill", "lost_correction", "by_identifier"), cases):
    out[k + "_break"], out[k + "_error_bps"] = case[0], float(case[1])
out["replay_additive_filled"] = state(amended + amended)[0]
for k in out:
    print(f"RESULT {k} = {out[k]}")
print("OK")
CAPTURED OUTPUT18 LINES · 9 ASSERT STATEMENTS, 9 EVALUATIONS PASSED · RUN NOV 14, 2026 · SHA-256 2bbdf1cb4ab3…
RESULT streams_per_cell = [24, 240, 120, 1800]
RESULT streams = 2184
RESULT merge_checks = 800
RESULT filled_plain = 820
RESULT filled = 770
RESULT shortfall_bps = 24.8
RESULT right_additive = [24, 0, 0, 0]
RESULT right_by_identifier = [24, 240, 0, 0]
RESULT right_last_cumulative = [6, 60, 24, 360]
RESULT right_keyed = [24, 240, 120, 1800]
RESULT lost_fill_break = -120
RESULT lost_fill_error_bps = 2.4
RESULT lost_correction_break = 50
RESULT lost_correction_error_bps = -2.0
RESULT by_identifier_break = 200
RESULT by_identifier_error_bps = -8.0
RESULT replay_additive_filled = 1940
OK

Standard output of the program above, captured when it was run in the journal's sandbox on Nov 14, 2026. The SHA-256 of the program text shown here equals the hash stored with that run. All inputs are synthetic.

07 /When a break is real and what a replay repairs

A break seen during the day has two readings: a report is gone, or it has not arrived yet. A recent preprint on streaming reconciliation of payments, a different domain, makes that distinction formal. Its contract makes a break verdict admissible only relative to a lateness bound declared for each source. Until the event time of the reported item plus a settlement window plus the silent source's bound has passed, that source's silence is not evidence [7].

As a design rule for fills, and not as a finding of that preprint, a break that points to a missing report stays provisional until a lateness bound declared by the operator has passed. Nothing in the program estimates that bound.

A deterministic fallback, as a design, is to request the day's executions again and merge them, holding new orders meanwhile. It repairs a break only if the replay carries the missing report, and it presumes that the request returns every execution and correction under the identifier the stream used, which the guide does not state. With the keyed ledger the request is safe to repeat, because a replay cannot alter a row held at the same or a higher revision. In the example, merging a full replay of the amended day returns both damaged keyed ledgers to the true shares and cash.

The remedy has a window. Interactive Brokers states that its gateway is limited to executions from the current trading day since midnight. Executions of the last seven days can be requested once a trade log setting in its TWS application is adjusted [2].

In this article's reading, once the window of the interface in use has passed, a break has to be closed from another record. The pages read describe one such record, a history of account activities, for Alpaca only [5].

08 /Validation by fault injection and a reproduction record

An adapter test can inject the same faults where reports enter: repeat a report, swap a pair, withhold a fill, withhold a correction, replay the day. The expected ledger after each fault is known in advance.

For reproduction, the program draws no random number and prints exact rational results as decimals, so a rerun gives the same figures. One of its nine assert statements pins the enumeration. The stream counts must equal m!m! and m! m (m+1)/2m!\,m\,(m+1)/2 for a day of mm reports, and the merge checks must start from 252^5 ledgers, one per subset of the five amended reports. The other eight test these seven things and nothing more.

  • On both days, the broker's final cumulative stamps equal the shares and cash computed directly from the fill list.
  • Across the ledgers of 32 subsets of the amended reports and all 25 ordered pairs of reports, 800 combinations with repeats, merges commute and a repeated merge changes nothing.
  • The keyed ledger is right on every stream, the identifier ledger on every plain stream and no amended one, the additive ledger on the 24 plain orders only.
  • The cumulative ledger is right on a stream exactly when the last report received is the last one sent.
  • In the three damaged cases, break and error equal the one-row formula, and the error equals the signed cash difference minus the break at the mark.
  • For the true fills of the amended day, a sell with every price reflected about the arrival price has the same shortfall as the buy.
  • Merging a full replay into either damaged keyed ledger restores the true shares and cash.

09 /Assumptions and limitations of the keyed ledger

The invariance holds under the source assumption of the fourth section and not otherwise, and correctness on a complete stream also needs the broker's record to hold the highest revision of each execution. The corrected share count and the restated cumulative stamp are constructions of the example. Alpaca's execution identifier appears only in an example message, and the Alpaca pages read describe no correction of an execution, so the revision part of the key has no documented counterpart there.

The ledger detects less than it may seem to. A break says that executions are missing, stale or foreign, and not which. A zero break shows that positions agree with the broker's record, not that the record is right. FIDES-Live, an audit protocol for trading agents driven by language models with local paper execution, states a limit of the same kind. It reconstructs cash and positions from the account before execution and the recorded filled orders. Its authors say that this reconciliation shows internal agreement with recorded fills and marks and does not attest exchange execution [8].

The cost side is narrower than a production transaction cost analysis. Fees are left out, and since the documented execution price excludes commissions [1], a full cost ledger needs the commission record as well. The damaged cases are priced for the buy only, and no correction that changes a price is run. The example contains no canceled execution, and treating one as a correction to zero shares would be a further assumption.

The enumeration is small by design. For the five amended reports, streams with more than one duplicate are covered by the merge properties tested on every subset ledger, and for other reports only by the algebraic argument. No foreign execution is run, and no stream with two different reports under one key and revision. Several orders sharing one position, or positions carried over from earlier days, are outside the example.

∎

Research is complete only when the assumptions, experiment, and limitations can be reconstructed.

This perspective is research commentary. It does not constitute investment advice or evidence of live strategy performance. Experimental methods require project-specific testing. Equations and code illustrate research formulations, not measured live returns.

More perspectivesExplore the engineering atlas