List Positions
Retrieves perpetual positions for a specific subaccount. Both open and closed/historical positions can be queried.
Method Declaration
Python
async def get_subaccount_perpetual_positions(
self,
address: str,
subaccount_number: int,
status: Optional[PositionStatus] = None,
limit: Optional[int] = None,
created_before_or_at_height: Optional[int] = None,
created_before_or_at: Optional[str] = None,
) -> Any
Unification Plan
Parameters
Parameter | Location | Type | Required | Description |
---|---|---|---|---|
address | query | Address | true | The wallet address that owns the account. |
subaccountNumber | query | SubaccountNumber | true | The identifier for the specific subaccount within the wallet address. |
status | query | PerpetualPositionStatus | false | Filter to retrieve positions with a specific status. If not provided, all positions will be returned regardless of status. |
limit | query | u32 | false | Maximum number of asset positions to return in the response. |
createdBeforeOrAtHeight | query | Height | false | Restricts results to positions created at or before a specific blockchain height. |
createdBeforeOrAt | query | DateTime | false | Restricts results to positions created at or before a specific timestamp (ISO 8601 format). |
Response
Status | Meaning | Schema | Description |
---|---|---|---|
200 | OK | PerpetualPositionResponseObject ⛁ | The perpetual positions data. |
400 | Bad Request | The request was malformed or invalid. | |
404 | Not Found | The subaccount was not found. |
API Example
Examples: Guide - List Positions