Developer documentation API v1
Liquidity and execution quality
Estimate tradable costs, then compare them with observed fills.
A quote is specific to size and time
liquidity.quote_curve evaluates explicit quantities for one instrument, side and venue against a common observation. Each point records executable or indicative status, fillable quantity, average price, fees included and expiry. Book sequence gaps invalidate executable book-derived estimates until resynchronization. Cross-venue comparison accounts for inventory, transfer, currency and settlement constraints.
Compare executable sizes
Illustrative sizes and age bound. A connection without a supported executable quoting route returns unsupported capability; historical bars never substitute for it.
{
"agent_revision_id": "agr_example_3",
"tool": "liquidity.quote_curve",
"input": {
"instrument_id": "equity:listing:apple-common-xnas",
"venue": "XNAS",
"side": "buy",
"quantities": [
{
"asset": "equity:listing:apple-common-xnas",
"atoms": "10",
"scale": 0
},
{
"asset": "equity:listing:apple-common-xnas",
"atoms": "50",
"scale": 0
}
],
"max_age_seconds": 5
}
}Spread and displayed imbalance
a and b are simultaneous best ask and bid in one venue and quote currency, with m>0. Quantities use the same base units. Empty depth makes imbalance undefined. Displayed imbalance is a liquidity descriptor; hidden liquidity, cancellations and venue selection limit its interpretation.
Cost decomposition
execution.cost_estimate uses the quote curve, urgency and pinned cost-model revision. It separates explicit fees, half-spread, modeled impact, delay and financing where applicable. Quote-included fees and impact are not charged again. Historical cost models retain calibration sample, venue, size regime and uncertainty; an equity model is not automatically transferable to a token pool.
Immediate and staged schedules have different fill risk. A participation constraint limits scheduled quantity relative to a declared volume estimate; it does not guarantee future volume or completion. A limit touched within a bar is not automatically filled. Queue position and latency require their own fill model.
Implementation shortfall with unfilled quantity
s=+1 for a buy and −1 for a sell, Q is intended quantity, P₀ the decision benchmark, q_j and P_j observed fills, and P_T the end-of-window benchmark for the remainder. All prices refer to the same instrument and currency. Positive IS is a cost. The unfilled term is an opportunity-cost convention, not booked P&L. A changed decision starts a new benchmark record.
Worked cost example
For a buy of 10 units with decision price $100, six units fill at $100.20. The four unfilled units are marked at $101 at the evaluation endpoint, and explicit fees are $0.50. Implementation shortfall is 6×$0.20 + 4×$1 + $0.50 = $5.70, or 57 basis points of the $1,000 intended notional. Of that amount, $4 is attributed opportunity cost on the unfilled remainder, not a cash charge.
Where implementation shortfall comes from
After the trade
execution.quality references the existing action, benchmark revision and measurement window. Its result separates fill price, fees, timing, unfilled quantity and reconciliation coverage. Live reports use venue fills. Paper reports retain the simulator revision and stay in their own evaluation mode. Differences between estimates and realized costs inform subsequent model evaluation without rewriting the original estimate.