Learning data structure

This page is based on data collected from live-account, real-time crypto trading since November 2024. It describes data structures designed for traceability, audit, and reproducibility of AI decisions.

Why it matters

Crypto trading AI must support trace, audit, and reproduction of real decisions, not just outcome prediction. NoahAI records every judgment as data for transparency and trust.

Who should read it

This structure is designed for live-account operation and serves as a common reference for technical verification, extension, and audit.

Production data flow

  • Real-time market data (price, volatility, order book)
  • AI decision generation (signals, confidence, guardrail application)
  • Order execution feedback (fill, slippage, reject)
  • Post-trade review and learning loop

The key is "standardization of record".

Judgment, context, and outcome must be stored in the same schema for replay, learning, audit, and user trust. Below are the main data structures in a CareLog-like schema.

DecisionLog

Decision log

FieldTypeDescription
decision_idUUIDUnique decision ID
timestampTIMESTAMPDecision time
strategySTRINGSelected strategy
actionENUMAction type (BUY/SELL/HOLD)
reasoningJSONReasoning (pattern, signal, weights)
confidenceFLOATConfidence score (0–1)
model_versionSTRINGAI model version used

MarketSnapshot

Market data snapshot

FieldTypeDescription
snapshot_idUUIDUnique snapshot ID
timestampTIMESTAMPSnapshot time
symbolSTRINGTrading symbol
priceDECIMALCurrent price
volumeDECIMALVolume
volatilityDECIMALVolatility indicator
orderbook_depthJSONOrder book depth
market_signalsJSONDetected market signals

AccountSnapshot

Account state snapshot

FieldTypeDescription
snapshot_idUUIDUnique snapshot ID
timestampTIMESTAMPSnapshot time
balanceDECIMALBalance
positionsJSONCurrent positions
leverageDECIMALLeverage ratio
margin_usedDECIMALMargin in use
unrealized_pnlDECIMALUnrealized P&L

RiskEvent

Risk event

FieldTypeDescription
event_idUUIDUnique event ID
timestampTIMESTAMPEvent time
risk_typeENUMRisk type (LOSS_LIMIT/VOLATILITY/LEVERAGE/ANOMALY)
severityENUMSeverity (LOW/MEDIUM/HIGH/CRITICAL)
trigger_valueDECIMALTrigger value
action_takenSTRINGAction taken
guardrail_appliedBOOLEANWhether guardrail was applied

ExecutionResult

Execution result

FieldTypeDescription
execution_idUUIDUnique execution ID
decision_idUUIDLinked decision ID
timestampTIMESTAMPExecution time
order_typeENUMOrder type (MARKET/LIMIT/STOP)
quantityDECIMALQuantity
executed_priceDECIMALExecuted price
slippageDECIMALSlippage
feeDECIMALFee
statusENUMStatus (PENDING/FILLED/PARTIAL/CANCELLED/FAILED)

XAITrace

XAI trace log

FieldTypeDescription
trace_idUUIDUnique trace ID
decision_idUUIDLinked decision ID
timestampTIMESTAMPTrace time
explanationTEXTDecision explanation (human-readable)
evidenceJSONEvidence (pattern, signal, stats)
confidence_breakdownJSONConfidence breakdown
alternative_optionsJSONOptions considered but not chosen

Learning data structure example

The example below is a simplified view of the production structure.

The learning data structure in use includes:

{
  "ai_learning_data": {
    "decision_history": [
      {
        "timestamp": "2025-01-26T10:30:00Z",
        "asset_type": "crypto",
        "decision": "long_entry",
        "reasoning": {
          "signal_strength": 0.85,
          "pattern": "bull_flag",
          "market_conditions": "high_volatility"
        },
        "confidence": 0.9,
        "tp": 50000,
        "sl": 48000,
        "exchange": "Binance",
        "execution_status": "filled",
        "result": "profit_target_hit"
      }
    ],
    "conversation_patterns": {
      "common_questions": [
        "Deposit method",
        "Withdrawal procedure",
        "API key setup",
        "Fee guide"
      ],
      "response_effectiveness": {
        "step_by_step_guide": 0.95,
        "simple_language": 0.92
      }
    },
    "user_satisfaction_metrics": {
      "comprehension_rate": 0.88,
      "task_completion_rate": 0.85
    }
  }
}

This structure supports real-time crypto decision-making, execution tracking, and learning from market conditions.

Schema design principles

  • Standardization: All judgment/context/outcome in the same format for replay
  • Traceability: Each record has unique ID and timestamp for time-order trace
  • Connectivity: DecisionLog, ExecutionResult, XAITrace link for full flow trace
  • Anonymization: Pattern-level learning without PII for collective learning
  • Extensibility: JSON fields allow new fields without breaking existing structure

Data usage examples

Trade pattern similarity

Compare past crypto trade patterns with current market to analyze performance in similar patterns; used for risk management via pattern verification before entry.

Regime-dependent thresholds

Adjust confidence and risk thresholds by regime (volatility spike, sideways, trend) to support better decisions.

Guardrail effect and loss prevention

Analyze guardrail application and max drawdown for policy improvement and risk strategy optimization.