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,
) -> AnyUnification Plan
- Rename all methods to
get_asset_positions- shorter is better. - Add a
Subaccountpair to Python and JavaScript, since it's always a pair - Add options to the Rust version
- Rename
created_before_or_at_timeparameter tocreated_before_or_at - Rename
PerpetualPositionStatustoPositionStatus
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
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.
| Status | Meaning | Schema | Description |
|---|---|---|---|
200 | OK | AssetPositionResponseObject ⛁ | The asset positions data. |