Skip to main content

Module parse

Module parse 

Source
Expand description

Conversion of CoinAPI WebSocket messages into Nautilus market data.

Instrument precisions come from CoinAPI data resolutions, which can lag the stream. A value with more decimal places than its instrument precision is rejected, except for bounded numeric tails in OHLCV volume.

Functionsยง

bar_spec_to_period_id
Returns the CoinAPI streaming period_id for a last-price bar specification.
parse_aggressor_side
Maps an exchange taker side to the aggressor side.
parse_bar
Converts a completed OHLCV period into an external last-price bar closing at time_period_end.
parse_book_deltas
Converts a full L2 book snapshot or update into deltas, taking ts_event from time_exchange and ts_init from time_coinapi.
parse_book_depth
Converts a fixed-depth book5, book20, or book50 message into its best depth levels per side, taking ts_event from time_exchange and ts_init from time_coinapi.
parse_quote_tick
Converts a best bid and ask, taking ts_event from time_exchange and ts_init from time_coinapi.
parse_trade_tick
Converts a trade, taking ts_event from time_exchange and ts_init from time_coinapi.
period_id_to_bar_spec
Returns the last-price bar specification for a CoinAPI streaming period_id.