T09 · Insecure Skill Coding Practices
- Location
candle_momentum.py:78- Finding
Live Trading Safety Validation Fails Open
- Content
View full analysis
0.15: return False, "slippage too high" edge = ctx.get("edge_analysis", {}) if edge.get("recommendation") == "HOLD": return False, "edge below threshold" return True, "ok" except Exception: return True, "context unavailable" ``` The returned approval is consumed immediately before live trading: ```python ok, reason = check_context(client, market_id) if not ok: if not quiet: print(f" Skipping trade: {reason}") return {"action": "skip", "reason": reason} try: result = client.trade( market_id=market_id, side=side, amount=amount, venue=os.environ.get("TRADING_VENUE", "polymarket"), source=TRADE_SOURCE, skill_slug=SKILL_SLUG, reasoning=full_reasoning, ) ``` ### Technical Analysis `check_context()` is a security and financial-risk gate intended to reject trades when there is severe flip-flopping, excessive slippage, or inadequate trading edge. Its broad exception handler converts every context-validation failure into approval by returning `True`. Failures covered by this behavior include network timeouts, authe ...[truncated 1867 chars]- Remediation
View remediation
