curl --request POST \
--url https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategyCode": "//@version=5\nstrategy(\"SMA cross\", overlay=true)\nfast = ta.sma(close, 10)\nslow = ta.sma(close, 30)\nif ta.crossover(fast, slow)\n strategy.entry(\"L\", strategy.long)\nif ta.crossunder(fast, slow)\n strategy.close(\"L\")\n",
"marketId": "BTC-USD",
"timeframe": "1m",
"series": "index",
"fromEpochMs": 1790000000000,
"toEpochMs": 1790086400000,
"horizonTrades": 10,
"seed": 1,
"feeBps": 0,
"slippageBps": 0
}
'import requests
url = "https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest"
payload = {
"strategyCode": "//@version=5
strategy(\"SMA cross\", overlay=true)
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
if ta.crossover(fast, slow)
strategy.entry(\"L\", strategy.long)
if ta.crossunder(fast, slow)
strategy.close(\"L\")
",
"marketId": "BTC-USD",
"timeframe": "1m",
"series": "index",
"fromEpochMs": 1790000000000,
"toEpochMs": 1790086400000,
"horizonTrades": 10,
"seed": 1,
"feeBps": 0,
"slippageBps": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategyCode: '//@version=5\nstrategy("SMA cross", overlay=true)\nfast = ta.sma(close, 10)\nslow = ta.sma(close, 30)\nif ta.crossover(fast, slow)\n strategy.entry("L", strategy.long)\nif ta.crossunder(fast, slow)\n strategy.close("L")\n',
marketId: 'BTC-USD',
timeframe: '1m',
series: 'index',
fromEpochMs: 1790000000000,
toEpochMs: 1790086400000,
horizonTrades: 10,
seed: 1,
feeBps: 0,
slippageBps: 0
})
};
fetch('https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));use reqwest::blocking::Client;
use serde_json::json;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = Client::new()
.post("https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest")
.bearer_auth(std::env::var("EDEL_API_KEY")?)
.json(&json!({
"strategyCode": "//@version=5\nstrategy(\"SMA cross\", overlay=true)\nfast = ta.sma(close, 10)\nslow = ta.sma(close, 30)\nif ta.crossover(fast, slow)\n strategy.entry(\"L\", strategy.long)\nif ta.crossunder(fast, slow)\n strategy.close(\"L\")\n",
"marketId": "BTC-USD",
"timeframe": "1m",
"series": "index",
"fromEpochMs": 1790000000000_i64,
"toEpochMs": 1790086400000_i64,
"horizonTrades": 10,
"seed": 1,
"feeBps": 0,
"slippageBps": 0
}))
.send()?;
println!("{} {}", response.status(), response.text()?);
Ok(())
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest"
payload := strings.NewReader("{\n \"strategyCode\": \"//@version=5\\nstrategy(\\\"SMA cross\\\", overlay=true)\\nfast = ta.sma(close, 10)\\nslow = ta.sma(close, 30)\\nif ta.crossover(fast, slow)\\n strategy.entry(\\\"L\\\", strategy.long)\\nif ta.crossunder(fast, slow)\\n strategy.close(\\\"L\\\")\\n\",\n \"marketId\": \"BTC-USD\",\n \"timeframe\": \"1m\",\n \"series\": \"index\",\n \"fromEpochMs\": 1790000000000,\n \"toEpochMs\": 1790086400000,\n \"horizonTrades\": 10,\n \"seed\": 1,\n \"feeBps\": 0,\n \"slippageBps\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategyCode\": \"//@version=5\\nstrategy(\\\"SMA cross\\\", overlay=true)\\nfast = ta.sma(close, 10)\\nslow = ta.sma(close, 30)\\nif ta.crossover(fast, slow)\\n strategy.entry(\\\"L\\\", strategy.long)\\nif ta.crossunder(fast, slow)\\n strategy.close(\\\"L\\\")\\n\",\n \"marketId\": \"BTC-USD\",\n \"timeframe\": \"1m\",\n \"series\": \"index\",\n \"fromEpochMs\": 1790000000000,\n \"toEpochMs\": 1790086400000,\n \"horizonTrades\": 10,\n \"seed\": 1,\n \"feeBps\": 0,\n \"slippageBps\": 0\n}")
.asString();{
"marketId": "<string>",
"pnlAsset": "<string>",
"timeframe": "1m",
"series": "index",
"seriesLabel": "trade price series",
"seriesNote": "Backtest uses market index candles; trade requests are accepted for compatibility.",
"window": {
"fromEpochMs": 1,
"toEpochMs": 123
},
"barCount": 1,
"initialCapital": 123,
"feeBps": 1,
"slippageBps": 1,
"assumptions": {
"initialCapital": "<string>",
"maxLeverage": 1,
"marketType": "crypto",
"makerFeeBps": 1,
"takerFeeBps": 1,
"feeSource": "market_registry_or_higher_caller_floor",
"halfSpreadBps": 1,
"baseSlippageBps": 1,
"sizeImpactBpsPer1000Notional": 1,
"executionCostSource": "conservative_market_type_model_or_higher_caller_floor",
"fundingCostBpsPerInterval": 1,
"fundingIntervalMs": 123,
"fundingSource": "modeled_conservative_1bps_hourly_fallback",
"label": "Modeled costs, not historical executions"
},
"summary": {
"tradeCount": 1,
"winningTrades": 1,
"losingTrades": 1,
"pnl": 123,
"maxDrawdown": 1,
"winRate": 123,
"averageTradePnl": 123,
"bestTradePnl": 123,
"worstTradePnl": 123,
"longestLossStreak": 1,
"averageWinPnl": 123,
"averageLossPnl": 123,
"openPosition": true
},
"probability": {
"status": "estimated",
"method": "iid_trade_pnl_bootstrap",
"sampleSize": 1,
"minimumSampleSize": 30,
"window": {
"firstBarTime": 123,
"lastBarTime": 123
},
"seed": 1,
"horizonTrades": 123,
"resamples": 123,
"label": "historical estimate, not a guarantee",
"probabilityProfit": 123,
"probabilityLoss": 123,
"probabilityFlat": 123,
"winRateInterval": {
"lower": 123,
"upper": 123,
"confidence": 0.95
}
},
"chart": {
"candles": [
{
"time": 1,
"open": 123,
"high": 123,
"low": 123,
"close": 123,
"volume": 1
}
],
"closes": [
{
"time": 1,
"close": 123
}
],
"trades": [
{
"side": "long",
"entryId": "<string>",
"entryTime": 1,
"entryPrice": 123,
"size": 123,
"exitTime": 1,
"exitPrice": 123
}
],
"plots": [
{
"title": "<string>",
"color": "<string>",
"linewidth": 5,
"values": [
123
]
}
]
}
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}Backtest a Pine strategy on a market's history (v2)
Runs a Pine v5 strategy, in the subset agents run, over the selected market’s index OHLCV candles from the same /candles source as the market page between fromEpochMs and toEpochMs. Legacy series=trade input remains accepted but runs on index and the answer explicitly says so. It answers what it would have done: a trades summary with PnL, maximum drawdown, win rate, worst closed trade, longest consecutive loss streak, average winning trade and average losing trade, plus a probability object and a chart object. The chart lists every OHLCV bar the simulation read and each trade’s side, entry order id, size, entry time and price, and exit time and price, oldest entry first; a position still open at the last bar has a null exit, and past the bar bound the newest trades are kept while summary.tradeCount stays the full count. The chart also lists each plot() line of the script in source order, with its title, #RRGGBB color, line width and one value per bar (null during indicator warm-up), computed in the same run as the trades; plot() is a top-level statement taking a numeric series, a title of 1 to 128 characters written as a string literal, a named color such as color.orange and an integer line width. An unguarded division by zero inside a plotted series refuses the run like any other series; guard it with a ternary. The probability is a bootstrap of the closed trades’ net PnL over horizonTrades trades; it is labelled “historical estimate, not a guarantee” and carries its method, sample size, trade window and seed, so the same request with the same seed answers the same numbers. With fewer than 30 closed trades its status is insufficient_sample and every probability is null. The window holds at most 1440 bars of the timeframe and spans at most 31 days; a wider, empty or reversed window answers 400 with agentRefusal backtest_window_invalid. A simulation that runs past 10 seconds answers 503 backtest_timed_out. Each account has one backtest in progress at a time and at most 6 per minute; past either limit the route answers 429 rate_limited with a Retry-After header, in seconds. Prices are floating point simulation values in the market’s collateral unit; signals fill at the next bar open with the market registry’s maker/taker fees and disclosed conservative modeled half-spread, impact per 1,000 units of quote notional and a modeled conservative 1 bp per held hour funding fallback. The assumptions block states each value; these are not historical executions. Nothing is deployed and no order is placed. Requires the owner’s passkey session or an API key with the agents scope, which the owner grants with a passkey on the agent connect approval page. Available on Development and TestNet.
curl --request POST \
--url https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"strategyCode": "//@version=5\nstrategy(\"SMA cross\", overlay=true)\nfast = ta.sma(close, 10)\nslow = ta.sma(close, 30)\nif ta.crossover(fast, slow)\n strategy.entry(\"L\", strategy.long)\nif ta.crossunder(fast, slow)\n strategy.close(\"L\")\n",
"marketId": "BTC-USD",
"timeframe": "1m",
"series": "index",
"fromEpochMs": 1790000000000,
"toEpochMs": 1790086400000,
"horizonTrades": 10,
"seed": 1,
"feeBps": 0,
"slippageBps": 0
}
'import requests
url = "https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest"
payload = {
"strategyCode": "//@version=5
strategy(\"SMA cross\", overlay=true)
fast = ta.sma(close, 10)
slow = ta.sma(close, 30)
if ta.crossover(fast, slow)
strategy.entry(\"L\", strategy.long)
if ta.crossunder(fast, slow)
strategy.close(\"L\")
",
"marketId": "BTC-USD",
"timeframe": "1m",
"series": "index",
"fromEpochMs": 1790000000000,
"toEpochMs": 1790086400000,
"horizonTrades": 10,
"seed": 1,
"feeBps": 0,
"slippageBps": 0
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
strategyCode: '//@version=5\nstrategy("SMA cross", overlay=true)\nfast = ta.sma(close, 10)\nslow = ta.sma(close, 30)\nif ta.crossover(fast, slow)\n strategy.entry("L", strategy.long)\nif ta.crossunder(fast, slow)\n strategy.close("L")\n',
marketId: 'BTC-USD',
timeframe: '1m',
series: 'index',
fromEpochMs: 1790000000000,
toEpochMs: 1790086400000,
horizonTrades: 10,
seed: 1,
feeBps: 0,
slippageBps: 0
})
};
fetch('https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));use reqwest::blocking::Client;
use serde_json::json;
fn main() -> Result<(), Box<dyn std::error::Error>> {
let response = Client::new()
.post("https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest")
.bearer_auth(std::env::var("EDEL_API_KEY")?)
.json(&json!({
"strategyCode": "//@version=5\nstrategy(\"SMA cross\", overlay=true)\nfast = ta.sma(close, 10)\nslow = ta.sma(close, 30)\nif ta.crossover(fast, slow)\n strategy.entry(\"L\", strategy.long)\nif ta.crossunder(fast, slow)\n strategy.close(\"L\")\n",
"marketId": "BTC-USD",
"timeframe": "1m",
"series": "index",
"fromEpochMs": 1790000000000_i64,
"toEpochMs": 1790086400000_i64,
"horizonTrades": 10,
"seed": 1,
"feeBps": 0,
"slippageBps": 0
}))
.send()?;
println!("{} {}", response.status(), response.text()?);
Ok(())
}
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest"
payload := strings.NewReader("{\n \"strategyCode\": \"//@version=5\\nstrategy(\\\"SMA cross\\\", overlay=true)\\nfast = ta.sma(close, 10)\\nslow = ta.sma(close, 30)\\nif ta.crossover(fast, slow)\\n strategy.entry(\\\"L\\\", strategy.long)\\nif ta.crossunder(fast, slow)\\n strategy.close(\\\"L\\\")\\n\",\n \"marketId\": \"BTC-USD\",\n \"timeframe\": \"1m\",\n \"series\": \"index\",\n \"fromEpochMs\": 1790000000000,\n \"toEpochMs\": 1790086400000,\n \"horizonTrades\": 10,\n \"seed\": 1,\n \"feeBps\": 0,\n \"slippageBps\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://testnet.edel-api.xyz/v2/accounts/{accountId}/agents/backtest")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"strategyCode\": \"//@version=5\\nstrategy(\\\"SMA cross\\\", overlay=true)\\nfast = ta.sma(close, 10)\\nslow = ta.sma(close, 30)\\nif ta.crossover(fast, slow)\\n strategy.entry(\\\"L\\\", strategy.long)\\nif ta.crossunder(fast, slow)\\n strategy.close(\\\"L\\\")\\n\",\n \"marketId\": \"BTC-USD\",\n \"timeframe\": \"1m\",\n \"series\": \"index\",\n \"fromEpochMs\": 1790000000000,\n \"toEpochMs\": 1790086400000,\n \"horizonTrades\": 10,\n \"seed\": 1,\n \"feeBps\": 0,\n \"slippageBps\": 0\n}")
.asString();{
"marketId": "<string>",
"pnlAsset": "<string>",
"timeframe": "1m",
"series": "index",
"seriesLabel": "trade price series",
"seriesNote": "Backtest uses market index candles; trade requests are accepted for compatibility.",
"window": {
"fromEpochMs": 1,
"toEpochMs": 123
},
"barCount": 1,
"initialCapital": 123,
"feeBps": 1,
"slippageBps": 1,
"assumptions": {
"initialCapital": "<string>",
"maxLeverage": 1,
"marketType": "crypto",
"makerFeeBps": 1,
"takerFeeBps": 1,
"feeSource": "market_registry_or_higher_caller_floor",
"halfSpreadBps": 1,
"baseSlippageBps": 1,
"sizeImpactBpsPer1000Notional": 1,
"executionCostSource": "conservative_market_type_model_or_higher_caller_floor",
"fundingCostBpsPerInterval": 1,
"fundingIntervalMs": 123,
"fundingSource": "modeled_conservative_1bps_hourly_fallback",
"label": "Modeled costs, not historical executions"
},
"summary": {
"tradeCount": 1,
"winningTrades": 1,
"losingTrades": 1,
"pnl": 123,
"maxDrawdown": 1,
"winRate": 123,
"averageTradePnl": 123,
"bestTradePnl": 123,
"worstTradePnl": 123,
"longestLossStreak": 1,
"averageWinPnl": 123,
"averageLossPnl": 123,
"openPosition": true
},
"probability": {
"status": "estimated",
"method": "iid_trade_pnl_bootstrap",
"sampleSize": 1,
"minimumSampleSize": 30,
"window": {
"firstBarTime": 123,
"lastBarTime": 123
},
"seed": 1,
"horizonTrades": 123,
"resamples": 123,
"label": "historical estimate, not a guarantee",
"probabilityProfit": 123,
"probabilityLoss": 123,
"probabilityFlat": 123,
"winRateInterval": {
"lower": 123,
"upper": 123,
"confidence": 0.95
}
},
"chart": {
"candles": [
{
"time": 1,
"open": 123,
"high": 123,
"low": 123,
"close": 123,
"volume": 1
}
],
"closes": [
{
"time": 1,
"close": 123
}
],
"trades": [
{
"side": "long",
"entryId": "<string>",
"entryTime": 1,
"entryPrice": 123,
"size": 123,
"exitTime": 1,
"exitPrice": 123
}
],
"plots": [
{
"title": "<string>",
"color": "<string>",
"linewidth": 5,
"values": [
123
]
}
]
}
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}{
"version": "external-rest-error/v1",
"requestId": "<string>",
"code": "promo_code_unknown",
"safeMessage": "<string>",
"retryable": true,
"recoveryActions": [
"none"
],
"occurredAtEpochMs": 1,
"featureFlag": "<string>",
"orderOutcome": "not_submitted",
"clientOrderIds": [
"<string>"
],
"reconciliation": "<string>",
"realtimeTicketFailure": "invalid",
"apiKeyRejection": "malformed",
"agentRefusal": "agents_not_admitted_in_environment",
"rejectionGuard": "custodial_signer_environment_not_service_held",
"withdrawalFailure": "requested",
"feeShareAcceptRefusal": "challenge_missing",
"dependency": "dfns",
"squidRouteRefusal": "route_not_found",
"positionSnapshotRefusal": "position_projection_behind_live",
"setupKeyRefusal": "setup_key_refused"
}Authorizations
The authorization field takes the session bearer returned by sign-in, or an API key where the route allows keys. Paste the token itself into the authorization field. When invitation-only access is enabled, private operations require the account's sign-in email to be invited. Sign-in can complete without an invitation, but private HTTP, MCP and FIX operations refuse with access_not_allowlisted (HTTP 403): "Private access is limited to invited accounts. Contact support to request access." Public market data remains available. Invitation changes apply to the next private operation, including existing FIX sessions. Do not retry until support confirms access.
Body
Initial simulation capital as decimal text in the market's settlement asset, greater than zero and at most 1000000. Precision must fit that asset's decimals (at most 10); excess significant decimals are refused. Omit for 10000 units.
32^[0-9]+(?:\.[0-9]{1,10})?$Response
Success