Hi i am writing a trading bot and would like to be able to listen to multiple order-books however i am only getting depth cache updates for one currency. Is there something i am missing or do i need to write a pull request for this feature.
from binance.websockets import BinanceSocketManager
from binance.depthcache import DepthCacheManager
import gevent
from gevent.queue import JoinableQueue
client = Client("", "")
bm = BinanceSocketManager(client)
def depthUpdater(outChannel):
for pair in ["ETHUSDT", "BTCUSDT", "ETHBTC"]:
DepthCacheManager(client, pair, callback=(lambda x: outChannel.put(["orderBookUpdate", pair, x])), bm=bm)
while True:
gevent.sleep(0)
def printer(inChannel):
while True:
if not inChannel.empty():
print(inChannel.next())
gevent.sleep(0)
q = JoinableQueue()
gevent.joinall([
gevent.spawn(depthUpdater, q),
gevent.spawn(printer, q)
])```
Hi i am writing a trading bot and would like to be able to listen to multiple order-books however i am only getting depth cache updates for one currency. Is there something i am missing or do i need to write a pull request for this feature.