AntFleet

Disagreement · c9663187-anthropic-9

`buy_shares` silently caps trade size, hiding the actual amount spent from the agent's UX

mismatch
repo 193af03f·PR #2·reviewed 1 week ago

Primary finding

`buy_shares` silently caps trade size, hiding the actual amount spent from the agent's UX

mediumapi-contracthigh
  • backend/wonderwall/simulations/polymarket/platform.py:150-159
The agent requests $X, platform silently spends only $X * (max_trade / X). No warning is returned. `total_cost` in the response reflects the capped amount, but there’s no signal saying "your request was reduced". The agent's perceived behavior will diverge from its planning, and it’s easy for the LLM to repeatedly try to spend more than allowed without realizing it’s being throttled.

Recommendation

Either return an explicit `capped=True, requested=<x>, executed=<y>` field, or return an error and require the agent to retry with a valid amount.

Counterpart finding

Insufficient balance check happens before trade-size cap in buy_shares, causing false “Insufficient balance” errors

mediumbughigh
  • backend/wonderwall/simulations/polymarket/platform.py:128-138
  • backend/wonderwall/simulations/polymarket/platform.py:156-161
The platform rejects trades when balance < requested amount, but the actual executed amount is later capped to min(requested, 2% of pool). A user with balance less than the requested amount but greater than the capped amount is incorrectly blocked.

Recommendation

Compute the effective amount before the balance check, e.g.: - Calculate pool_total and max_trade first. - effective_amount = min(float(requested), max_trade). - If balance < effective_amount, return insufficient balance; otherwise proceed using effective_amount for the trade and all bookkeeping.

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 →