Expand description
Conversion helpers that translate Bybit API schemas into Nautilus instruments.
Functions§
- bar_
spec_ to_ bybit_ interval - Converts a Nautilus bar aggregation and step to a Bybit kline interval.
- deserialize_
decimal_ or_ zero - Deserializes a Decimal from a string field that might be empty. Handles Bybit’s edge case where empty string “” becomes Decimal::ZERO.
- deserialize_
optional_ decimal - Deserializes an optional Decimal from a string field.
Returns
Noneif the string is empty or “0”, otherwise parses toDecimal. - deserialize_
optional_ decimal_ or_ zero - Deserializes a Decimal from an optional string field, defaulting to zero. Handles Bybit’s edge cases: None, empty string “”, or “0” all become Decimal::ZERO.
- deserialize_
string_ to_ u8 - Deserializes a u8 from a string field.
- extract_
raw_ symbol - Extracts the raw symbol from a Bybit symbol by removing the product type suffix.
- get_
currency - Returns a currency from the internal map or creates a new crypto currency.
- make_
bybit_ symbol - Constructs a full Bybit symbol from a raw symbol and product type.
- parse_
account_ state - Parses a Bybit wallet balance into a Nautilus account state.
- parse_
fill_ report - Parses a Bybit execution into a Nautilus FillReport.
- parse_
inverse_ instrument - Parses an inverse contract definition into a Nautilus instrument.
- parse_
kline_ bar - Parses a kline entry into a
Bar. - parse_
linear_ instrument - Parses a linear contract definition (perpetual or dated future) into a Nautilus instrument.
- parse_
option_ instrument - Parses a Bybit option contract definition into a Nautilus option instrument.
- parse_
order_ status_ report - Parses a Bybit order into a Nautilus OrderStatusReport.
- parse_
position_ status_ report - Parses a Bybit position into a Nautilus PositionStatusReport.
- parse_
spot_ instrument - Parses a spot instrument definition returned by Bybit into a Nautilus currency pair.
- parse_
trade_ tick - Parses a REST trade payload into a
TradeTick.