Pre trade analysis#
GET https://api.pro.anboto.xyz/api/v2/data/preTradeAnalysis
Market impact of an order before it is placed, computed from Anboto's live market snapshot (the same analysis as the trading UI): participation in the 5m volume and in the order book, impact tier LOW / MEDIUM / HIGH for TWAP / VWAP / IS at the given duration, the shortest low / medium impact durations, sweep price, slippage and share of the 24h volume. For POV, give povRatio: the impact tier at that participation, the estimated time to fill and the low / medium / high participation presets (pov). cost_estimate gives the expected slippage, price move and market risk from a market-impact model (uncalibrated estimate). supported: false with missing explains when the venue or symbol cannot be analysed (e.g. exchange_not_supported, timeout); market and execution are then null when no snapshot could be read or it is stale. The first call for a symbol can take a few seconds while the snapshot is built; later calls are immediate. ApiKeyAuth required.
Query params#
exchange stringassetClass stringsymbol stringquantity stringstrategy stringside stringdurationSeconds stringpovRatio stringHeaders#
| Header | ||
|---|---|---|
X-API-KEY |
string | required |
X-TIMESTAMP |
int64 ms | required |
X-SIGN |
string | required |
X-RECV-WINDOW |
int, default 5000 |
Responses#
| 200 | The analysis. |
| 400 | Invalid parameter |
| 401 | Unauthorized: missing or unknown API key |
| 429 | Rate limit exceeded, retry later |
| 503 | Pre-trade analysis is not available on this deployment |
Response fields — PreTradeAnalysis#
supported boolean requiredmissing array[string] requiredsnapshot_timestamp integermarket objectimpact PreTradeImpactimpact.tier enumLOW, MEDIUM, HIGHimpact.duration_seconds integerimpact.volume_participation_pct numberimpact.order_book_participation_pct numberimpact.book_safe booleanexecution objectadvice PreTradeAdviceadvice.safe_duration_seconds integeradvice.moderate_duration_seconds integerpov PreTradePovpov.pov_ratio_pct number requiredpov.pace_vs_market_pct number requiredpov.share_of_total_pct number requiredpov.estimated_fill_seconds integerpov.estimated_fill_seconds_24h integerpov.safe_pov_pct numberpov.moderate_pov_pct numberpov.high_pov_pct numbercost_estimate PreTradeCostEstimatecost_estimate.slippage_bps number requiredcost_estimate.price_move_bps number requiredcost_estimate.permanent_bps number requiredcost_estimate.market_risk_bps number requiredcost_estimate.horizon_seconds integer requiredcost_estimate.pace_pct number requiredcost_estimate.model string requiredcost_estimate.calibrated boolean requiredcurl -X GET "$BASE/api/v2/data/preTradeAnalysis?exchange=string" \
-H "X-API-KEY: $API_KEY" -H "X-TIMESTAMP: $ts" \
-H "X-SIGN: $sign"
params = {"exchange": ..., "assetClass": ..., "symbol": ..., "quantity": ..., "strategy": ..., "side": ..., "durationSeconds": ..., "povRatio": ...}
r = requests.get(f"{BASE}/api/v2/data/preTradeAnalysis",
params=params
headers=signed_headers_query(params))
print(r.json())
let resp = client
.get(format!("{BASE}/api/v2/data/preTradeAnalysis?exchange=string"))
.headers(signed_headers_query(¶ms))
.send()?;
println!("{}", resp.text()?);
req, _ := http.NewRequest("GET", BASE+"/api/v2/data/preTradeAnalysis?exchange=string", nil)
for k, v := range signedHeadersQuery(req.URL.Query()) {
req.Header.Set(k, v)
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
log.Fatal(err)
}
defer resp.Body.Close()
io.Copy(os.Stdout, resp.Body)
HttpResponse<String> resp = client.send(
signedGet("/api/v2/data/preTradeAnalysis?exchange=string"),
HttpResponse.BodyHandlers.ofString());
const res = await fetch(`${BASE}/api/v2/data/preTradeAnalysis?exchange=string`, {
method: "GET",
headers: signedHeadersQuery(params),
});
const data: PreTradeAnalysis = await res.json();
val request = signedGet("/api/v2/data/preTradeAnalysis?exchange=string")
val response = client.send(request, HttpResponse.BodyHandlers.ofString())
println(response.body())
cpr::Response r = cpr::Get(
cpr::Url{BASE + "/api/v2/data/preTradeAnalysis?exchange=string"},
signedHeadersQuery(params));
std::cout << r.text << std::endl;
const res = await fetch(`${BASE}/api/v2/data/preTradeAnalysis?exchange=string`, {
method: "GET",
headers: signedHeadersQuery(params),
});
console.log(await res.json());
Response 200
{
"supported": true,
"missing": [
"string"
],
"snapshot_timestamp": 0,
"market": "string",
"impact": {
"tier": "LOW",
"duration_seconds": 0,
"volume_participation_pct": 0.0,
"order_book_participation_pct": 0.0,
"book_safe": true,
"model": {
"reference_duration_seconds": 0,
"volume_participation_pct": 0.0,
"order_book_participation_pct": 0.0,
"low_order_book_participation_pct": 0.0,
"thresholds_low_order_book": {
"medium_pct": 0.0,
"high_pct": 0.0
},
"thresholds_high_order_book": {
"medium_pct": 0.0,
"high_pct": 0.0
}
}
},
"execution": "string",
"advice": {
"safe_duration_seconds": 0,
"moderate_duration_seconds": 0
},
"pov": {
"pov_ratio_pct": 0.0,
"pace_vs_market_pct": 0.0,
"share_of_total_pct": 0.0,
"estimated_fill_seconds": 0,
"estimated_fill_seconds_24h": 0,
"thresholds": {
"medium_pct": 0.0,
"high_pct": 0.0
},
"safe_pov_pct": 0.0,
"moderate_pov_pct": 0.0,
"high_pov_pct": 0.0
},
"cost_estimate": {
"slippage_bps": 0.0,
"price_move_bps": 0.0,
"permanent_bps": 0.0,
"market_risk_bps": 0.0,
"horizon_seconds": 0,
"pace_pct": 0.0,
"model": "string",
"calibrated": true
}
}