Skip to main content

Place Trading Orders

Execute trading orders on supported exchanges. Each exchange has its own endpoint with specific requirements.

Supported Exchanges

Lighter DEX Requirement: Before using Lighter, you must:
  1. Create an account on Lighter DEX
  2. Deposit funds on Lighter
  3. Generate API keys from Lighter dashboard
  4. Provide credentials as query parameters

Aster - Place Order

Execute orders on Aster exchange for perpetual futures trading.

Endpoint

POST /api/aster/perp/:walletId/order

Path Parameters

Request Body

Request Parameters

Order Types

  • MARKET - Execute immediately at best price
  • LIMIT - Execute only at specified price
  • STOP_MARKET - Stop loss (market execution)
  • TAKE_PROFIT_MARKET - Take profit (market execution)

Position Sides

  • BOTH - One-way mode (default) - single position per symbol
  • LONG - Long position (hedge mode)
  • SHORT - Short position (hedge mode)

Time in Force

  • GTC - Good Till Cancel (default)
  • IOC - Immediate or Cancel
  • FOK - Fill or Kill

Example Request

Success Response


Hyperliquid - Place Order

Execute orders on Hyperliquid exchange for perpetual futures trading.

Endpoint

POST /api/trading/hyperliquid/orders

Headers

Request Body

Request Parameters

Hyperliquid uses simple asset symbols like BTC, ETH, HYPE. The price field should be provided for both MARKET and LIMIT orders.

Example Request

Success Response


Lighter - Place Order

Execute orders on Lighter DEX using API credentials from your Lighter account.

Endpoint

POST /api/trading/lighter/orders

Query Parameters (Required)

These credentials must be obtained from your Lighter DEX account dashboard.

Full Example URL

Request Body

Request Parameters

Lighter uses spot token symbols like “USDC”. Quantity is in base asset units.

Example Request

Success Response


Avantis - Place Order (Client-Side Execution)

Avantis trades are executed client-side via on-chain transactions on the Base network. Unlike other exchanges, orders are not routed through the Tide backend — the frontend signs and submits transactions directly to Avantis smart contracts.
Avantis execution uses client-side wallet signing via the useAvantisTrade React hook. The Tide backend provides data only (positions, orders, history, balances). Trade execution happens on-chain.

Open Position

Request Parameters

Order Types

Leverage Limits

Precision

Supported Pairs

Contract Addresses (Base Mainnet)


Error Responses

400 Bad Request - Missing Parameters

400 Bad Request - Invalid Order Type

401 Unauthorized - Missing Wallet ID

403 Forbidden - Invalid API Credentials (Lighter)

500 Internal Server Error


Order Types

Market Orders

Execute immediately at the best available price.

Limit Orders

Execute only at the specified price or better.

Important Notes

Lighter API Credentials: Never expose your Lighter API credentials in client-side code. Always make requests from your secure backend server.
Wallet ID Header: For Aster and Hyperliquid, you must include the x-wallet-id header with your server wallet ID.
Reduce Only: Set reduceOnly: true to ensure orders only close existing positions and don’t open new ones.
Symbol Formats:
  • Aster: BTCUSDT, ETHUSDT
  • Hyperliquid: BTC, ETH, HYPE (simple asset symbols)
  • Lighter: USDC, USDT
  • Avantis: ETH, BTC, SOL (simple asset symbols, mapped to pair index)