T09 · Insecure Skill Coding Practices
- Location
trader.py:345- Finding
Advertised market safeguards are not enforced during copied trade execution
- Content
View full analysis
YES_THRESHOLD: skip_reason = f"YES prob {prob:.0%} > threshold {YES_THRESHOLD:.0%}" elif side.lower() == "no" and prob < NO_THRESHOLD: skip_reason = f"NO prob {prob:.0%} < threshold {NO_THRESHOLD:.0%}" if skip_reason: safe_print(f" SKIP: {skip_reason} | {question}") skipped += 1 details.append({"action": "skip", "reason": skip_reason, "market": question}) continue # Cap amount amount = min(amount, max_usd, MAX_POSITION) if dry_run: safe_print(f" [DRY] {side.upper()} ${amount:.2f} @ {prob:.0%} | {question}") executed += 1 details.append({"action": "dry_run", "side": side, "amount": amount, "market": question}) else: try: r = client.trade( market_id=market_id, side=side, amount=amount, source=TRADE_SOURCE, ) ``` The spread and resolution safeguards are implemented separately but never called by the copy-trading execution path: ```python def compute_signal(market) -> tuple[str | None, float, str]: """Standard conviction-based signal for market validation.""" p = market.cu ...[truncated 3140 chars]- Remediation
View remediation
