MCPcopy Create free account
hub / github.com/sammchardy/python-binance / handle_depth_cache

Function handle_depth_cache

examples/depth_cache_threaded_example.py:20–32  ·  view source on GitHub ↗
(depth_cache)

Source from the content-addressed store, hash-verified

18 dcm.start()
19
20 def handle_depth_cache(depth_cache):
21 if isinstance(depth_cache, dict) and depth_cache.get("e") == "error":
22 logger.error(f"Received depth cache error in callback: {depth_cache}")
23 type = depth_cache.get("type")
24 if type == "BinanceWebsocketClosed":
25 # Automatically attempts to reconnect
26 return
27 logger.error(f"Error received - Closing depth cache: {depth_cache}")
28 dcm.stop()
29 return
30
31 logger.info(f"symbol {depth_cache.symbol}") # type: ignore[union-attr]
32 logger.info(depth_cache.get_bids()[:5]) # type: ignore[union-attr]
33
34 dcm.start_depth_cache(handle_depth_cache, symbol="BNBBTC")
35 dcm.join()

Callers

nothing calls this directly

Calls 2

stopMethod · 0.80
get_bidsMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…