CI/CD / build-and-push (push) Successful in 29s
- Legacy scan called ManifoldClient.get_probability(), removed in the v3
matcher migration, causing AttributeError when positions had changed
family keys. The block used Manifold to escalate positions to
CLOSE_RECOMMENDED (inversion detection) — a trading decision forbidden
under MANIFOLD_SIGNAL_ENABLED=false — so the dependency is removed
entirely; the scan keeps family re-keying and sibling-conflict logic.
- PaperExecutor.close_position() computed cash += position_cost * resolution,
ignoring direction: a winning BUY_NO (resolution=0.0) paid out $0 and
reported a loss. Now settles per trade:
BUY_YES: payout = shares * resolution
BUY_NO: payout = shares * (1 - resolution)
with pnl = payout - net_cost; Telegram win/loss keys off pnl > 0.
Adds read-only Database.get_open_trades_for_market().
- tests/test_paper_close.py covers the 4 deterministic payout cases;
tests/conftest.py shims datetime.UTC for local Python 3.10 (prod is 3.11).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
11 lines
327 B
Python
11 lines
327 B
Python
"""Test environment shims.
|
|
|
|
The bot runs on python:3.11-slim in production; local dev machines may have
|
|
3.10, which lacks datetime.UTC (added in 3.11). Alias it so modules using
|
|
`from datetime import UTC` import cleanly under 3.10.
|
|
"""
|
|
import datetime
|
|
|
|
if not hasattr(datetime, "UTC"):
|
|
datetime.UTC = datetime.timezone.utc
|