Skip to content

Get Parent Historical Pnl

Query for profit and loss report for the specified time/block range of a parent subaccount.

Method Declaration

Python
async def get_parent_historical_pnls(
    self,
    address: str,
    subaccount_number: int,
    limit: Optional[int] = None,
    created_before_or_at_height: Optional[int] = None,
    created_before_or_at: Optional[str] = None,
    created_on_or_after_height: Optional[int] = None,
    created_on_or_after: Optional[str] = None,
) -> Any:

Parameters

ParameterLocationTypeRequiredDescription
addressqueryAddresstrueThe wallet address that owns the parent subaccount.
parentSubaccountNumberquerySubaccountNumbertrueThe identifier for the specific subaccount within the wallet address.
limitqueryu32falseMaximum number of asset positions to return in the response.
createdBeforeOrAtHeightqueryHeightfalseRestricts results to positions created at or before a specific blockchain height.
createdBeforeOrAtqueryDateTime in UTCfalseRestricts results to positions created at or before a specific timestamp (ISO 8601 format).
createdOnOrAfterHeightqueryHeightfalseRestricts results to positions created on or after a specific blockchain height.
createdOnOrAfterqueryDateTime in UTCfalseRestricts results to positions created on or after a specific timestamp (ISO 8601 format).

Response

StatusMeaningSchemaDescription
200OKPnlTicksResponseObject ⛁The historical PnLs data.
400Bad RequestThe request was malformed or invalid.
404Not FoundThe parent subaccount was not found.
API Example