subscribeToOrderBook method

void subscribeToOrderBook({
  1. required int depth,
  2. String symbol = '',
})

Fetches the orderbook with a depth of '25' or '200' orders per side. is at: https://bybit-exchange.github.io/docs/inverse/#t-websocketorderbook25

Implementation

void subscribeToOrderBook({required int depth, String symbol = ''}) {
  log.i('Subscribe to orderbook with depth : ' +
      depth.toString() +
      ' for the symbol: ' +
      symbol);
  if (depth == 25) {
    websocket.subscribeTo(
        topic: 'orderBookL2_' + depth.toString(), symbol: symbol);
  } else if (depth == 200) {
    websocket.subscribeTo(
        topic: 'orderBook_' + depth.toString() + '.100ms', symbol: symbol);
  }
}