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": "<string>",
"venueMarketOutcomeId": "<string>",
"venueMarketId": "<string>",
"estimatedCostRaw": "<string>",
"expiresAt": "<string>",
"refreshAt": "<string>",
"status": "ok",
"fills": [
{
"venue": "<string>",
"venueMarketId": "<string>",
"venueMarketOutcomeId": "<string>",
"chain": "<string>",
"avgPrice": 123,
"yesPrice": 123,
"noPrice": 123,
"fills": [
{
"price": 123,
"size": 123,
"fill": 123
}
],
"venueQty": 123,
"inAmount": "<string>",
"outAmount": "<string>",
"limitPriceMicroUsdc": "<string>",
"venueFee": 123,
"builderFee": 123,
"settlementFee": 123
}
],
"totalFilled": 123,
"rawExecCost": 123,
"solveTimeMs": 123,
"verifyTimeMs": 123,
"matchedMarkets": [
{
"venue": "<string>",
"venueMarketId": "<string>"
}
],
"quoteRefreshNotBefore": "2023-11-07T05:31:56Z",
"quoteFailure": {
"venue": "<string>",
"code": "<string>",
"retryAt": "2023-11-07T05:31:56Z"
},
"error": "<string>",
"venueSoloQuotes": [
{
"quoteId": "<string>",
"venue": "<string>",
"avgPrice": 123,
"filledQty": 123,
"rawExecCost": 123,
"estimatedPayout": 123,
"estimatedProfit": 123,
"returnPct": 123,
"status": "<string>",
"fills": [
{
"venue": "<string>",
"venueMarketId": "<string>",
"venueMarketOutcomeId": "<string>",
"chain": "<string>",
"avgPrice": 123,
"yesPrice": 123,
"noPrice": 123,
"fills": [
{
"price": 123,
"size": 123,
"fill": 123
}
],
"venueQty": 123,
"inAmount": "<string>",
"outAmount": "<string>",
"limitPriceMicroUsdc": "<string>",
"venueFee": 123,
"builderFee": 123,
"settlementFee": 123
}
],
"quoteFailure": {
"venue": "<string>",
"code": "<string>",
"retryAt": "2023-11-07T05:31:56Z"
},
"unavailableReason": "<string>",
"venueMarketOutcomeId": "<string>",
"allocations": [
{
"sourceChainId": "<string>",
"venue": "<string>",
"amount": 123,
"sourceTokenAddress": "<string>",
"custodyKind": "EOA",
"custodyAddress": "<string>",
"sourceAddress": "<string>",
"exactToken": true
}
],
"bridgeSteps": [
{
"sourceChainId": "<string>",
"destChainId": "<string>",
"amount": 123,
"cost": 123,
"sourceTokenAddress": "<string>",
"destTokenAddress": "<string>"
}
],
"setupCosts": [
{
"kind": "chainApproval",
"venue": "<string>",
"costUsd": 123,
"alreadyPaid": true,
"chainId": 123,
"venueMarketId": "<string>"
}
],
"setupCostsTotal": 123,
"feeBreakdown": {
"rawExecCost": 123,
"venueFees": 123,
"bridgeFees": 123,
"executionGas": 123,
"totalCost": 123,
"builderFee": 123,
"executionReserve": 1,
"appFee": 123,
"appFeeBips": 123,
"appFeeCategory": "<string>"
}
}
],
"allocations": [
{
"sourceChainId": "<string>",
"venue": "<string>",
"amount": 123,
"sourceTokenAddress": "<string>",
"custodyKind": "EOA",
"custodyAddress": "<string>",
"sourceAddress": "<string>",
"exactToken": true
}
],
"bridgeSteps": [
{
"sourceChainId": "<string>",
"destChainId": "<string>",
"amount": 123,
"cost": 123,
"sourceTokenAddress": "<string>",
"destTokenAddress": "<string>"
}
],
"feeBreakdown": {
"rawExecCost": 123,
"venueFees": 123,
"bridgeFees": 123,
"executionGas": 123,
"totalCost": 123,
"builderFee": 123,
"executionReserve": 1,
"setupCosts": [
{
"kind": "chainApproval",
"venue": "<string>",
"costUsd": 123,
"alreadyPaid": true,
"chainId": 123,
"venueMarketId": "<string>"
}
],
"setupCostsTotal": 123,
"appFee": 123,
"appFeeBips": 123,
"appFeeCategory": "<string>"
},
"appFee": {
"bips": 123,
"categoryKey": "<string>",
"quotedAppFeeRaw": "<string>"
},
"slippage": {
"vwap": 123,
"refMidpoint": 123,
"slippage": 123,
"slippageBps": 123
},
"optima": {
"maxFilledQty": 123,
"minSlippage": 123,
"minCost": 123,
"minRisk": 123,
"minBridges": 123,
"minVenues": 123
},
"warnings": [
{
"venue": "<string>",
"venueMarketOutcomeId": "<string>",
"reason": "<string>"
}
],
"custodyWarnings": [
{
"reason": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"settlementPlan": {
"redeemId": "<string>",
"status": "redeem_only",
"message": "<string>",
"totalRedeemableShares": 123,
"totalRedeemShares": 123,
"totalSellShares": 123,
"redeemLegs": [
{
"action": "redeem",
"venue": "<string>",
"venueMarketId": "<string>",
"venueMarketOutcomeId": "<string>",
"positionId": "<string>",
"size": "<string>",
"redeemPath": "evm"
}
]
},
"estimatedPayout": 123,
"totalCostIncFees": 123,
"estimatedProfit": 123,
"returnPct": 123,
"positionAvailability": {
"totalSellableShares": 123,
"venueMarketOutcomes": [
{
"id": "<string>",
"venue": "<string>",
"venueMarketId": "<string>",
"availableShares": 123
}
]
}
}{
"message": "<string>",
"code": "quote_not_found"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"code": "orderbook_service_unavailable",
"message": "<string>",
"retryable": true
}Compute order 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 clearing-house readiness request. CH identity and readiness are validated when a live fill is submitted, before funding or execution is queued. ProphetX quotes apply no execution reserve, CH surcharge, or speculative venue commission. ProphetX live buys use fixed-input FOK execution and a maximum $100 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": "<string>",
"venueMarketOutcomeId": "<string>",
"venueMarketId": "<string>",
"estimatedCostRaw": "<string>",
"expiresAt": "<string>",
"refreshAt": "<string>",
"status": "ok",
"fills": [
{
"venue": "<string>",
"venueMarketId": "<string>",
"venueMarketOutcomeId": "<string>",
"chain": "<string>",
"avgPrice": 123,
"yesPrice": 123,
"noPrice": 123,
"fills": [
{
"price": 123,
"size": 123,
"fill": 123
}
],
"venueQty": 123,
"inAmount": "<string>",
"outAmount": "<string>",
"limitPriceMicroUsdc": "<string>",
"venueFee": 123,
"builderFee": 123,
"settlementFee": 123
}
],
"totalFilled": 123,
"rawExecCost": 123,
"solveTimeMs": 123,
"verifyTimeMs": 123,
"matchedMarkets": [
{
"venue": "<string>",
"venueMarketId": "<string>"
}
],
"quoteRefreshNotBefore": "2023-11-07T05:31:56Z",
"quoteFailure": {
"venue": "<string>",
"code": "<string>",
"retryAt": "2023-11-07T05:31:56Z"
},
"error": "<string>",
"venueSoloQuotes": [
{
"quoteId": "<string>",
"venue": "<string>",
"avgPrice": 123,
"filledQty": 123,
"rawExecCost": 123,
"estimatedPayout": 123,
"estimatedProfit": 123,
"returnPct": 123,
"status": "<string>",
"fills": [
{
"venue": "<string>",
"venueMarketId": "<string>",
"venueMarketOutcomeId": "<string>",
"chain": "<string>",
"avgPrice": 123,
"yesPrice": 123,
"noPrice": 123,
"fills": [
{
"price": 123,
"size": 123,
"fill": 123
}
],
"venueQty": 123,
"inAmount": "<string>",
"outAmount": "<string>",
"limitPriceMicroUsdc": "<string>",
"venueFee": 123,
"builderFee": 123,
"settlementFee": 123
}
],
"quoteFailure": {
"venue": "<string>",
"code": "<string>",
"retryAt": "2023-11-07T05:31:56Z"
},
"unavailableReason": "<string>",
"venueMarketOutcomeId": "<string>",
"allocations": [
{
"sourceChainId": "<string>",
"venue": "<string>",
"amount": 123,
"sourceTokenAddress": "<string>",
"custodyKind": "EOA",
"custodyAddress": "<string>",
"sourceAddress": "<string>",
"exactToken": true
}
],
"bridgeSteps": [
{
"sourceChainId": "<string>",
"destChainId": "<string>",
"amount": 123,
"cost": 123,
"sourceTokenAddress": "<string>",
"destTokenAddress": "<string>"
}
],
"setupCosts": [
{
"kind": "chainApproval",
"venue": "<string>",
"costUsd": 123,
"alreadyPaid": true,
"chainId": 123,
"venueMarketId": "<string>"
}
],
"setupCostsTotal": 123,
"feeBreakdown": {
"rawExecCost": 123,
"venueFees": 123,
"bridgeFees": 123,
"executionGas": 123,
"totalCost": 123,
"builderFee": 123,
"executionReserve": 1,
"appFee": 123,
"appFeeBips": 123,
"appFeeCategory": "<string>"
}
}
],
"allocations": [
{
"sourceChainId": "<string>",
"venue": "<string>",
"amount": 123,
"sourceTokenAddress": "<string>",
"custodyKind": "EOA",
"custodyAddress": "<string>",
"sourceAddress": "<string>",
"exactToken": true
}
],
"bridgeSteps": [
{
"sourceChainId": "<string>",
"destChainId": "<string>",
"amount": 123,
"cost": 123,
"sourceTokenAddress": "<string>",
"destTokenAddress": "<string>"
}
],
"feeBreakdown": {
"rawExecCost": 123,
"venueFees": 123,
"bridgeFees": 123,
"executionGas": 123,
"totalCost": 123,
"builderFee": 123,
"executionReserve": 1,
"setupCosts": [
{
"kind": "chainApproval",
"venue": "<string>",
"costUsd": 123,
"alreadyPaid": true,
"chainId": 123,
"venueMarketId": "<string>"
}
],
"setupCostsTotal": 123,
"appFee": 123,
"appFeeBips": 123,
"appFeeCategory": "<string>"
},
"appFee": {
"bips": 123,
"categoryKey": "<string>",
"quotedAppFeeRaw": "<string>"
},
"slippage": {
"vwap": 123,
"refMidpoint": 123,
"slippage": 123,
"slippageBps": 123
},
"optima": {
"maxFilledQty": 123,
"minSlippage": 123,
"minCost": 123,
"minRisk": 123,
"minBridges": 123,
"minVenues": 123
},
"warnings": [
{
"venue": "<string>",
"venueMarketOutcomeId": "<string>",
"reason": "<string>"
}
],
"custodyWarnings": [
{
"reason": "<string>",
"message": "<string>"
}
],
"message": "<string>",
"settlementPlan": {
"redeemId": "<string>",
"status": "redeem_only",
"message": "<string>",
"totalRedeemableShares": 123,
"totalRedeemShares": 123,
"totalSellShares": 123,
"redeemLegs": [
{
"action": "redeem",
"venue": "<string>",
"venueMarketId": "<string>",
"venueMarketOutcomeId": "<string>",
"positionId": "<string>",
"size": "<string>",
"redeemPath": "evm"
}
]
},
"estimatedPayout": 123,
"totalCostIncFees": 123,
"estimatedProfit": 123,
"returnPct": 123,
"positionAvailability": {
"totalSellableShares": 123,
"venueMarketOutcomes": [
{
"id": "<string>",
"venue": "<string>",
"venueMarketId": "<string>",
"availableShares": 123
}
]
}
}{
"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, probable, myriad, hyperliquid, novig, prophetx buy, sell true, false 4242Response
200
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 Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes