fetch_lighter_total_equity

Documentation for eth_defi.lighter.valuation.fetch_lighter_total_equity function.

fetch_lighter_total_equity(session, account_index, timeout=30.0)

Calculate the total equity of a Lighter trading account.

Uses Lighter’s public /api/v1/account?by=index&value={account_index} endpoint. No API key is required. The returned LighterEquity.get_total() value is the canonical total_asset_value reported by Lighter, denominated in USDC.

Authoritative endpoint documentation: https://apidocs.lighter.xyz/reference/account

Parameters
Returns

LighterEquity with NAV, collateral, unrealised PnL, available balance, margin requirements and position count.

Raises

ValueError – If the API returns no account or malformed decimal fields.

Return type

eth_defi.lighter.valuation.LighterEquity