T09 · Insecure Skill Coding Practices
- Location
trader.py:432- Finding
Concurrent position limit only counts orders placed during the current run
- Content
View full analysis
= MAX_POSITIONS: break safe_print( f" [signal] {direction.upper()} x{whale_count} whales " f"vol=${volume:.0f} — {title[:60]}" ) # Find matching market in Simmer market = find_matching_market(client, title) if not market: safe_print(f" [skip] No matching Simmer market found") continue # Compute whale-boosted signal side, size, reasoning = compute_whale_boosted_signal(market, direction, whale_count) if not side: safe_print(f" [skip] {reasoning}") continue # Context safety checks ok, why = context_ok(client, market.id) if not ok: safe_print(f" [skip] {why}") continue # Place trade try: r = client.trade( market_id=market.id, side=side, amount=size, source=TRADE_SOURCE, skill_slug=SKILL_SLUG, reasoning=reasoning, ) tag = "(sim)" if r.simulated else "(live)" status = "OK" if r.success else f"FAIL:{r.error}" safe_print(f" [trade] {side.upper()} ${size} {tag} {status} — {reasoning[:70]}") if r.success: placed += 1 ``` ### Technical Analysis `MAX_POSITIONS` is documented as a maximum number of concurrent positions, but the implementation initializes `placed` to zero on every invocation. It counts only successful orders submitted during that invocation and never retrieves existing positions from the trading account. Consequently, the control is a per-run order limit rather than a concurrent-position limit. It also does not prevent repeated exposure to the same mar ...[truncated 816 chars]- Remediation
View remediation
