feat(resolution): add automatic market resolution detector with conservative payout validation
CI/CD / build-and-push (push) Successful in 8s
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:
co-authored by
Claude Fable 5
parent
340c8523cf
commit
e137116e7f
@@ -95,7 +95,7 @@ def test_buy_no_loses():
|
||||
def test_position_is_removed_and_persisted():
|
||||
pnl, ex, db, notif = _close("BUY_YES", resolution=1.0)
|
||||
assert "mkt1" not in ex._portfolio.positions
|
||||
assert db.closed == [("mkt1", "market_resolved resolution=1.0", 1.0)]
|
||||
assert db.closed == [("mkt1", "resolved", 1.0)]
|
||||
|
||||
|
||||
def test_unknown_market_returns_none():
|
||||
|
||||
Reference in New Issue
Block a user