Add OrderBook class and WebSocket integration for market data streaming

This commit is contained in:
Nawaz Haider
2026-01-01 19:54:32 +06:00
parent e28202828e
commit 1035b69eb6
3 changed files with 316 additions and 0 deletions
+7
View File
@@ -1,7 +1,9 @@
import time
import asyncio
from utils.logger import setup_logging
from utils.tokens import fetch_tokens
from utils.clob_client import init_clob_client
from utils.orderbook import OrderBook
async def main():
@@ -10,6 +12,11 @@ async def main():
up_token, down_token, market_slug = await fetch_tokens()
client = await init_clob_client()
book = OrderBook(up_token, down_token, market_slug)
book.start()
while True:
await asyncio.sleep(10)
if __name__ == "__main__":