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
| Field | Type | Description |
|---|---|---|
| decision_id | UUID | Unique decision ID |
| timestamp | TIMESTAMP | Decision time |
| strategy | STRING | Selected strategy |
| action | ENUM | Action type (BUY/SELL/HOLD) |
| reasoning | JSON | Reasoning (pattern, signal, weights) |
| confidence | FLOAT | Confidence score (0–1) |
| model_version | STRING | AI model version used |
MarketSnapshot
Market data snapshot
| Field | Type | Description |
|---|---|---|
| snapshot_id | UUID | Unique snapshot ID |
| timestamp | TIMESTAMP | Snapshot time |
| symbol | STRING | Trading symbol |
| price | DECIMAL | Current price |
| volume | DECIMAL | Volume |
| volatility | DECIMAL | Volatility indicator |
| orderbook_depth | JSON | Order book depth |
| market_signals | JSON | Detected market signals |
AccountSnapshot
Account state snapshot
| Field | Type | Description |
|---|---|---|
| snapshot_id | UUID | Unique snapshot ID |
| timestamp | TIMESTAMP | Snapshot time |
| balance | DECIMAL | Balance |
| positions | JSON | Current positions |
| leverage | DECIMAL | Leverage ratio |
| margin_used | DECIMAL | Margin in use |
| unrealized_pnl | DECIMAL | Unrealized P&L |
RiskEvent
Risk event
| Field | Type | Description |
|---|---|---|
| event_id | UUID | Unique event ID |
| timestamp | TIMESTAMP | Event time |
| risk_type | ENUM | Risk type (LOSS_LIMIT/VOLATILITY/LEVERAGE/ANOMALY) |
| severity | ENUM | Severity (LOW/MEDIUM/HIGH/CRITICAL) |
| trigger_value | DECIMAL | Trigger value |
| action_taken | STRING | Action taken |
| guardrail_applied | BOOLEAN | Whether guardrail was applied |
ExecutionResult
Execution result
| Field | Type | Description |
|---|---|---|
| execution_id | UUID | Unique execution ID |
| decision_id | UUID | Linked decision ID |
| timestamp | TIMESTAMP | Execution time |
| order_type | ENUM | Order type (MARKET/LIMIT/STOP) |
| quantity | DECIMAL | Quantity |
| executed_price | DECIMAL | Executed price |
| slippage | DECIMAL | Slippage |
| fee | DECIMAL | Fee |
| status | ENUM | Status (PENDING/FILLED/PARTIAL/CANCELLED/FAILED) |
XAITrace
XAI trace log
| Field | Type | Description |
|---|---|---|
| trace_id | UUID | Unique trace ID |
| decision_id | UUID | Linked decision ID |
| timestamp | TIMESTAMP | Trace time |
| explanation | TEXT | Decision explanation (human-readable) |
| evidence | JSON | Evidence (pattern, signal, stats) |
| confidence_breakdown | JSON | Confidence breakdown |
| alternative_options | JSON | Options 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.
Related technical docs
Explain, record, and learning pipelines that use this data structure are described in the documents below.