The examples on this page use Hyperliquid (
provider: 'hyperliquid'). Replace the provider value with any supported DEX from getProviders().getPortfolioHistory is a method on the SDK client, not a standalone imported function.
Parameters
PortfolioHistoryRange
PortfolioHistoryRange is a string union imported from @lifi/perps-sdk.
Returns
PortfolioHistoryResponse:
PortfolioHistoryPoint fields
Auth requirements
Each provider reads portfolio history with its own credential. The requirement is per provider.Hyperliquid
Hyperliquid needs no auth. The SDK reads portfolio history from a public Hyperliquidinfo endpoint using only the account address.
Ondo
Ondo needs an active session. The user signs in withsiweLogin before this call. A call with no active session returns an empty points array instead of an error.
Lighter
Lighter needs the account auth token or the read-only token. The SDK resolves a token from its stored key automatically. A call with no resolvable token returns an emptypoints array instead of an error.