Skip to content

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

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the account.
subaccountNumberquerySubaccountNumbertrueThe identifier for the specific subaccount within the wallet address.
statusqueryPerpetualPositionStatusfalseFilter to retrieve positions with a specific status. If not provided, all positions will be returned regardless of status.
limitqueryu32falseMaximum number of asset positions to return in the response.
createdBeforeOrAtHeightqueryHeightfalseRestricts results to positions created at or before a specific blockchain height.
createdBeforeOrAtqueryDateTimefalseRestricts results to positions created at or before a specific timestamp (ISO 8601 format).

Response

StatusMeaningSchemaDescription
200OKPerpetualPositionResponseObjectThe perpetual positions data.
400Bad RequestThe request was malformed or invalid.
404Not FoundThe subaccount was not found.

API Example

Examples: Guide - List Positions