> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tide.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Routing Recommendation

> Fetches the current best exchange and price for a symbol without executing a trade.

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

```bash theme={null}
curl -X GET "https://api.tide.ag/api/trade/routing/BTC?side=BUY"
```

## Success Response

```json theme={null}
{
  "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 },
        "avantis": { "price": 89150.5, "available": true }
      }
    }
  },
  "timestamp": 1678900000000
}
```

## Response Fields

| Field                    | Type   | Description                                                    |
| ------------------------ | ------ | -------------------------------------------------------------- |
| `symbol`                 | string | Asset symbol passed in the request                             |
| `side`                   | string | `BUY` or `SELL`                                                |
| `routing.recommended`    | string | Exchange that currently offers the best execution              |
| `routing.price`          | number | Best execution price                                           |
| `routing.reason`         | string | Why the exchange was selected                                  |
| `routing.savings`        | number | Estimated savings (in quote asset) compared to next-best venue |
| `routing.savingsPercent` | number | Percent improvement over alternatives                          |
| `routing.alternatives`   | object | Pricing details for each supported exchange                    |

## Error Responses

### 404 Not Found - No Routing Data

```json theme={null}
{
  "success": false,
  "error": "No routing data available for symbol",
  "timestamp": 1678900000000
}
```

<Tip>
  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.
</Tip>


## OpenAPI

````yaml GET /api/trade/routing/{symbol}
openapi: 3.1.0
info:
  title: Tide API
  description: >-
    Decentralized Perpetual Aggregator API for multi-exchange trading across
    Hyperliquid, Aster, Lighter, and Pacifica
  version: 1.0.0
  contact:
    name: Tide Support
    email: support@tide.ag
    url: https://tide.ag
  license:
    name: MIT
servers:
  - url: https://api.tide.ag
    description: Production server
security:
  - ApiKeyAuth: []
tags:
  - name: Market Data
    description: Public market data endpoints
  - name: Trading
    description: Order placement and management
  - name: Positions
    description: Position management and history
  - name: Account
    description: Account and balance management
  - name: System
    description: System status and health
paths:
  /api/trade/routing/{symbol}:
    get:
      tags:
        - Trading
      summary: Get Routing Recommendation
      description: >-
        Fetches the current best exchange and price for a symbol without
        executing a trade.
      parameters:
        - name: symbol
          in: path
          required: true
          schema:
            type: string
            example: BTC
          description: Asset symbol (e.g., BTC, ETH)
        - name: side
          in: query
          required: true
          schema:
            type: string
            enum:
              - BUY
              - SELL
          description: Order side (BUY or SELL)
      responses:
        '200':
          description: Routing recommendation
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  data:
                    type: object
                    properties:
                      symbol:
                        type: string
                        example: BTC
                      side:
                        type: string
                        enum:
                          - BUY
                          - SELL
                      routing:
                        type: object
                        properties:
                          recommended:
                            type: string
                            enum:
                              - hyperliquid
                              - aster
                              - lighter
                            example: lighter
                          price:
                            type: number
                            example: 88308.1
                          reason:
                            type: string
                            example: Best ask price
                          savings:
                            type: number
                            example: 10.5
                          savingsPercent:
                            type: number
                            example: 0.012
                          alternatives:
                            type: object
                            properties:
                              hyperliquid:
                                type: object
                                properties:
                                  price:
                                    type: number
                                    example: 89207
                                  available:
                                    type: boolean
                                    example: true
                              aster:
                                type: object
                                properties:
                                  price:
                                    type: number
                                    example: 89221.9
                                  available:
                                    type: boolean
                                    example: true
                              lighter:
                                type: object
                                properties:
                                  price:
                                    type: number
                                    example: 88308.1
                                  available:
                                    type: boolean
                                    example: true
                  timestamp:
                    type: integer
        '404':
          description: No routing data available for the symbol
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                    example: No routing data available for symbol
                  timestamp:
                    type: integer
components:
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY
      description: >-
        API key for authentication. Also requires X-API-SECRET, X-API-TIMESTAMP,
        and X-API-SIGNATURE headers for private endpoints.

````