Close Position
Trading
Close Position
Close an existing position using a reduce-only order
POST
Close Position
Close an existing position using a reduce-only order. The router mirrors the behaviour of the open endpoint—scanning all supported venues for the best exit price unless you force a specific exchange.
Optional - Close specific side:
Features
- Reduce-only safety: Guarantees the API only decreases exposure
- Smart venue selection: Routes exits to the venue with the best available price
- Partial or full closes: Specify any size up to the total position
- Consistent payloads: Response structure matches the open position endpoint for easy reconciliation
Use Cases
- Automate take-profit or stop-loss workflows across multiple exchanges
- Build UI flows for one-click position unwinds
- Implement partial de-risking strategies using precise quantities
- Maintain audit trails with routing and execution metadata in a single response
Request
- Method:
POST - Endpoint:
/api/trade/position/close - Authentication: Required
Request Fields
The response mirrors the Open Position endpoint, returning execution, routing, and position data so you can reconcile final fills.
Usage Tips
- Reduce-only semantics ensure the API never increases exposure while closing.
- Provide credentials only for venues you wish to use; missing credentials remove that venue from routing consideration.
- For partial closes, set
sizeto the exact quantity you want to reduce.
Hyperliquid - Close Single Position
Close a specific open position for a given symbol on Hyperliquid.Endpoint
POST /api/hyperliquid/:walletId/positions/close/:symbol
Path Parameters
Headers
Request Body
Request Parameters
Example Request
Success Response
Hyperliquid - Close All Positions
Close all open positions for the wallet on Hyperliquid.Endpoint
POST /api/hyperliquid/:walletId/positions/close-all
Path Parameters
Headers
Request Body
Same schema as close-single-symbol.Example Request
Success Response
Aster - Close Position
Close positions on Aster exchange with a single API call.Endpoint
POST /api/aster/perp/:walletId/close-position
Path Parameters
Request Body
Request Parameters
Example Request
Success Response
Avantis - Close Position (Client-Side Execution)
Avantis positions are closed client-side via on-chain transactions on the Base network. Like opening, closing is not routed through the Tide backend.Close by Pair and Trade Index
Close by Symbol and Direction
Request Parameters
Close by Symbol Parameters
The close operation uses
initialPosToken (not positionSizeUSDC) for the collateral amount, read from TradingStorage.openTrades() on-chain.Authorizations
API key for authentication. Also requires X-API-SECRET, X-API-TIMESTAMP, and X-API-SIGNATURE headers for private endpoints.
Body
application/json
Asset symbol being closed
Available options:
LONG, SHORT Quantity to close
Available options:
LIMIT, MARKET, STOP_MARKET, STOP_LIMIT Required when orderType is LIMIT
Available options:
hyperliquid, aster, lighter, pacifica