fetch_pool_total_shares_history
Documentation for eth_defi.lighter.vault.fetch_pool_total_shares_history function.
- fetch_pool_total_shares_history(session, account_index, start_timestamp=None, timeout=30.0)
Fetch historical total shares from the PnL endpoint.
Uses
/api/v1/pnlat daily resolution to getpool_total_sharesat each timestamp. This is the only endpoint that provides full history for all pool types (including user pools).The returned shares can be combined with share prices to compute historical TVL:
tvl = pool_total_shares * share_price.- Parameters
session (eth_defi.lighter.session.LighterSession) – HTTP session.
account_index (int) – Pool account index.
start_timestamp (Optional[int]) – Unix timestamp for the start of the range. Defaults to Jan 1 2025.
timeout (float) – HTTP request timeout.
- Returns
Mapping of
{date: pool_total_shares}.- Return type