بنقرة واحدة
validate-logic
Validates all trade decisions and produces ERC-8004 style proof hashes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Validates all trade decisions and produces ERC-8004 style proof hashes
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Audits indicators, removes contradictions, and simplifies signals to a small coherent set
Implements confidence-weighted signal combination with dynamic weights and execution thresholds
Structures ERC-8004-style logs (identity, reputation, validation, intent) and produces deterministic hashes
Aligns risk gating (SL/TP, sizing, volatility, caps) with signal confidence to avoid blocking good trades
Ensures trades are executed only when confidence and risk checks pass; logs trades deterministically
Builds a dashboard to visualize trades, portfolio, and agent reasoning
| name | validate-logic |
| description | Validates all trade decisions and produces ERC-8004 style proof hashes |
import hashlib
import json
def generate_proof_hash(decision_record: dict) -> str:
canonical = json.dumps(decision_record, sort_keys=True, separators=(',', ':'))
return hashlib.sha256(canonical.encode('utf-8')).hexdigest()
validation/proof_log.jsonl with:
proof_hash: The SHA256 hashtimestamp: ISO 8601 UTC timestampdecision_summary: Human-readable trade summaryfull_record: Complete decision record for verificationFor each trade decision, verify:
def verify_proof(record: dict, expected_hash: str) -> bool:
"""Re-hash the record and compare with expected hash."""
actual_hash = generate_proof_hash(record)
return actual_hash == expected_hash
═══════════════════════════════════════════
VALIDATION REPORT — Trade #42
═══════════════════════════════════════════
Timestamp: 2026-03-17T14:30:00Z
Action: BUY ETH/USDC @ $3,200
Size: 0.5 ETH ($1,600)
───────────────────────────────────────────
Strategy Signals:
Momentum: BUY (confidence: 0.72)
Mean Reversion: HOLD (confidence: 0.45)
AI Predictor: BUY (confidence: 0.68)
───────────────────────────────────────────
Risk Checks:
Stop-loss (4%): ✓ SET at $3,072
Take-profit (6%): ✓ SET at $3,392
Position size: ✓ 16% of portfolio (< 30%)
Daily loss cap: ✓ 2.1% used (< 10%)
Volatility filter: ✓ Normal (1.2x avg)
───────────────────────────────────────────
Proof Hash: a1b2c3d4e5f6...
Verification: ✓ PASS
═══════════════════════════════════════════
Input: "Validate last 10 trades"
Output: List of 10 validation reports, each with: