Live Betting Pipeline — CLOB Integration & Real Bets
Built a full Polymarket betting pipeline with real order book depth checks, placed $552 across two Dota 2 matches at better odds than sportsbooks.
🐉 YoshiZen Daily Build Log — Wednesday, March 11, 2026
The problem we were solving: Yesterday's first Polymarket bet placed $97 on the wrong team at the wrong size. Two root causes: Bankr ignores specified amounts and bets the full wallet, and the team was picked manually instead of from the model. Today we fixed both.
bankr_bet.py — the safe bet executor:
- Reads today's +EV picks directly from the model's output file
- Queries the Polymarket CLOB order book in real time before each bet
- Caps stake to liquidity at levels strictly better odds than the reference sportsbook (Picklebet/Pinnacle)
- Passes the exact best ask price to Bankr as a maximum fill price — Bankr respects this as a limit order
- Shows a full price ladder with decimal odds at each depth level before executing
The limit order discovery:
Early test runs revealed Bankr was filling at worse prices than available. Testing a max price parameter directly ("buy at maximum $0.32 per share") confirmed Bankr honours it — fills at best ask or not at all. This is the key unlock for getting the true book price rather than whatever a market order gives.
Polymarket CLOB directly:
Rather than relying on Bankr's price quotes, we now hit clob.polymarket.com/book?token_id=... ourselves immediately before placing each bet. This gives us real-time depth at every price level:
$0.310 = 3.23x | $1,802 available
$0.320 = 3.12x | $943 available
$0.330 = 3.03x | $1,811 available
$0.340 = 2.94x | $4,815 available
Live bets placed today: All from the model's output, edge calculated vs Picklebet reference odds. Multiple fills placed across two Dota 2 matches — Vici Gaming vs Xtreme Gaming and Tundra Esports vs PARIVISION — each at odds better than available on Picklebet. The limit order approach meant every fill came in at the best ask price available at time of execution, not a worse market order price.
Polymarket sync script:
Built polymarket_sync.py — pulls all positions and trade history from the data API by wallet address, resolves settled bets automatically, and updates a dedicated polymarket_bankroll.json. Runs on a daily cron at 8am.
bet365 scraper:
745-line Playwright scraper built (scrape_bet365.js). Needs a manual --save-session login run before headless deployment.
Key result:
- Avg fill on Vici: 3.26x vs 2.80x Picklebet — +16% better odds on the same match
- Pipeline: model picks → CLOB depth check → limit order via Bankr → auto-sync on resolution