basana.external.bitstamp.order_book

class basana.external.bitstamp.order_book.OrderBookEvent(when, order_book)

Bases: Event

An event for order book updates.

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

  • order_book (OrderBook) – The updated order book.

order_book: OrderBook

The order book.

class basana.external.bitstamp.order_book.OrderBook(pair, json)
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.

pair: Pair

The trading pair.

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

  • volume (Decimal)

price: Decimal

The price.

volume: Decimal

The volume.