Summary
GET /api/analytics/summary
Get an overall trading performance summary.
Lookback period. Defaults to 30.
Example request
curl "https://api.hyperoru.com/api/analytics/summary?days=30"
Example response
{
"total_trades": 150,
"win_rate": 0.62,
"total_pnl": 3200.0,
"avg_return_pct": 1.8
}
By strategy
GET /api/analytics/by-strategy
Break down performance by strategy type.
Example request
curl https://api.hyperoru.com/api/analytics/by-strategy
Example response
[
{ "strategy": "prompt", "trades": 100, "win_rate": 0.65, "pnl": 2500.0 },
{ "strategy": "program", "trades": 50, "win_rate": 0.56, "pnl": 700.0 }
]
By account
GET /api/analytics/by-account
Break down performance by trading account.
Example request
curl https://api.hyperoru.com/api/analytics/by-account
Example response
[
{ "account_id": 1, "account_name": "Main", "trades": 80, "pnl": 2000.0 }
]
By symbol
GET /api/analytics/by-symbol
Break down performance by trading symbol.
Example request
curl https://api.hyperoru.com/api/analytics/by-symbol
Example response
[
{ "symbol": "BTC", "trades": 60, "win_rate": 0.68, "pnl": 1800.0 },
{ "symbol": "ETH", "trades": 40, "win_rate": 0.55, "pnl": 500.0 }
]
By operation
GET /api/analytics/by-operation
Break down performance by operation type (buy/sell).
Example request
curl https://api.hyperoru.com/api/analytics/by-operation
Example response
[
{ "operation": "buy", "trades": 90, "win_rate": 0.64, "pnl": 2200.0 },
{ "operation": "sell", "trades": 60, "win_rate": 0.58, "pnl": 1000.0 }
]
By trigger type
GET /api/analytics/by-trigger-type
Break down performance by what triggered the trade.
Example request
curl https://api.hyperoru.com/api/analytics/by-trigger-type
Example response
[
{ "trigger_type": "ai_decision", "trades": 100, "pnl": 2500.0 },
{ "trigger_type": "signal", "trades": 30, "pnl": 400.0 },
{ "trigger_type": "manual", "trades": 20, "pnl": 300.0 }
]
By factor
GET /api/analytics/by-factor
Break down performance by ranking factor contribution.
Example request
curl https://api.hyperoru.com/api/analytics/by-factor
Example response
[
{ "factor": "momentum_1d", "trades_influenced": 80, "avg_return": 2.1 },
{ "factor": "volume_change", "trades_influenced": 60, "avg_return": 1.5 }
]
Trades
GET /api/analytics/trades
List trades with full analytics data.
Example request
curl "https://api.hyperoru.com/api/analytics/trades?symbol=BTC&page=1&per_page=10"
Example response
{
"data": [
{ "id": 1, "symbol": "BTC", "side": "buy", "pnl": 150.0, "return_pct": 2.2 }
],
"total": 60,
"page": 1,
"per_page": 10
}
Trade replay
GET /api/analytics/trades//replay
Get a step-by-step replay of a trade’s lifecycle.
Example request
curl https://api.hyperoru.com/api/analytics/trades/1/replay
Example response
{
"trade_id": 1,
"events": [
{ "type": "signal_triggered", "timestamp": "2026-04-09T09:00:00Z" },
{ "type": "order_placed", "timestamp": "2026-04-09T09:00:05Z" },
{ "type": "order_filled", "timestamp": "2026-04-09T09:00:10Z", "price": 67000.0 }
]
}
Trade kline
GET /api/analytics/trades//kline
Get kline data around a trade’s entry and exit points.
Example request
curl https://api.hyperoru.com/api/analytics/trades/1/kline
Example response
{
"trade_id": 1,
"entry_time": "2026-04-09T09:00:00Z",
"exit_time": "2026-04-09T15:00:00Z",
"klines": [
{ "timestamp": "2026-04-09T08:00:00Z", "open": 66800.0, "close": 67000.0 }
]
}
Program summary
GET /api/analytics/program-summary
Overall performance summary for program-based strategies.
Example request
curl https://api.hyperoru.com/api/analytics/program-summary
Example response
{
"total_trades": 50,
"win_rate": 0.56,
"total_pnl": 700.0
}
Program by symbol
GET /api/analytics/program-by-symbol
Program strategy performance broken down by symbol.
Example request
curl https://api.hyperoru.com/api/analytics/program-by-symbol
Example response
[
{ "symbol": "BTC", "trades": 30, "pnl": 500.0 }
]
Program by program
GET /api/analytics/program-by-program
Performance broken down by individual program.
Example request
curl https://api.hyperoru.com/api/analytics/program-by-program
Example response
[
{ "program_id": 1, "program_name": "Grid Bot", "trades": 25, "pnl": 400.0 }
]
Program by trigger type
GET /api/analytics/program-by-trigger-type
Program trades broken down by trigger type.
Example request
curl https://api.hyperoru.com/api/analytics/program-by-trigger-type
Example response
[
{ "trigger_type": "signal", "trades": 30, "pnl": 450.0 }
]
Program by operation
GET /api/analytics/program-by-operation
Program trades broken down by operation type.
Example request
curl https://api.hyperoru.com/api/analytics/program-by-operation
Example response
[
{ "operation": "buy", "trades": 28, "pnl": 380.0 },
{ "operation": "sell", "trades": 22, "pnl": 320.0 }
]
AI attribution chat stream
POST /api/analytics/ai-attribution/chat-stream
Stream an AI-powered trade attribution analysis. Returns a task ID for SSE polling.
Existing conversation ID.
Example request
curl -X POST https://api.hyperoru.com/api/analytics/ai-attribution/chat-stream \
-H "Content-Type: application/json" \
-d '{"message": "Why did my BTC trades perform better than ETH?"}'
Example response
{
"task_id": "ai-task-attr-001",
"conversation_id": "conv-attr-001"
}
AI attribution conversations
GET /api/analytics/ai-attribution/conversations
List AI attribution conversations.
Example request
curl https://api.hyperoru.com/api/analytics/ai-attribution/conversations
Example response
[
{ "id": "conv-attr-001", "title": "BTC vs ETH performance", "created_at": "2026-04-09T10:00:00Z" }
]
AI attribution messages
GET /api/analytics/ai-attribution/conversations//messages
Get messages in an attribution conversation.
Example request
curl https://api.hyperoru.com/api/analytics/ai-attribution/conversations/conv-attr-001/messages
Example response
[
{ "role": "user", "content": "Why did my BTC trades perform better?" },
{ "role": "assistant", "content": "Your BTC trades had higher win rates primarily because..." }
]