curl --request GET \
--url https://api.agg.market/orderbook/{venueMarketOutcomeId}/route \
--header 'x-app-id: <api-key>'import requests
url = "https://api.agg.market/orderbook/{venueMarketOutcomeId}/route"
headers = {"x-app-id": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-app-id': '<api-key>'}};
fetch('https://api.agg.market/orderbook/{venueMarketOutcomeId}/route', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agg.market/orderbook/{venueMarketOutcomeId}/route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-app-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.agg.market/orderbook/{venueMarketOutcomeId}/route"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-app-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.agg.market/orderbook/{venueMarketOutcomeId}/route")
.header("x-app-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/orderbook/{venueMarketOutcomeId}/route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-app-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"quoteId": "k2r8v5n1x7c4m9t3b6q0w2za",
"venueMarketOutcomeId": "cmf3q8z1k00a2mw0l7xg4v9rt",
"venueMarketId": "cmf3q8yzt009xmw0lh2c5d8kn",
"estimatedCostRaw": "25000000",
"expiresAt": "2026-09-29T15:04:30.000Z",
"refreshAt": "2026-09-29T15:04:20.000Z",
"status": "ok",
"fills": [
{
"venue": "polymarket",
"venueMarketId": "cmf3q8z0a009zmw0l3w8n6jbd",
"venueMarketOutcomeId": "cmf3q8z2m00a4mw0lr5t1k7yc",
"chain": "137",
"avgPrice": 0.51,
"yesPrice": 0.51,
"noPrice": 0.5,
"fills": [
{
"price": 0.51,
"size": 30,
"fill": 30
}
],
"venueQty": 30,
"venueFee": 0
},
{
"venue": "limitless",
"venueMarketId": "cmf3q8z0x00a0mw0lc1v7q3mf",
"venueMarketOutcomeId": "cmf3q8z3p00a6mw0l9e4h2sxa",
"chain": "8453",
"avgPrice": 0.535,
"yesPrice": 0.535,
"noPrice": 0.475,
"fills": [
{
"price": 0.535,
"size": 18,
"fill": 18
}
],
"venueQty": 18,
"venueFee": 0.05
}
],
"totalFilled": 48,
"rawExecCost": 24.93,
"solveTimeMs": 42,
"verifyTimeMs": 6,
"matchedMarkets": [
{
"venue": "polymarket",
"venueMarketId": "cmf3q8z0a009zmw0l3w8n6jbd"
},
{
"venue": "limitless",
"venueMarketId": "cmf3q8z0x00a0mw0lc1v7q3mf"
}
],
"allocations": [
{
"sourceChainId": "137",
"venue": "polymarket",
"amount": 15.3
},
{
"sourceChainId": "8453",
"venue": "limitless",
"amount": 9.68
}
],
"bridgeSteps": [],
"feeBreakdown": {
"rawExecCost": 24.93,
"venueFees": 0.05,
"bridgeFees": 0,
"executionGas": 0.02,
"totalCost": 25
},
"appFee": null,
"referral": null,
"slippage": {
"vwap": 0.5194,
"refMidpoint": 0.515,
"slippage": 0.0044,
"slippageBps": 85
},
"warnings": [],
"estimatedPayout": 48,
"totalCostIncFees": 25,
"estimatedProfit": 23,
"returnPct": 92
}{
"message": "<string>",
"code": "quote_not_found"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"code": "orderbook_service_unavailable",
"message": "<string>",
"retryable": true
}Get a quote (smart route)
Computes a fill quote across available venues for a specific venue market outcome and returns the suggested fills. When a user JWT is supplied the quote is scoped to the user’s wallet balances and may be executed; without a JWT the response is a preview-only quote. ProphetX prices are computed from AGG’s orderbook without a synchronous account-readiness request. Account identity and readiness are validated when a live fill is submitted, before funding or execution is queued. ProphetX quotes apply no execution reserve, settlement surcharge, or speculative venue commission. ProphetX live buys use fixed-input FOK execution and a maximum $500 per-order input cap.
curl --request GET \
--url https://api.agg.market/orderbook/{venueMarketOutcomeId}/route \
--header 'x-app-id: <api-key>'import requests
url = "https://api.agg.market/orderbook/{venueMarketOutcomeId}/route"
headers = {"x-app-id": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-app-id': '<api-key>'}};
fetch('https://api.agg.market/orderbook/{venueMarketOutcomeId}/route', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.agg.market/orderbook/{venueMarketOutcomeId}/route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-app-id: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.agg.market/orderbook/{venueMarketOutcomeId}/route"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-app-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.agg.market/orderbook/{venueMarketOutcomeId}/route")
.header("x-app-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.agg.market/orderbook/{venueMarketOutcomeId}/route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-app-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"quoteId": "k2r8v5n1x7c4m9t3b6q0w2za",
"venueMarketOutcomeId": "cmf3q8z1k00a2mw0l7xg4v9rt",
"venueMarketId": "cmf3q8yzt009xmw0lh2c5d8kn",
"estimatedCostRaw": "25000000",
"expiresAt": "2026-09-29T15:04:30.000Z",
"refreshAt": "2026-09-29T15:04:20.000Z",
"status": "ok",
"fills": [
{
"venue": "polymarket",
"venueMarketId": "cmf3q8z0a009zmw0l3w8n6jbd",
"venueMarketOutcomeId": "cmf3q8z2m00a4mw0lr5t1k7yc",
"chain": "137",
"avgPrice": 0.51,
"yesPrice": 0.51,
"noPrice": 0.5,
"fills": [
{
"price": 0.51,
"size": 30,
"fill": 30
}
],
"venueQty": 30,
"venueFee": 0
},
{
"venue": "limitless",
"venueMarketId": "cmf3q8z0x00a0mw0lc1v7q3mf",
"venueMarketOutcomeId": "cmf3q8z3p00a6mw0l9e4h2sxa",
"chain": "8453",
"avgPrice": 0.535,
"yesPrice": 0.535,
"noPrice": 0.475,
"fills": [
{
"price": 0.535,
"size": 18,
"fill": 18
}
],
"venueQty": 18,
"venueFee": 0.05
}
],
"totalFilled": 48,
"rawExecCost": 24.93,
"solveTimeMs": 42,
"verifyTimeMs": 6,
"matchedMarkets": [
{
"venue": "polymarket",
"venueMarketId": "cmf3q8z0a009zmw0l3w8n6jbd"
},
{
"venue": "limitless",
"venueMarketId": "cmf3q8z0x00a0mw0lc1v7q3mf"
}
],
"allocations": [
{
"sourceChainId": "137",
"venue": "polymarket",
"amount": 15.3
},
{
"sourceChainId": "8453",
"venue": "limitless",
"amount": 9.68
}
],
"bridgeSteps": [],
"feeBreakdown": {
"rawExecCost": 24.93,
"venueFees": 0.05,
"bridgeFees": 0,
"executionGas": 0.02,
"totalCost": 25
},
"appFee": null,
"referral": null,
"slippage": {
"vwap": 0.5194,
"refMidpoint": 0.515,
"slippage": 0.0044,
"slippageBps": 85
},
"warnings": [],
"estimatedPayout": 48,
"totalCostIncFees": 25,
"estimatedProfit": 23,
"returnPct": 92
}{
"message": "<string>",
"code": "quote_not_found"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"code": "orderbook_service_unavailable",
"message": "<string>",
"retryable": true
}Authorizations
Your application ID. Required for all app-tier and user-tier routes.
Path Parameters
Query Parameters
live, paper x >= 0x > 0x > 0true, false kalshi, polymarket, limitless, opinion, predict, pred, tiprun, probable, myriad, hyperliquid, novig, prophetx, betdex buy, sell true, false 42420 <= x <= 10000Must be a multiple of 1Referral: the EVM address that receives the referral fee. Requires referrerFeeBips. Honoured only when the request carries x-app-api-key; a JWT-only request that sends it is rejected with 400 referral_requires_api_key. Buy only.
42Referral fee in basis points of the routed notional, 1..10000. AGG takes no share of it. With referralPayer "user" it is reserved from maxSpend next to the app fee; with "app" the user pays nothing.
1 <= x <= 10000Must be a multiple of 1Who funds the referral. Default "user".
user, app Required when referralPayer is "app": the wallet that settles the payout. After the fill, a pendingSignatures entry appears with signerAddress set to this address and purpose "referral_payout"; answer it on POST /execution/fill/:quoteId/signatures. Read its type: on an EVM chain it is a transaction to broadcast (post the hash), on HyperCore an eip712 to sign (post the signature).
42Optional, and only with referralPayer "app": the chain the referrer is paid on. Must carry USDC. On an EVM chain the payout is an ERC-20 transfer the partner's wallet broadcasts, needing USDC plus native gas there; on HyperCore (1337) it is a user-signed sendAsset from the partner's HyperCore spot balance — a signature, nothing to broadcast — and the referrer receives spot USDC on Hyperliquid. A first payout to a referrer with no Hyperliquid account costs the partner an extra 1 USDC that Hyperliquid charges to create it; later payouts to the same referrer cost nothing. Solana does not support app-paid payouts and is refused. Defaults to the trade's fee chain, or Polygon when that chain is not EVM. Sending it with a user-paid referral is rejected with 400 referral_invalid.
x >= 1Must be a multiple of 1Response
200
Pass to POST /execution/fill to trade this quote.
The outcome requested.
Market of that outcome.
Price × shares before fees (proceeds on a sell). USD in 6-decimal atomic units, as an integer string (1000000 = $1.00).
ISO-8601. After this the quote cannot be filled.
ISO-8601, earlier than expiresAt: fetch a new quote from here on, though this one stays fillable until expiresAt.
ok when the quote can be filled; anything else means it cannot (see error). insufficient_balance: not enough funds. insufficient_position: not enough shares to sell (see positionAvailability). insufficient_depth / no_orderbooks / no_bids_above_min_price: not enough liquidity. min_order_size_violated / insufficient_input_amount: the amount is too small. infeasible, checker_rejected, solver_error, invalid_input, engine_unavailable: no valid route could be built.
ok, infeasible, checker_rejected, solver_error, invalid_input, no_orderbooks, insufficient_input_amount, engine_unavailable, min_order_size_violated, insufficient_balance, insufficient_position, insufficient_depth, no_bids_above_min_price Where the trade executes, one entry per venue market.
Show child attributes
Show child attributes
Total shares bought (or sold), as a float.
Price × shares across all fills, before fees (proceeds on a sell). USD, as a float.
Time to compute the route, in milliseconds.
Time to verify the route, in milliseconds.
The same market on other venues. Empty on sells.
Show child attributes
Show child attributes
Earliest time to request a new quote (rate-limited venues only).
A venue that could not be priced live; the quote excludes it.
Show child attributes
Show child attributes
Readable reason when status is not ok.
With compareVenues=true: the same trade priced on each venue alone, for comparison.
Show child attributes
Show child attributes
How the trade is funded, per source and venue.
Show child attributes
Show child attributes
Cross-chain transfers needed.
Show child attributes
Show child attributes
Cost of the trade, line by line.
Show child attributes
Show child attributes
App fee settings frozen at quote time, for reconciliation. null when the app charges no fee. For display use feeBreakdown.appFee.
Show child attributes
Show child attributes
The referral this quote pays; absent or null without a referrer.
Show child attributes
Show child attributes
Price impact of the route.
Show child attributes
Show child attributes
Best values each objective could reach on its own, for comparison.
Show child attributes
Show child attributes
Venues left out of the route or flagged, without blocking the quote.
Show child attributes
Show child attributes
Self-custody quotes only: the quote is valid but the fill from this wallet would be refused. Absent on managed quotes.
Show child attributes
Show child attributes
Informational note, e.g. on redemption.
Sell quotes on resolved markets only: winning shares are redeemed for their payout instead of sold.
Show child attributes
Show child attributes
Payout if the outcome wins, after settlement fees. USD, as a float.
All-in cost: feeBreakdown.totalCost + app fee + user-paid referral fee + any funding fee. USD, as a float.
estimatedPayout minus cost. USD, as a float.
Profit as a percentage of cost (25 = 25%).
Only when status is insufficient_position.
Show child attributes
Show child attributes