AntFleet

Disagreement · c9663187-anthropic-10

`resolve_market` does not zero out positions after payout — winning shares stay queryable as positions

solo Opus
repo 193af03f·PR #2·reviewed 1 week ago

Opus finding

`resolve_market` does not zero out positions after payout — winning shares stay queryable as positions

mediumdata-losshigh
  • backend/wonderwall/simulations/polymarket/platform.py:295-314
After resolution, winning positions still have `shares > 0` in the position table. `view_portfolio` joins position with market and renders these as still-held positions with `current_price` derived from final reserves. Furthermore, `view_portfolio` does not filter out resolved markets — so the agent will see phantom positions that already paid out. Losing positions are also never zeroed. This is misleading and a likely source of double-counting in downstream analytics.

Recommendation

In resolve_market, after paying out, DELETE FROM position WHERE market_id = ? (or set shares = 0). Also filter view_portfolio's join by `m.resolved = 0` if you want only active positions.

Other reviewer

The other reviewer flagged nothing in this file/line range.

Why this didn't post

This finding didn't meet AntFleet's unanimous agreement threshold. Both frontier models review every PR independently; only findings they both flag with the same severity and category are posted to the PR. This one fell through.

read the methodology →