liquidationStream method

Stream<WsLiquidationEvent> liquidationStream({
  1. required String symbol,
})

The Liquidation Order Snapshot Streams push force liquidation order information for specific symbol.

For each symbol,only the latest one liquidation order within 1000ms will be pushed as the snapshot. If no liquidation happens in the interval of 1000ms, no stream will be pushed.

Implementation

Stream<WsLiquidationEvent> liquidationStream({required String symbol}) {
  final channel = subscribe('${symbol.toLowerCase()}@forceorder');
  return channel.stream
      .map<Map>(toMap)
      .map<WsLiquidationEvent>((e) => WsLiquidationEvent.fromMap(e));
}