Files
polymarket-bot/bot
chemavx 8a56bf77d1
CI/CD / build-and-push (push) Successful in 1m48s
fix(accounting): use size_usdc (not net_cost) for positions in initialize()
Eliminates the phantom 0.4% exposure overage after pod restarts.

During live trading execute() stores size_usdc in portfolio.positions and
deducts net_cost from cash — so total_value = bankroll − fees and
exposure_pct = sum(size_usdc) / (bankroll − fees).

Old initialize() stored net_cost in positions, making total_value = bankroll
and inflating exposure_pct (observed: 30.085% vs runtime 29.670%).

Fix: new get_open_position_data() returns both {market_id: size_usdc} and
total_net_cost in one query; initialize() uses size_usdc for positions and
total_net_cost for cash — identical model to execute().

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-22 11:05:47 +00:00
..