calculate_total_pnl
Documentation for eth_defi.hyperliquid.vault_scanner.calculate_total_pnl function.
- calculate_total_pnl(pnl_all_time)
Calculate the total PnL from the all-time PnL history array.
The pnl_all_time array contains cumulative PnL values. The last value represents the current total all-time PnL.
- Parameters
pnl_all_time (list[str] | None) – List of PnL values as strings from VaultSummary.pnl_all_time
- Returns
Total all-time PnL as Decimal, or None if no data
- Return type
decimal.Decimal | None