Market Price Oracle



Last updated
Was this helpful?
Before every batch, Turbine determines a reference mid-price for each token pair. All orders and LP are offset from this price by the user-defined spread.
Cross-venue mid-price
The pair mid-price is the median of all valid per-venue prices. Turbine prunes outliers iteratively: at each step it removes the price furthest from the median while either condition below holds. It stops once neither holds, or once two prices remain.
Mean–median divergence: mean and median differ by more than mean_median_threshold (1%).
Individual deviation: some price is further from the median than max_price_deviation × median (0.1%).
A single batch snapshot makes the conversion easier to see: venue prices are placed around the final mid, off-market venues are pruned, and the median of the accepted prices becomes Turbine's batch mid-price.

Pause on invalid price: if fewer than min_valid (3) venues produce a fresh, non-outlier price for a pair, Turbine excludes all orders and LP on that pair from the current batch.

Per-venue prices
Turbine sources prices from live WebSocket order-book feeds: Binance, Bingx, Bitget, Coinbase, Hyperliquid, Kraken, Kucoin, Lighter, and Okx.

The per-token mid on a venue is built in two steps:
Depth-anchored mid per snapshot. For each book update, Turbine walks both sides until a target trade size (in the venue's quote currency) is consumed, then takes the midpoint of the worst bid and ask reached. This reflects the cost of trading at that size, not just the top-of-book spread. To remove sensitivity to a single size, Turbine samples 5 log-spaced sizes between $1,000 and the smaller of total bid/ask depth, and takes the median across them. Books with under $1,000 on either side are skipped.
Temporal median across recent snapshots. The depth-anchored mid is appended to a per-token buffer. The venue's reported price is the median of samples within the last 500 ms; if fewer than two samples are that recent, it falls back to the most recent sample. This smooths sub-second spoofing attempts on fast feeds while remaining usable for slower or stable ones.
A venue's pair price is rejected only if either leg lacks a fresh sample.
Last updated
Was this helpful?
Was this helpful?