feat(resolution): add automatic market resolution detector with conservative payout validation
CI/CD / build-and-push (push) Successful in 8s

- PolymarketClient.get_market_resolution(): query Gamma API by market id;
  resolved only when closed AND uma status final AND outcome prices binary
  (never settle on disputed/ambiguous outcomes)
- bot/main.py: check_resolutions() runs every 10 cycles (~10 min) in paper
  mode, settles open positions via PaperExecutor.close_position()
- close_reason now persisted as 'resolved' (resolution has its own column)
- tests/test_resolution_detector.py: 10 tests covering API parsing shapes
  and the BUY_NO settlement flow; 27/27 suite green

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
chemavx
2026-06-11 13:48:41 +00:00
co-authored by Claude Fable 5
parent 340c8523cf
commit e137116e7f
5 changed files with 372 additions and 2 deletions
+1 -1
View File
@@ -270,7 +270,7 @@ class PaperExecutor:
await self._db.close_paper_position(
market_id,
reason=f"market_resolved resolution={resolution:.1f}",
reason="resolved",
resolution=resolution,
)
log.info(