Unified market ticker data.
Contains the latest price, volume, and spread information for a trading pair.
Fields
symbol- Unified symbol (e.g., "BTC/USDT")timestamp- Exchange timestamp in millisecondsdatetime- ISO 8601 datetime stringhigh,low- 24h high/low pricesbid,bid_volume- Best bid price and volumeask,ask_volume- Best ask price and volumevwap- Volume-weighted average price (ornilwhen the venue does not supply volume units that form a price — see caveats below)open,close,last- 24h open, close, and last trade pricesprevious_close- Previous 24h closechange,percentage- 24h absolute change and percentageaverage- Average of open and closebase_volume,quote_volume- 24h volume in base/quote currencyindex_price,mark_price- Derivatives index/mark pricesinfo- Raw exchange response
vwap caveat (carve C36)
vwap is a price. It is only populated when the venue's volume operands
are quote-notional over base-quantity (or the venue publishes a weighted
average price directly). Blind quoteVolume / baseVolume is not always a
price: on OKX SWAP/FUTURES, vol24h is contracts and volCcy24h is base
currency, so that ratio collapses to contract size (ctVal, e.g. 0.01 on
BTC-USDT-SWAP) rather than a ~mark price. We diverge from Bourse's
always-divide carve there and leave vwap nil; consumers needing contract
volume should read base_volume / quote_volume / raw info. See
docs/authored-specs.md carve C36.
Summary
Types
@type t() :: %Bourse.Ticker{ ask: number() | nil, ask_volume: number() | nil, average: number() | nil, base_volume: number() | nil, bid: number() | nil, bid_volume: number() | nil, change: number() | nil, close: number() | nil, datetime: String.t() | nil, high: number() | nil, index_price: number() | nil, info: map() | nil, last: number() | nil, low: number() | nil, mark_price: number() | nil, open: number() | nil, percentage: number() | nil, previous_close: number() | nil, quote_volume: number() | nil, symbol: String.t() | nil, timestamp: integer() | nil, vwap: number() | nil }
Functions
@spec schema() :: map()
JSON Schema for the Ticker unified type.