Sequence/docs

Monitoring & TCA

The pre- and post-trade analysis surface. Pre-trade: depth, slippage curves, routing recommendations. Post-trade: TCA (transaction cost analysis), nanosecond-precision lifecycle traces. Most endpoints return free-form JSON today — typed shapes land in v0.2; keep your parsing defensive (.get(..., default)).


Pre-trade: depth, slippage, routing

All three endpoints share the same cold-fallback chain as quote() and preview() — calling them on a cold ticker triggers a warming cycle so the response carries real data instead of empty arrays. No explicit quote() warm step needed.

rust
use sequence_sdk::Side;
 
let depth     = seq.depth("BTC-USD").await?;
let slippage  = seq.slippage("BTC-USD", Side::Buy).await?;
let routing   = seq.routing("BTC-USD", Side::Buy, 1.0).await?;
let intel     = seq.intel("BTC-USD").await?;
EndpointUse
depthL2 depth aggregated across every venue, book-side sorted
slippageSlippage curve at $1k / $10k / $100k / $1M notional. Same curve SOR uses internally
routingSOR's recommended leg-split for this exact order — same endpoint the kernel uses
intelMarket structure snapshot: per-venue market-share, spread regime, toxicity score, quote-to-trade ratio

Post-trade: TCA

Notional-weighted Transaction Cost Analysis aggregates from durable order history.

rust
let all  = seq.tca().await?;                          // cross-desk aggregate
let one  = seq.tca_symbol("BTC-USD").await?;          // per-symbol

Returns implementation_shortfall_bps, spread_cost_bps, market_impact_bps, savings_vs_benchmark_bps, savings_usd, weighted percentiles (p50/p75/p95/p99), and a TCA-quality provenance breakdown.

Prediction-market TCA fields

Every per-order TCA entry on prediction-market fills carries four extra fields. Branch on is_prediction before interpreting slippage — spot metrics are in price-bps, prediction metrics are in probability-bps. The two are not comparable.

FieldMeaning
is_predictiontrue for binary-outcome fills (Kalshi/Polymarket)
arrival_implied_prob_bpsArrival mid as implied probability bps (0.30 → 3000)
achieved_implied_prob_bpsAchieved VWAP as implied probability bps
probability_slippage_bpsSide-adjusted shift from arrival to achieved. Positive = moved against you

Streaming the same data

Most of these surfaces are also available as live-pushed channels — see Streaming for subscribe protocol:

RESTWS channel
tca aggregatetca (one event per completed order, full cost decomp)
routing recommendrouting (every SOR decision)
trace per-ordertraces:{deployment_id} (algo callback traces only)

Next steps