T09 · Insecure Skill Coding Practices
- Location
scripts/depeg_eval.py:209- Finding
Fail-Open Collateral Scoring Can Produce Unsafe BUY Recommendations
- Content
View full analysis
0: tvl_drop_pct = (tvl_prev - tvl) / tvl_prev * 100 if tvl > 0 and tvl_drop_pct < 50: tvl_status = "INTACT" # Collateral largely intact elif tvl > 0 and tvl_drop_pct < 90: tvl_status = "PARTIAL" # Some collateral lost else: tvl_status = "DRAINED" # Collateral gone # Scoring score = 0 reasons = [] # Factor 1: Odds ratio (higher = better opportunity) if odds_ratio >= 8: score += 40 reasons.append(f"Extreme discount: {odds_ratio:.1f}x odds (+40)") elif odds_ratio >= 5: score += 35 reasons.append(f"Very high discount: {odds_ratio:.1f}x odds (+35)") elif odds_ratio >= 3: score += 25 reasons.append(f"High discount: {odds_ratio:.1f}x odds (+25)") elif odds_ratio >= 2: score += 15 reasons.append(f"Moderate discount: {odds_ratio:.1f}x odds (+15)") elif odds_ratio >= 1.5: score += 10 reasons.append(f"Small discount: {odds_ratio:.1f}x odds (+10)") else: score += 0 reasons.append(f"Minimal discount: {odds_ratio:.1f}x odds (+0)") # Factor 2: TVL status if tvl_status == "INTACT": score += 40 reasons.append(f"TVL intact (drop {tvl_drop_pct:.1f}%) (+40)") elif tvl_status == "PARTIAL": score += 20 reasons.append(f"TVL partially lost (drop {tvl_drop_pct:.1f}%) (+20)") elif tvl_status == "DRAINED": score -= 50 reasons.append(f"TVL drained (drop {tvl_drop_pct:.1f}%) (-50)") else: score += 10 reasons.append("TVL unknown, needs manual check (+10)") # Factor 3: Mark ...[truncated 3257 chars]- Remediation
View remediation
