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/pnl at daily resolution to get pool_total_shares at 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
Returns

Mapping of {date: pool_total_shares}.

Return type

dict[datetime.date, int]