List programs
GET /api/programs/
List all trading programs.
Example request
curl https://api.hyperoru.com/api/programs/
Example response
[
{ "id": 1, "name": "Grid Bot", "enabled": true, "created_at": "2026-04-01T00:00:00Z" }
]
Create program
POST /api/programs/
Create a new trading program.
Example request
curl -X POST https://api.hyperoru.com/api/programs/ \
-H "Content-Type: application/json" \
-d '{"name": "Grid Bot", "code": "fn run(ctx) { ... }", "description": "Grid trading strategy"}'
Example response
{
"id": 1,
"name": "Grid Bot",
"created_at": "2026-04-09T12:00:00Z"
}
Get / Update / Delete program
GET /api/programs/
PUT /api/programs/
DELETE /api/programs/
Example request
curl https://api.hyperoru.com/api/programs/1
Example response
{
"id": 1,
"name": "Grid Bot",
"code": "fn run(ctx) { ... }",
"enabled": true,
"created_at": "2026-04-01T00:00:00Z"
}
Test run
POST /api/programs/test-run
Execute a program in dry-run mode without placing real orders.
Example request
curl -X POST https://api.hyperoru.com/api/programs/test-run \
-H "Content-Type: application/json" \
-d '{"program_id": 1, "symbol": "BTC"}'
Example response
{
"status": "ok",
"result": { "action": "buy", "quantity": 0.01, "reason": "Grid level hit" }
}
Dev guide
GET /api/programs/dev-guide
Get the developer guide for writing trading programs.
Example request
curl https://api.hyperoru.com/api/programs/dev-guide
Example response
{
"guide": "# Program Development Guide\n\n## Context Object\n..."
}
Signal pools
GET /api/programs/signal-pools/
List signal pools available for program bindings.
Example request
curl https://api.hyperoru.com/api/programs/signal-pools/
Example response
[
{ "id": 1, "name": "Momentum Pool", "signals_count": 3 }
]
Accounts
GET /api/programs/accounts/
List accounts available for program bindings.
Example request
curl https://api.hyperoru.com/api/programs/accounts/
Example response
[
{ "id": 1, "name": "Main Account", "account_type": "program" }
]
Validate
POST /api/programs/validate
Validate program code syntax and structure.
Program source code to validate.
Example request
curl -X POST https://api.hyperoru.com/api/programs/validate \
-H "Content-Type: application/json" \
-d '{"code": "fn run(ctx) { ctx.buy(\"BTC\", 0.01) }"}'
Example response
{
"valid": true,
"errors": []
}
List bindings
GET /api/programs/bindings/
List all program-to-account bindings.
Example request
curl https://api.hyperoru.com/api/programs/bindings/
Example response
[
{ "id": 1, "program_id": 1, "account_id": 1, "enabled": true }
]
Create binding
POST /api/programs/bindings/
Bind a program to an account.
Example request
curl -X POST https://api.hyperoru.com/api/programs/bindings/ \
-H "Content-Type: application/json" \
-d '{"program_id": 1, "account_id": 1}'
Example response
{
"id": 1,
"program_id": 1,
"account_id": 1,
"enabled": true
}
Update / Delete binding
PUT /api/programs/bindings/
DELETE /api/programs/bindings/
Example request (update)
curl -X PUT https://api.hyperoru.com/api/programs/bindings/1 \
-H "Content-Type: application/json" \
-d '{"enabled": false}'
Example response
{
"id": 1,
"program_id": 1,
"account_id": 1,
"enabled": false
}
Preview run
POST /api/programs/bindings//preview-run
Preview what a program binding would do without executing.
Example request
curl -X POST https://api.hyperoru.com/api/programs/bindings/1/preview-run
Example response
{
"action": "buy",
"symbol": "BTC",
"quantity": 0.01,
"reason": "Grid level triggered"
}
Executions
GET /api/programs/executions/
List recent program execution logs.
Example request
curl "https://api.hyperoru.com/api/programs/executions/?program_id=1&limit=10"
Example response
[
{ "id": 1, "program_id": 1, "action": "buy", "symbol": "BTC", "executed_at": "2026-04-09T10:00:00Z" }
]
Available symbols
GET /api/programs/available-symbols
List symbols available for program trading.
Example request
curl https://api.hyperoru.com/api/programs/available-symbols
Example response
{
"symbols": ["BTC", "ETH", "SOL", "ARB"]
}
Run backtest
POST /api/programs/backtest
Run a backtest for a program.
Example request
curl -X POST https://api.hyperoru.com/api/programs/backtest \
-H "Content-Type: application/json" \
-d '{"program_id": 1, "symbol": "BTC", "start_date": "2026-03-01", "end_date": "2026-04-01"}'
Example response
{
"backtest_id": "bt-001",
"status": "running"
}
Run backtest (per program)
POST /api/programs//backtest
Alternative: run backtest for a specific program via path parameter.
Example request
curl -X POST https://api.hyperoru.com/api/programs/1/backtest \
-H "Content-Type: application/json" \
-d '{"symbol": "BTC", "start_date": "2026-03-01"}'
Example response
{
"backtest_id": "bt-002",
"status": "running"
}
Backtest history
GET /api/programs/backtest/history
List all program backtest runs.
Example request
curl https://api.hyperoru.com/api/programs/backtest/history
Example response
[
{ "id": "bt-001", "program_id": 1, "symbol": "BTC", "status": "completed", "created_at": "2026-04-08T10:00:00Z" }
]
Backtest result
GET /api/programs/backtest/
Get the full result of a program backtest.
Example request
curl https://api.hyperoru.com/api/programs/backtest/bt-001
Example response
{
"id": "bt-001",
"program_id": 1,
"total_trades": 25,
"win_rate": 0.60,
"total_pnl": 800.0,
"max_drawdown": -3.2
}
Backtest triggers
GET /api/programs/backtest//triggers
List all trigger events from a backtest.
Example request
curl https://api.hyperoru.com/api/programs/backtest/bt-001/triggers
Example response
[
{ "id": "trig-001", "type": "buy", "symbol": "BTC", "price": 67000.0, "timestamp": "2026-03-05T10:00:00Z" }
]
Backtest markers
GET /api/programs/backtest//markers
Get chart markers (entry/exit points) for a backtest.
Example request
curl https://api.hyperoru.com/api/programs/backtest/bt-001/markers
Example response
[
{ "type": "entry", "timestamp": "2026-03-05T10:00:00Z", "price": 67000.0, "side": "buy" },
{ "type": "exit", "timestamp": "2026-03-06T14:00:00Z", "price": 68200.0, "side": "sell" }
]
Backtest trigger detail
GET /api/programs/backtest/trigger/
Get details of a specific backtest trigger.
Example request
curl https://api.hyperoru.com/api/programs/backtest/trigger/trig-001
Example response
{
"id": "trig-001",
"type": "buy",
"symbol": "BTC",
"price": 67000.0,
"context": { "rsi": 32.1, "volume_spike": true }
}
Query market data
POST /api/programs/query-market-data
Query market data as a program would during execution.
Example request
curl -X POST https://api.hyperoru.com/api/programs/query-market-data \
-H "Content-Type: application/json" \
-d '{"symbol": "BTC", "indicators": ["rsi", "macd"]}'
Example response
{
"symbol": "BTC",
"price": 68500.0,
"indicators": { "rsi": 55.3, "macd": { "value": 120.5 } }
}
AI chat
POST /api/programs/ai-chat
Chat with AI for program development assistance.
Example request
curl -X POST https://api.hyperoru.com/api/programs/ai-chat \
-H "Content-Type: application/json" \
-d '{"message": "Help me write a grid trading program"}'
Example response
{
"response": "Here is a grid trading program template...",
"conversation_id": "conv-prog-001"
}
AI conversations / Messages
GET /api/programs/ai-conversations
GET /api/programs/ai-conversations//messages
Example request
curl https://api.hyperoru.com/api/programs/ai-conversations
Example response
[
{ "id": "conv-prog-001", "title": "Grid trading help", "created_at": "2026-04-09T10:00:00Z" }
]