Skip to main content

Module markets

Module markets 

Source
Expand description

What is listed and what it trades at: perps, spot, HIP-3 dexes and HIP-4 outcomes; books, candles, trades, mids and funding.

Re-exports§

pub use dex::Dex;
pub use dex::split_coin;
pub use reads::Candle;
pub use reads::Interval;
pub use reads::L2Book;
pub use reads::Level;
pub use reads::MarketTrade;
pub use reads::Mids;
pub use reads::Precision;
pub use reads::UnknownInterval;
pub use side::Side;

Modules§

book
l2Book: a market’s visible book, the same shape from /info and from the socket. Prices and sizes are exact Dec values read from the venue’s strings.
candle
Candles and their intervals, the same shape from candleSnapshot and from the candle feed.
context
Asset contexts: what a market is doing now. PerpCtx for a perp on any dex, SpotCtx for a spot pair or an outcome side, each the same shape from /info and from the socket.
dex
Which perp dex a read or a coin is about: a request without dex is the main dex’s, one with "dex":"xyz" that HIP-3 dex’s. A HIP-3 coin is dex:SYMBOL; its asset id is Asset::hip3.
dexes
HIP-3 builder-deployed perp dexes: the dex list, each dex’s meta and contexts, limits and status.
mids
allMids: every coin’s mid on one perp dex, the same map from /info and from the socket.
outcomes
HIP-4 outcomes: coins, the price grid, outcomeMeta and templates in words, books, quotes, set scans, settlements.
perps
Perps on the main dex: meta and contexts, margin tables, order rules and funding.
reads
Market data every market kind shares: l2Book, candleSnapshot, recentTrades and allMids. A coin is BTC, xyz:XYZ100 on a HIP-3 dex, @107 or PURR/USDC for a pair, #14730 for an outcome side.
side
The side of an order, a fill, a trade or a book level: B and A on the wire, one type wherever the venue writes it.
spot
Spot: tokens, pairs and their contexts, and token details.
trades
A print: one trade on a market’s tape, the same shape from recentTrades and from the trades feed.