Skip to content

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 string
Exchange, e.g. binance, bybit, okx
assetClass string
Asset class: spot or future
symbol string
Anboto symbol, e.g. BTC/USDT:USDT
quantity string
Order quantity in base units (coins)
strategy string
Strategy: twap, vwap, is, pov, iceberg, limit, market…
side string
buy or sell; needed for the sweep price and slippage
durationSeconds string
Execution duration in seconds (TWAP / VWAP / IS)
povRatio string
POV participation in percent of market volume, 0.01 to 33; required for pov

Headers#

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 required
False when the venue or symbol cannot be analysed; see missing
missing array[string] required
Inputs that could not be sourced (e.g. deep_book, ohlcv_1m) or why the analysis is unavailable (disabled, exchange_not_supported, timeout, rejected, error, stale)
snapshot_timestamp integer
Epoch ms of the market snapshot used; null when no snapshot could be read (disabled, exchange_not_supported, timeout, rejected, error)
market object
Participation and impact tier at the requested duration
impact.tier enum
Null when no duration was given — LOW, MEDIUM, HIGH
impact.duration_seconds integer
impact.volume_participation_pct number
Percent of the median 5-minute volume
impact.order_book_participation_pct number
Percent of the book depth within 20 bps, per minute
impact.book_safe boolean
The book depth can absorb the flow
impact.model PreTradeImpactModel required
Participation at a reference duration; pct(D) = pct × reference_duration_seconds / D. Volume participation above medium_pct is MEDIUM and above high_pct is HIGH, with the low order book thresholds while the order book participation is below low_order_book_participation_pct
execution object
Advised durations, on Anboto's duration ladder
advice.safe_duration_seconds integer
Shortest duration rated LOW
advice.moderate_duration_seconds integer
Shortest duration rated MEDIUM or better
POV model. At a participation p the order trades k = p / (1 - 2p) of everyone else's volume, because the engine counts its own fills. The impact tier depends on p alone: pace_vs_market_pct above medium_pct is MEDIUM, above high_pct is HIGH, whatever the book depth. The quantity only sets the time to fill.
pov.pov_ratio_pct number required
Requested participation, percent of market volume
pov.pace_vs_market_pct number required
Order flow as a share of the rest of the market (k)
pov.share_of_total_pct number required
Order flow as a share of all market volume, own fills included
pov.estimated_fill_seconds integer
Time to fill the quantity if market volume stays at its recent median 5-minute volume. An estimate only: POV speeds up when volume rises and slows down when it falls; passive and hybrid styles, or a limit price, can be slower
pov.estimated_fill_seconds_24h integer
Same at the 24h average volume
pov.thresholds PreTradeThresholds required
pov.safe_pov_pct number
Largest ladder participation rated LOW
pov.moderate_pov_pct number
Largest ladder participation rated MEDIUM or better
pov.high_pov_pct number
Smallest ladder participation rated HIGH
cost_estimate PreTradeCostEstimate
Expected execution cost from a market-impact model (Almgren, Thum, Hauptmann and Li, 2005) with its published coefficients, in basis points of the arrival price. Assumes normal liquidity: market makers refill the book and nobody trades heavily against the order. calibrated is false until the coefficients are fitted on Anboto fills.
cost_estimate.slippage_bps number required
Expected average execution price against arrival
cost_estimate.price_move_bps number required
Expected price move by the end of the execution
cost_estimate.permanent_bps number required
Part of the move expected to remain after the order
cost_estimate.market_risk_bps number required
One standard deviation of the market's own move over the execution time
cost_estimate.horizon_seconds integer required
Execution time assumed: the duration, or the POV time to fill
cost_estimate.pace_pct number required
Order flow as a share of the rest of the market
cost_estimate.model string required
cost_estimate.calibrated boolean required
curl -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(&params))
    .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
  }
}