Skip to content

Get Asset Positions

Retrieves asset positions and respective details of a specific subaccount.

Method Declaration

Python
async def get_subaccount_asset_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
  • Rename all methods to get_asset_positions - shorter is better.
  • Add a Subaccount pair to Python and JavaScript, since it's always a pair
  • Add options to the Rust version
  • Rename created_before_or_at_time parameter to created_before_or_at
  • Rename PerpetualPositionStatus to PositionStatus

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

A data structure containing the requested asset positions. Typically includes details such as asset ID, size, side (buy/sell), entry price, realized PnL, and other position-specific information.

StatusMeaningSchemaDescription
200OKAssetPositionResponseObject ⛁The asset positions data.
API Example