Add orderbook ingestion scaffold for Binance & OKX (ETH/USDT) with Docker, uv, and tests - #1
Conversation
Code Review by 🤖 Claude Code · Sonnet 4.6🚫 BLOCK SummaryScaffold for real-time ETH/USDT orderbook ingestion from Binance and OKX using asyncpg, Pydantic v2, websockets, and Docker. Includes parsers, simulated data generator, DB storage, and unit tests. Critical IssuesOKX level unpacking will crash on real API data (
Fix: asyncpg JSONB insertion likely fails at runtime ( asyncpg requires JSONB column values to be passed as JSON-encoded strings by default, not raw Python lists/dicts. Warnings
New DB connection per insert ( Hardcoded credentials ( Double JSON round-trip ( Suggestions
Reviewed with Claude Code via Crosscheck |
Crosscheck-Reviewer: claude Crosscheck-Model: claude-sonnet-4-6 Crosscheck-Step: fix Crosscheck-Service: crosscheck
✅ Auto-fix appliedPushed Applied by Claude Code via Crosscheck. |
Recheck by 🤖 Claude Code · Sonnet 4.6✅ APPROVE Now I have a complete picture. The fix commit Issue 1 —
Issue 2 —
Issue 3 —
All three fixes are present and correct in the current PR diff. Reviewed with Claude Code via Crosscheck |
Motivation
Description
pyproject.tomland auv-friendly entrypoint script (orderbook_app.__main__:main).models.py) and parsers for Binance and OKX payloads (connectors/binance.py,connectors/okx.py) with a sharedparse_levelshelper.storage/db.py) that create theorderbook_updatestable and provideinit_db/insert_updateusingasyncpg, and wire a simulated ingest flow in__main__.pythat usesservices/simulated.py.Dockerfileto build a container usinguvanddocker-compose.ymlto startdb(Postgres) andapp, and document required REST/WebSocket endpoints and API permissions inREADME.md.Testing
tests/test_parsers.pythat validate Binance/OKX snapshot/update parsing and the simulated update generator; these are runnable withpytest.Codex Task