Skip to main content

Module parse

Module parse 

Source
Expand description

Conversion functions 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.
bybit_interval_to_bar_spec
Converts a Bybit kline interval string to a Nautilus bar aggregation and step.
deserialize_decimal_or_zero
Deserializes a Decimal from a string field that might be empty.
deserialize_optional_decimal_or_zero
Deserializes a Decimal from an optional string field, defaulting to zero.
deserialize_optional_decimal_str
Deserializes an optional Decimal from a string field.
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_book_level
parse_fill_report
Parses a Bybit execution into a Nautilus FillReport.
parse_funding_rate
Parses a REST funding payload into a [FundingRateUpdate].
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 [CryptoOption].
parse_order_status_report
Parses a Bybit order into a Nautilus OrderStatusReport.
parse_orderbook
Parses an order book response into [OrderBookDeltas].
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].