Execute Smart Order
Trading
Execute Smart Order
Executes a trade by automatically routing it to the exchange with the best price, or to a preferred exchange if specified.
POST
Execute Smart Order
Executes a trade by automatically routing it to the exchange with the best price, or to a preferred exchange if specified.
Features
- Unified order primitive: Access market and limit orders through one endpoint
- Routing flexibility: Auto-route or pin to a preferred exchange per request
- Advanced controls: Configure reduce-only behaviour and custom quantities
- Rich telemetry: Responses include routing decisions, pricing, and execution latency
Use Cases
- Power algorithmic trading systems needing granular order flags
- Build discretionary trading interfaces that display execution venue rationale
- Prototype new strategies without managing venue-specific adapters
Request
- Method:
POST - Endpoint:
/api/trade/execute - Headers:
Content-Type:application/jsonAuthorization:Bearer <token>
Request Fields
| Field | Type | Required | Description |
|---|---|---|---|
symbol | string | ✅ | Trading pair symbol (e.g., “BTC”, “ETH”) |
side | string | ✅ | Order side: BUY or SELL |
type | string | ✅ | Order type: MARKET or LIMIT |
quantity | string | ✅ | Amount of base asset to trade |
price | string | ❌ | Limit price. Required if type is LIMIT |
reduceOnly | boolean | ❌ | If true, the order will only reduce an existing position (default: false) |
preferredExchange | string | ❌ | Force execution on a specific exchange: hyperliquid, aster, lighter, or avantis |
Example Request
Success Response
Response Fields
| Field | Type | Description |
|---|---|---|
data.executedOn | string | Exchange where the order was executed |
data.order.orderId | string | Unique order identifier |
data.order.symbol | string | Trading pair symbol |
data.order.status | string | Order status (e.g., “FILLED”) |
data.order.price | number | Execution price |
data.order.quantity | number | Order quantity |
data.order.side | string | Order side (“BUY” or “SELL”) |
data.routing.recommended | string | Recommended exchange |
data.routing.price | number | Best execution price |
data.routing.reason | string | Reason for exchange selection |
data.routing.savings | number | Estimated savings vs next-best venue |
data.routing.savingsPercent | number | Savings as percentage |
data.routing.alternatives | object | Pricing from all available exchanges |
data.execution.latencyMs | number | Execution latency in milliseconds |
Error Responses
400 Bad Request - Missing Required Fields
401 Unauthorized - Invalid Token
500 Internal Server Error
When to Use
- Implement custom order flows while still benefiting from smart routing
- Execute trades with automatic best-price venue selection
- Run discretionary trades while preserving reduce-only protections
Avantis: When Avantis is selected as the execution venue, trades are executed client-side on the Base network via wallet signing, not through the Tide backend. The routing recommendation may include Avantis pricing for comparison.
Authorizations
JWT token for authentication. Required for smart order execution.
Body
application/json
Trading pair symbol (e.g., 'BTC', 'ETH')
Example:
"BTC"
Order side
Available options:
BUY, SELL Order type
Available options:
MARKET, LIMIT Amount of base asset to trade
Example:
"0.1"
Limit price. Required if type is LIMIT
If true, the order will only reduce an existing position
Force execution on a specific exchange
Available options:
hyperliquid, aster, lighter