OrderbookSource
The SDK’s depth boundary, and the counterpart of CandleSource. Every consumer of a book needs the same three things — symbol metadata, a snapshot, and a live subscription — so that is what a source provides.
import type { OrderbookSource } from "@symmio/trading-core";Hooks and the aggregation helpers are written against this interface, never against a specific venue. Implement it and everything downstream works unchanged.
Unlike most SDK actions, a source is not derived from Config. A reference exchange is not a SYMMIO chain
deployment, and which venue’s depth to show is your choice. Construct one and pass it in explicitly.
Fields
idstringStable identifier, used to scope query keys (e.g. "binance:usd-m-futures"). Two sources must never share one.
priceBasisOrderbookPriceBasisWhat the prices represent: "reference-exchange", "dex-pool", or "solver-mark". Surfaced deliberately — a
third-party venue’s depth is not what a SYMMIO trade executes against.
supportedLimitsreadonly number[]Depths the venue accepts for a snapshot, ascending. A venue taking a free-form limit reports its maximum as the single largest entry; one taking an enum reports every allowed value.
defaultLimitnumberDepth used when a caller does not pass limit.
Methods
getSymbol(marketName: string) => Promise<OrderbookSymbol | undefined>Resolve symbol metadata, or undefined when the source does not carry this market. This is the source’s own answer
to “do you have this market”, and the check to run before rendering.
getOrderbook(parameters: GetOrderbookParameters) => Promise<Orderbook>Fetch a point-in-time snapshot. See getOrderbook.
watchOrderbook(parameters: WatchOrderbookParameters) => UnwatchoptionalSubscribe to a continuously synchronized book. Absent when the source has no realtime feed, in which case a consumer
polls getOrderbook. See watchOrderbook.
OrderbookSymbol
What getSymbol resolves — everything a ladder needs before it can render.
marketNamestringMarket name as SYMMIO names it.
sourceSymbolstringThe same instrument in the source’s own namespace.
baseAssetstringBase asset (e.g. "BTC"), for a size column header.
quoteAssetstringQuote asset (e.g. "USDT"), for a price column header.
pricePrecisionnumberDecimal places prices should be rendered at.
sizePrecisionnumberDecimal places sizes should be rendered at.
tickSizenumberSmallest price increment the venue allows — the finest grouping a ladder can offer, and the base of the ladder
suggestOrderbookTickSizes builds.
Related
createBinanceOrderbookSource— the reference implementation.- Orderbook guide — writing against this interface.