Expand description
Bidirectional mapping between Nautilus InstrumentId and Lighter market_index.
Lighter identifies markets by a 64-bit market_index. Legacy markets keep
their range-partitioned ids (perpetuals 0..=254, spot 2048..=4094);
markets listed after the September 2026 upgrade take the next free index
from 4095 for either product type, so product type must come from the
venue’s market_type field, never from the id. 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_
instrument_ id_ with_ venue - Builds a Nautilus [
InstrumentId] for a specific venue. - 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.