Skip to main content
GET
/
api
/
trade
/
routing
/
{symbol}
Get Routing Recommendation
curl --request GET \
  --url https://api.dexaggregatorbeta.xyz/api/trade/routing/{symbol} \
  --header 'X-API-KEY: <api-key>'
{
  "success": true,
  "data": {
    "symbol": "BTC",
    "side": "BUY",
    "routing": {
      "recommended": "lighter",
      "price": 88308.1,
      "reason": "Best ask price",
      "savings": 10.5,
      "savingsPercent": 0.012,
      "alternatives": {
        "hyperliquid": {
          "price": 89207,
          "available": true
        },
        "aster": {
          "price": 89221.9,
          "available": true
        },
        "lighter": {
          "price": 88308.1,
          "available": true
        }
      }
    }
  },
  "timestamp": 123
}
Fetches the current best exchange and price for a symbol without executing a trade. The response shows which exchange currently offers the best price along with alternative venues and pricing context.

Features

  • Real-time insights: Surface the venue offering the best bid or ask instantly
  • Contextual pricing: Includes savings metrics and alternative venue pricing
  • Configurable direction: Toggle BUY or SELL recommendations via query params
  • Credential-free: Preview routing outcomes without submitting trade credentials

Use Cases

  • Power pre-trade analytics or UI previews before executing a position
  • Monitor venue spreads to decide when to re-route algorithmic order flow
  • Feed routing data into risk systems to anticipate liquidity constraints
  • Provide traders with transparency on venue selection logic in dashboards

Request

  • Method: GET
  • Endpoint: /api/trade/routing/{symbol}
  • Path Parameter: symbol (e.g., BTC, ETH, SOL)
  • Query Parameter: side (required) - BUY or SELL

Example Request

curl -X GET "https://api.dexaggregatorbeta.xyz/api/trade/routing/BTC?side=BUY"

Success Response

{
  "success": true,
  "data": {
    "symbol": "BTC",
    "side": "BUY",
    "routing": {
      "recommended": "lighter",
      "price": 88308.1,
      "reason": "Best ask price",
      "savings": 10.50,
      "savingsPercent": 0.012,
      "alternatives": {
        "hyperliquid": { "price": 89207, "available": true },
        "aster": { "price": 89221.9, "available": true },
        "lighter": { "price": 88308.1, "available": true }
      }
    }
  },
  "timestamp": 1678900000000
}

Response Fields

FieldTypeDescription
symbolstringAsset symbol passed in the request
sidestringBUY or SELL
routing.recommendedstringExchange that currently offers the best execution
routing.pricenumberBest execution price
routing.reasonstringWhy the exchange was selected
routing.savingsnumberEstimated savings (in quote asset) compared to next-best venue
routing.savingsPercentnumberPercent improvement over alternatives
routing.alternativesobjectPricing details for each supported exchange

Error Responses

404 Not Found - No Routing Data

{
  "success": false,
  "error": "No routing data available for symbol",
  "timestamp": 1678900000000
}
Use this endpoint to preview which venue will be selected before placing a trade, or to power UI components that surface best-exchange insights in real-time.

Authorizations

X-API-KEY
string
header
required

API key for authentication. Also requires X-API-SECRET, X-API-TIMESTAMP, and X-API-SIGNATURE headers for private endpoints.

Path Parameters

symbol
string
required

Asset symbol (e.g., BTC, ETH)

Example:

"BTC"

Query Parameters

side
enum<string>
required

Order side (BUY or SELL)

Available options:
BUY,
SELL

Response

Routing recommendation

success
boolean
data
object
timestamp
integer