Position
Returns a filtered list of positions for a given subaccount
Changed onget/v1/position
Request
- Base URLhttps://api.ethereal.trade
- Authnone declared
- TypeScriptA function with typed inputs. Its response is checked against the schema.
Query parameters
order'asc' | 'desc'
Direction to paginate through objects
limitinteger
Limit the number of objects to return
cursorstring
Pointer to the current object in pagination dataset
subaccountIdstring uuid required
Id representing the registered subaccount
productIdsstring[]
Array of product ids to filter for
openboolean
Example:true
Include or exclude open positions (i.e. non-zero size)
orderBy'size' | 'createdAt' | 'updatedAt' | 'realizedPnl'
Example:size
Order by field
createdAfterinteger
Filter by order fills created before timestamp exclusive (ms since Unix epoch)
createdBeforeinteger
Filter by order fills created before timestamp inclusive (ms since Unix epoch)
side0 | 1
Side as either BUY (0) or SELL (1)
isLiquidatedboolean
Filter by liquidated positions
Response
Example response
{
"data": [
{
"cost": "9.3",
"createdAt": 1712019600000,
"feesAccruedUsd": "0.5",
"fundingAccruedUsd": "10.5",
"fundingUsd": "1.35",
"id": "9036443a-441a-4a66-87f2-bd5c44cdca7a",
"isLiquidated": true,
"liquidationPrice": "1200.5",
"productId": "9c6bf870-a8ce-4de3-820b-542fd5c049ba",
"realizedPnl": "-12.5",
"size": "1.5",
"totalDecreaseNotional": "1050.0",
"totalDecreaseQuantity": "2.5",
"totalIncreaseNotional": "1000.0",
"totalIncreaseQuantity": "2.5",
"unrealizedPnl": "4.2",
"updatedAt": 1712019600000,
"wasDeleveraged": true
}
],
"hasNext": true
}Changes
- info
added the non-success response with the status
- info