chemavxandClaude Fable 5 5aa54eb423
CI/CD / build-and-push (push) Successful in 8s
fix(resolution): cast $3 explicitly in close_paper_position and persist before mutating portfolio
Cycle-10 resolution check found market 562186 resolved (Paxton YES) but the
close failed with asyncpg AmbiguousParameterError: Postgres cannot infer the
type of a bare '$3 IS NOT NULL' in the close_pnl CASE. Reproduced via PREPARE
in the postgres pod; fixed by casting every $3 use to double precision.

The failed DB write also left memory/DB diverged: close_position() popped the
position and credited cash before persisting, so the retry at cycle 20 skipped
the market (pnl=n/a) while the DB row stayed open. Now the DB write happens
first and memory mutates only on success; check_resolutions() also isolates
per-market close failures so one error doesn't abort the cycle.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-11 14:15:05 +00:00
2026-05-20 13:52:53 +00:00
S
Description
Polymarket trading bot
2.6 MiB
2026-07-06 07:40:44 +00:00
Languages
Python 95.8%
JavaScript 2.9%
CSS 1.1%
Dockerfile 0.1%