basana.external.binance.order_book

class basana.external.binance.order_book.PartialOrderBookEvent(when, order_book)

Bases: Event

An event for partial order book updates.

Parameters:
  • when (datetime) – The datetime when the event occurred. It must have timezone information set.

  • order_book (PartialOrderBook) – The updated order book.

order_book: PartialOrderBook

The order book.

class basana.external.binance.order_book.PartialOrderBook(pair, json)

An order book.

Parameters:
  • pair (Pair)

  • json (dict)

property asks: List[Entry]

Returns the top ask entries.

property bids: List[Entry]

Returns the top bid entries.

json: dict

The JSON representation.

property last_update_id: int

The last update id.

pair: Pair

The trading pair.

class basana.external.binance.order_book.Entry(price: decimal.Decimal, volume: decimal.Decimal)
Parameters:
  • price (Decimal)

  • volume (Decimal)

price: Decimal

The price.

volume: Decimal

The volume.