Endsems vs. My 5BTC Bot: 7 Days of Bug Hunting & "Zombie Whales"
Exams are finally over, and I’ve spent the last 24 hours unfucking my bot's brain. While I was studying, the bot was
apparently living in a parallel universe where BTC cost $553 Billion.
Quick recap of the 7-day "Exam Season" journey:
* The $553B BTC Bug: Found out my Chainlink price unpacker was taking the roundId instead of the price. The bot was
too terrified to trade because it thought BTC had overtaken the global GDP.
* Zombie Signals: Discovered the "Whale Consensus" features were 5+ days old. Added a 300s staleness guard so the bot
doesn't bet based on what happened last Tuesday.
* The NO-Profit Flip: Fixed a critical math error where NO positions were calculated as shorts. I was actually in
profit while the dashboard was reporting a massive loss. Best kind of surprise.
* Database Resilience: Finally enabled SQLite WAL Mode and increased timeouts to 60s. No more "Database is locked"
crashes during high-frequency cycles.
The Upgradation:
I’ve now load-balanced my Hermes dev agent across a pool of 8 NVIDIA API keys with a round-robin strategy. This has
completely eliminated the 429 rate-limit errors during heavy code refactors.
Question for the experts:
I’m seeing a lot of rejections on Polymarket because the 5-minute order books are notoriously thin at the exact
millisecond I poll.
Do you guys use a multi-retry polling strategy to find a 2-second liquidity "window," or have you found success
widening your "Spread Haircut" to force Market Order fills despite the slippage?
Appreciate any insights on handling these thin 5m books!
Changes made to support this post:
Fixed Telegram alerts in reconcile_trades.py to ensure you get correct "CLOSED" notifications.
Optimized SQLite concurrency in app/core/database.py (WAL Mode) so the bot doesn't crash when you query the P&L
while it's trading.
- Corrected the Reconciler to handle NULL prices, ensuring your trades actually close and update your balance.