Get Open Positions (All Exchanges)
Positions
Get Open Positions
Fetch normalized open positions for a wallet across all connected derivatives venues (Lighter, Aster, Hyperliquid, Avantis)
GET
Get Open Positions (All Exchanges)
Fetch normalized open positions for a wallet across all connected derivatives venues. The aggregator fans out to Lighter, Aster, Hyperliquid, and Avantis, returning consistent leverage, collateral, and PnL metrics in one payload.
The
All Exchanges
- Method:
GET - Endpoint:
/api/trading/positions/all/{walletAddress} - Authentication: Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
walletAddress | string | ✅ | Wallet address to query across all venues |
Example
Sample Response
positions array contains one entry per venue position. Zero-size positions are automatically filtered out.
Single Exchange
- Method:
GET - Endpoint:
/api/trading/{exchange}/positions/{walletAddress} - Authentication: Required
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
exchange | string | ✅ | Venue to query (lighter, aster, hyperliquid, or avantis) |
walletAddress | string | ✅ | Wallet address to inspect on that venue |
Example
Sample Response
Aster - Get Positions
Get open positions on Aster exchange.Endpoint
GET /api/aster/perp/:walletId/positions
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
walletId | string | Yes | Wallet ID (UUID) |
Query Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
symbol | string | No | Filter by trading pair (e.g., “BTCUSDT”) |
Example Request
Success Response
Response Fields
| Field | Type | Description |
|---|---|---|
symbol | string | Trading pair |
positionAmt | string | Position size (positive for LONG, negative for SHORT) |
entryPrice | string | Average entry price |
markPrice | string | Current mark price |
unRealizedProfit | string | Unrealized PnL |
liquidationPrice | string | Liquidation price |
leverage | string | Current leverage |
marginType | string | ”cross” or “isolated” |
positionSide | string | ”BOTH”, “LONG”, or “SHORT” |
notional | string | Position notional value |
updateTime | number | Last update timestamp (ms) |
Avantis - Get Positions
Get open positions on Avantis exchange (perpetual trading on Base).Endpoint
GET /api/trading/positions/all/{walletAddress}
Avantis positions are returned within the aggregated positions response under data.positions.avantis.
Avantis Position Response Shape
Avantis Position Fields
| Field | Type | Description |
|---|---|---|
symbol | string | Asset symbol (e.g., “ETH”, “BTC”) |
exchange | string | Always "avantis" |
direction | string | "LONG" or "SHORT" |
size | string | Token amount (e.g., “0.032416”) |
entryPrice | string | Entry price in USD |
markPrice | string | Current mark price in USD |
liquidationPrice | string | Liquidation price in USD, or "-" |
unrealizedPnl | string | Unrealized PnL in USD (rollover fees only, no live PnL from backend) |
unrealizedPnlPercent | string | Unrealized PnL as percentage |
leverage | number | Position leverage |
collateral | string | Collateral in USDC |
margin | string | Margin in USDC |
timestamp | number | Position opened timestamp (ms) |
isZfp | boolean | Whether this is a zero-fee position |
walletAddress | string | Wallet address that owns the position |
Avantis
markPrice returned from the backend matches entryPrice — live mark prices are not provided by the backend. For real-time mark prices, use the client-side Pyth oracle price feed.Credential Payload
Supply only the credential blocks for venues you want to query. The service reads them per request and does not persist any keys.Errors
- 400 –
{ "success": false, "error": "Invalid wallet address format" } - 401 –
{ "success": false, "error": "Missing or invalid credentials for Aster" } - 500 –
{ "success": false, "error": "Failed to fetch open positions: timeout" }
Authorizations
API key for authentication. Also requires X-API-SECRET, X-API-TIMESTAMP, and X-API-SIGNATURE headers for private endpoints.
Path Parameters
Wallet address to query across all venues