Skip to main content
GET
/
orderbook
/
{venueMarketOutcomeId}
/
route
Compute order route
curl --request GET \
  --url https://api.agg.market/orderbook/{venueMarketOutcomeId}/route \
  --header 'x-app-id: <api-key>'
{
  "quoteId": "<string>",
  "venueMarketOutcomeId": "<string>",
  "venueMarketId": "<string>",
  "estimatedCostRaw": "<string>",
  "expiresAt": "<string>",
  "refreshAt": "<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,
      "venueFee": 123
    }
  ],
  "totalFilled": 123,
  "rawExecCost": 123,
  "solveTimeMs": 123,
  "verifyTimeMs": 123,
  "matchedMarkets": [
    {
      "venue": "<string>",
      "venueMarketId": "<string>"
    }
  ],
  "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,
          "venueFee": 123
        }
      ],
      "allocations": [
        {
          "sourceChainId": "<string>",
          "venue": "<string>",
          "amount": 123,
          "sourceTokenAddress": "<string>",
          "custodyAddress": "<string>",
          "exactToken": true
        }
      ],
      "bridgeSteps": [
        {
          "sourceChainId": "<string>",
          "destChainId": "<string>",
          "amount": 123,
          "cost": 123,
          "sourceTokenAddress": "<string>",
          "destTokenAddress": "<string>"
        }
      ],
      "setupCosts": [
        {
          "venue": "<string>",
          "costUsd": 123,
          "alreadyPaid": true,
          "chainId": 123,
          "venueMarketId": "<string>"
        }
      ],
      "setupCostsTotal": 123
    }
  ],
  "allocations": [
    {
      "sourceChainId": "<string>",
      "venue": "<string>",
      "amount": 123,
      "sourceTokenAddress": "<string>",
      "custodyAddress": "<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,
    "setupCosts": [
      {
        "venue": "<string>",
        "costUsd": 123,
        "alreadyPaid": true,
        "chainId": 123,
        "venueMarketId": "<string>"
      }
    ],
    "setupCostsTotal": 123,
    "appFee": 123,
    "appFeeBips": 123,
    "appFeeCategory": "<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>"
    }
  ],
  "message": "<string>",
  "estimatedPayout": 123,
  "totalCostIncFees": 123,
  "estimatedProfit": 123,
  "returnPct": 123,
  "positionAvailability": {
    "totalSellableShares": 123,
    "venueMarketOutcomes": [
      {
        "id": "<string>",
        "venue": "<string>",
        "venueMarketId": "<string>",
        "availableShares": 123
      }
    ]
  }
}

Authorizations

x-app-id
string
header
required

Your application ID. Required for all app-tier and user-tier routes.

Path Parameters

venueMarketOutcomeId
string
required

Query Parameters

mode
enum<string>
Available options:
live,
paper
chainBalances
string
slipCapBps
number
Required range: x >= 0
maxSpend
number
Required range: x > 0
sellShares
number
Required range: x > 0
compareVenues
enum<string>
Available options:
true,
false
allowedVenues
Available options:
kalshi,
polymarket,
limitless,
opinion,
predict,
probable,
myriad,
hyperliquid
side
enum<string>
Available options:
buy,
sell
deepEstimate
enum<string>
Available options:
true,
false

Response

200

quoteId
string
required
venueMarketOutcomeId
string
required
venueMarketId
string
required
estimatedCostRaw
string
required
expiresAt
string
required
refreshAt
string
required
status
enum<string>
required
Available options:
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
fills
object[]
required
totalFilled
number
required
rawExecCost
number
required
solveTimeMs
number
required
verifyTimeMs
number
required
matchedMarkets
object[]
required
error
string
venueSoloQuotes
object[]
allocations
object[]
bridgeSteps
object[]
feeBreakdown
object
slippage
object
optima
object
warnings
object[]
message
string
estimatedPayout
number
totalCostIncFees
number
estimatedProfit
number
returnPct
number
positionAvailability
object