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 book::Book;
pub use book::Level;
pub use book::Precision;
pub use candle::Candle;
pub use candle::Interval;
pub use candle::UnknownInterval;
pub use dex::Dex;
pub use dex::split_coin;
pub use mids::Mids;
pub use side::Side;
pub use trades::Trade;

Modules§

book
l2Book: a market’s visible book, the same shape from /info and from the socket, and the precision it is asked at. Prices and sizes are exact Dec values read from the venue’s strings.
candle
Candles and their intervals, the same shape from the candleSnapshot read 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 (Dex::field). A HIP-3 coin is dex:SYMBOL; its asset id is Asset::hip3.
dexes
HIP-3 builder-deployed perp dexes: the dex list, every dex lined up with its meta, and each dex’s limits and status. A dex’s meta and contexts are crate::markets::perps’s.
mids
allMids: every coin’s mid on one perp dex, the same map from /info and from the socket.
outcomes
HIP-4 outcomes: coins and their asset ids, the price grid, orders on a side, outcomeMeta, templates and the descriptions written from them, books on the grid, and settlements.
perps
Perps on every dex, the main one and HIP-3 ones alike: meta and contexts, margin tables and funding.
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 the recentTrades read and from the trades feed.