Skip to content

Fix 11 bugs in polymarket market maker bot#2

Open
jme21 wants to merge 1 commit intolorine93s:mainfrom
jme21:claude/review-and-identify-bugs-Tgc9c
Open

Fix 11 bugs in polymarket market maker bot#2
jme21 wants to merge 1 commit intolorine93s:mainfrom
jme21:claude/review-and-identify-bugs-Tgc9c

Conversation

@jme21
Copy link

@jme21 jme21 commented Dec 23, 2025

Critical fixes:

  • Fix invalid orderbook validation (best_ask <= 1 -> best_ask >= 1)
  • Fix async/sync mismatch in WebSocket handler using inspect.iscoroutinefunction
  • Add inventory update mechanism via trade handler

Medium fixes:

  • Fix division by zero in get_quote_size_no when price >= 1.0
  • Fix WebSocket reconnection to resubscribe to all channels
  • Fix wrong cancelled count in batch_cancel_orders
  • Fix pending cancellations memory leak by cleaning up after single cancels

Minor fixes:

  • Fix load_dotenv() order (move before get_settings)
  • Add metrics recording for orders, fills, cancellations, spread
  • Fix WebSocket type hint (WebSocketClientProtocol instead of Server)
  • Remove unused imports (Any, BaseModel) from config.py

Critical fixes:
- Fix invalid orderbook validation (best_ask <= 1 -> best_ask >= 1)
- Fix async/sync mismatch in WebSocket handler using inspect.iscoroutinefunction
- Add inventory update mechanism via trade handler

Medium fixes:
- Fix division by zero in get_quote_size_no when price >= 1.0
- Fix WebSocket reconnection to resubscribe to all channels
- Fix wrong cancelled count in batch_cancel_orders
- Fix pending cancellations memory leak by cleaning up after single cancels

Minor fixes:
- Fix load_dotenv() order (move before get_settings)
- Add metrics recording for orders, fills, cancellations, spread
- Fix WebSocket type hint (WebSocketClientProtocol instead of Server)
- Remove unused imports (Any, BaseModel) from config.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants