Skip to main content

Module symbol

Module symbol 

Source
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§

MarketRegistry
Registry mapping market_index to InstrumentId and 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 LighterProductType implied by the instrument id’s suffix, or None if the symbol carries neither suffix.