Expand description
Bidirectional mapping between Nautilus InstrumentId and Lighter market_index.
Lighter identifies markets by a 16-bit market_index (perpetuals occupy
0..=254, spot markets 2048..=4094). The mapping is populated at
bootstrap from GET /api/v1/orderBookDetails and subsequently consulted
on every WebSocket frame and outbound transaction.
Structs§
- Market
Registry - Registry mapping
market_indextoInstrumentIdand back.
Constants§
- PERP_
SUFFIX - Suffix applied to perpetual instrument symbols on the Nautilus side.
- SPOT_
SUFFIX - Suffix applied to spot instrument symbols on the Nautilus side.
Functions§
- format_
instrument_ id - Builds a Nautilus [
InstrumentId] from a venue symbol and product type. - format_
venue_ symbol - Returns the venue-native symbol for an instrument id by stripping any known product suffix. Returns the raw symbol unchanged when no suffix is present.
- product_
type_ from_ instrument_ id - Returns the
LighterProductTypeimplied by the instrument id’s suffix, orNoneif the symbol carries neither suffix.