Spread crossing cost for an agent execution

By DX Research Group · · Execution mechanics

Measure the bid-ask component of execution cost with a declared reference price and quantity.

Declare the reference before calculating cost

Our calculation holds the reference price fixed so readers can separate the spread from later market movement.

Spread crossing cost describes the price paid for immediate access to the opposite side of an order book. For an agent evaluator, the important step is choosing and saving a reference before the execution. A favorable reference chosen afterward can make an ordinary fill appear unusually good.

Coinbase's matching-engine documentation explains that trades match against prices on resting orders. This supports a basic distinction: an aggressive limit price is a constraint, while the resulting execution price depends on available counterparties. The paid price comes from actual executions.

An illustrative top-of-book calculation

Consider a hypothetical bid of 99.90 and ask of 100.10, each with enough displayed size for one unit. The midpoint is 100.00. A one-unit immediate purchase at the ask costs 0.10 above that midpoint. In basis points, the buy-side cost is (100.10 / 100.00 - 1) times 10,000, or 10 basis points.

An immediate sale at 99.90 has the same midpoint-relative cost. Buying and immediately selling under an unchanged book loses 0.20 per unit before fees. The full spread is 20 basis points relative to the midpoint; a single crossing is half that spread in this symmetric example.

For ten units, those currency amounts become 1.00 per crossing and 2.00 for the hypothetical round trip, but only if the displayed liquidity can support the full size at those prices. These illustrative values describe arithmetic rather than an observed market.

Separate spread from other costs

If a ten-unit buy instead averages 100.18 because deeper ask levels are consumed, midpoint-relative price cost is 1.80. In a simple decomposition, 1.00 corresponds to crossing the initial half-spread and 0.80 to walking beyond the initial ask. A separate fee belongs in the cash ledger.

Subtracting the spread again from profit based on actual execution prices would double-count its effect. The fill prices already contain its effect. Cost decompositions explain a result; they should not invent additional cash movements.

Movement between decision time and arrival time is another component. Save both snapshots when available. A decision-midpoint comparison measures the combined experience of delay and execution. An arrival-midpoint comparison answers a narrower question about prices available when the instruction reached the venue.

A fixture an autonomous runtime can reproduce

Capture instrument, quantity units, bid, ask, timestamp, and reference convention. Calculate the expected price cost for each side. Include a wider book, insufficient top-level size, and a changed arrival midpoint as separate cases. Confirm that the same reference is used across candidate agents.

A venue may have hidden liquidity, price improvement, special matching rules, or different visibility for certain participants. Snapshot depth describes displayed opportunities with incomplete visibility into executable liquidity. Stale or crossed snapshots also need explicit handling before their midpoint enters an evaluator.

This narrow check helps distinguish model choices from execution conditions. Whether crossing was justified, waiting would have filled, or an agent predicts prices well requires separate evidence. Those questions need their own evidence and counterfactual assumptions.

Fit the receipt into the full trace

Our execution and settlement framework connects these mechanics to recorded outcomes. The operating-layer controls paper explains why the machinery around an agent deserves its own evaluation.

Sources

Related field notes