custom_data block that the agent reads before deciding.
There are two separate integration modes with different API contracts — one for live agents, one for the backtest engine.
Live Trading Agent
How It Works
Before every run cycle, your agent sends a GET request to your URL with no parameters. Whatever JSON your endpoint returns is injected into the agent’s prompt verbatim. The agent reads it and can factor it into its decision.Your Endpoint Requirements
| Requirement | Detail |
|---|---|
| Method | GET |
| Parameters | None required |
| Response | Valid JSON (any structure) |
| Response time | Under 30 seconds (request times out at 30s) |
| Auth | Must be publicly accessible — no auth headers supported |
| Protocol | HTTPS only |
Example Request
Example Response
Tell Your Agent What the Data Means
Add a description to your strategy prompt so the agent knows how to interpret the custom data:Backtest Engine
The backtest engine simulates decisions step-by-step through historical time. At each step it queries your endpoint for the data that would have existed at that exact moment in the past — your endpoint must return time-series historical data covering the full backtest window.How It Works
Before the simulation loop begins, the engine pre-fetches all custom data for each coin and the full date range in a single request per coin. This data is cached locally and looked up during the simulation using nearest-prior matching.API Contract
Query Parameters
| Parameter | Type | Description |
|---|---|---|
symbol | string | Token ticker (e.g. BTC, ETH, SOL) |
start_ms | integer | Start of requested range — Unix timestamp in milliseconds |
end_ms | integer | End of requested range — Unix timestamp in milliseconds |
interval | string | Always "4h" — the backtest decision interval |
Required Response Format
Data Rules
"time"is required in every row — millisecond UTC timestamp- All other field names are up to you — use descriptive names
- Numeric values are preferred; strings are accepted and passed through
- Data should cover the full requested date range
- Rows without a
"time"field are silently dropped - Extra fields (like
"symbol"or"interval") inside thedataarray are ignored
Timestamp Alignment
At each 4h decision step, the engine looks up the most recent data point at or before that timestamp. It does not interpolate — your data must already be aligned to 4h candle boundaries. 4h candle boundaries in UTC:00:00, 04:00, 08:00, 12:00, 16:00, 20:00
- Python
- JavaScript
Convert datetime to milliseconds:Convert milliseconds back to datetime:Align a raw timestamp to the nearest 4h boundary:
Full Example — Liquidation Data
This shows a correctly formatted response for liquidation heatmap data (CoinGlass-style):Caching
The engine caches endpoint responses per coin and date range as CSV files in.cache/custom/. If you update your historical data source, clear the cache to force a fresh fetch:
SSRF Security
For security, the backtest engine blocks requests to private IP ranges, loopback addresses, and cloud metadata endpoints. Your endpoint must:- Use
https://(nothttp://) - Resolve to a public IP address
- Not include credentials in the URL
Registering Your Endpoint
- Live Agent
- Backtest
Go to Modify Agent → Data Sources → Custom Data Endpoint.Paste your HTTPS URL and save. The agent will call it on the next run.