Rename class members in order_book.py and raw_order_book.py.

This commit is contained in:
Davide Casale
2022-12-02 18:57:21 +01:00
parent 52d007c05d
commit 8c9d52c186
2 changed files with 8 additions and 8 deletions

View File

@@ -8,7 +8,7 @@ from bfxapi.websocket.typings import Subscriptions, TradingPairBooks, TradingPai
class OrderBook(object):
def __init__(self, symbols: list[str]):
self.order_book = {
self.__order_book = {
symbol: {
"bids": OrderedDict(), "asks": OrderedDict()
} for symbol in symbols
@@ -20,15 +20,15 @@ class OrderBook(object):
kind = (amount > 0) and "bids" or "asks"
if count > 0:
self.order_book[symbol][kind][price] = {
self.__order_book[symbol][kind][price] = {
"price": price,
"count": count,
"amount": amount
}
if count == 0:
if price in self.order_book[symbol][kind]:
del self.order_book[symbol][kind][price]
if price in self.__order_book[symbol][kind]:
del self.__order_book[symbol][kind][price]
SYMBOLS = [ "tBTCUSD", "tLTCUSD", "tLTCBTC", "tETHUSD", "tETHBTC" ]