T09 · Insecure Skill Coding Practices
- Location
trader.py:42- Finding
Minimum Market Volume Safeguard Is Declared but Never Enforced
- Content
View full analysis
Vulnerability Details
File Location:
trader.py:42,trader.py:108-130, andtrader.py:233-250
Vulnerability Type: Missing financial risk-control enforcement
Risk Level: SuspiciousThe project documentation presents
SIMMER_MIN_VOLUMEas a minimum market-volume filter, but the trading workflow never checks a market's volume before submitting an order.Relevant code:
python MIN_VOLUME = float(os.environ.get("SIMMER_MIN_VOLUME", "1000"))python def find_markets(client: SimmerClient) -> list: seen, unique = set(), [] for kw in KEYWORDS: try: for m in client.find_markets(query=kw): q = getattr(m, 'question', '') if m.id not in seen and POST_FILTER.search(q) and BIN_PATTERN.search(q): seen.add(m.id) unique.append(m) except Exception as e: safe_print(f"[search] {kw!r}: {e}") try: for m in client.get_markets(limit=200): q = getattr(m, 'question', '') if m.id not in seen and POST_FILTER.search(q) and BIN_PATTERN.search(q): seen.add(m.id) unique.append(m) except Exception as e: safe_print(f"[fallback] {e}") return uniquepython for m in markets: if placed >= MAX_POSITIONS: break side, size, reasoning = compute_signal(m) if not side: safe_print(f" [skip] {reasoning}") continue ok, why = context_ok(client, m.id) if not ok: safe_print(f" [skip] {why}") continue try: r = client.trade( market_id=m.id, side=side, amount=size, source=TRADE_SOURCE, skill_slug=SKILL_SLUG, reasoning=reasoning, )Technical Analysis
MIN_VOLUMEis initialized and refreshed after skill configuration, but it is not referenced by market di ...[truncated 1522 chars]- Remediation
View remediation
Remediation Suggestions
- Retrieve a trusted numeric volume field for every market before signal evaluation.
- Reject markets when
market.volume < MIN_VOLUME. - Fail closed when volume is absent, malformed, stale, or cannot be independently verified.
- If the SDK exposes multiple volume measurements, document and use the intended interval, currency, and venue-specific source.
- Revalidate volume immediately before live execution to reduce time-of-check/time-of-use risk.
- Add automated tests proving that markets below the threshold and markets with missing volume never reach
client.trade(). - Log the observed volume and applied threshold for auditability.
