LighterPoolSnapshot
Documentation for eth_defi.lighter.vault.LighterPoolSnapshot Python class.
- class LighterPoolSnapshot
Bases:
objectPoint-in-time Lighter pool and account state.
Values come from one
/api/v1/accountresponse. Historical arrays such asshare_pricesanddaily_returnsare deliberately excluded because the daily-history pipeline handles them separately. Collection is append-only from the collection start date; the API cannot reconstruct earlier snapshots, so pre-collection values remain SQLNULL/PandasNaNwhen joined to older price history.Attributes summary
Naive UTC time at which the API response was observed
Lighter pool account index
Account-level status code
Pool-level status code from
pool_infoLighter account type code
Lighter account trading-mode code
Canonical account NAV in the deployment's collateral currency
Cross-margin asset value in the deployment's collateral currency
Account collateral in the deployment's collateral currency
Free account balance in the deployment's collateral currency
Cross-margin initial requirement in the deployment's collateral currency
Cross-margin maintenance requirement in the deployment's collateral currency
Operator performance fee as reported by Lighter
Minimum operator ownership rate as reported by Lighter
API annual percentage yield snapshot
API Sharpe ratio snapshot
Total outstanding pool shares
Shares owned by the pool operator
Operator ownership fraction calculated from current share counts
Account-level pending order count
Lifetime order count
Lifetime isolated-order count
Source transaction time, in the API's integer time unit
Number of current position records
Sum of absolute position values in the deployment's collateral currency
Signed position value in the deployment's collateral currency
Sum of long position values in the deployment's collateral currency
Sum of short position values in the deployment's collateral currency
Largest position value divided by gross position value
Sum of position allocated margin in the deployment's collateral currency
Sum of unrealised position PnL in the deployment's collateral currency
Sum of realised position PnL in the deployment's collateral currency
Sum of funding paid out in the deployment's collateral currency
Sum of open-order counts attached to positions
Number of current asset records
Number of configured strategy records
Sum of strategy collateral in the deployment's collateral currency
Number of pending unlock records
Complete current-state account response with historical arrays removed
Methods summary
__init__(snapshot_timestamp, account_index, ...)- snapshot_timestamp: datetime.datetime
Naive UTC time at which the API response was observed
- account_index: int
Lighter pool account index
- account_status: Optional[int]
Account-level status code
- pool_status: Optional[int]
Pool-level status code from
pool_info
- account_type: Optional[int]
Lighter account type code
- account_trading_mode: Optional[int]
Lighter account trading-mode code
- total_asset_value: Optional[float]
Canonical account NAV in the deployment’s collateral currency
- cross_asset_value: Optional[float]
Cross-margin asset value in the deployment’s collateral currency
- collateral: Optional[float]
Account collateral in the deployment’s collateral currency
- available_balance: Optional[float]
Free account balance in the deployment’s collateral currency
- initial_margin_requirement: Optional[float]
Cross-margin initial requirement in the deployment’s collateral currency
- maintenance_margin_requirement: Optional[float]
Cross-margin maintenance requirement in the deployment’s collateral currency
- operator_fee: Optional[float]
Operator performance fee as reported by Lighter
- min_operator_share_rate: Optional[float]
Minimum operator ownership rate as reported by Lighter
- annual_percentage_yield: Optional[float]
API annual percentage yield snapshot
- sharpe_ratio: Optional[float]
API Sharpe ratio snapshot
- total_shares: Optional[int]
Total outstanding pool shares
- operator_shares: Optional[int]
Shares owned by the pool operator
- operator_share_fraction: Optional[float]
Operator ownership fraction calculated from current share counts
- pending_order_count: Optional[int]
Account-level pending order count
- total_order_count: Optional[int]
Lifetime order count
- total_isolated_order_count: Optional[int]
Lifetime isolated-order count
- transaction_time: Optional[int]
Source transaction time, in the API’s integer time unit
- position_count: Optional[int]
Number of current position records
- gross_position_value: Optional[float]
Sum of absolute position values in the deployment’s collateral currency
- net_position_value: Optional[float]
Signed position value in the deployment’s collateral currency
- long_position_value: Optional[float]
Sum of long position values in the deployment’s collateral currency
- short_position_value: Optional[float]
Sum of short position values in the deployment’s collateral currency
- top_position_fraction: Optional[float]
Largest position value divided by gross position value
- allocated_margin: Optional[float]
Sum of position allocated margin in the deployment’s collateral currency
- unrealised_pnl: Optional[float]
Sum of unrealised position PnL in the deployment’s collateral currency
- realised_pnl: Optional[float]
Sum of realised position PnL in the deployment’s collateral currency
- funding_paid_out: Optional[float]
Sum of funding paid out in the deployment’s collateral currency
- open_order_count: Optional[int]
Sum of open-order counts attached to positions
- asset_count: Optional[int]
Number of current asset records
- strategy_count: Optional[int]
Number of configured strategy records
- strategy_collateral: Optional[float]
Sum of strategy collateral in the deployment’s collateral currency
- pending_unlock_count: Optional[int]
Number of pending unlock records
- source_account: dict[str, Any]
Complete current-state account response with historical arrays removed
- __init__(snapshot_timestamp, account_index, account_status, pool_status, account_type, account_trading_mode, total_asset_value, cross_asset_value, collateral, available_balance, initial_margin_requirement, maintenance_margin_requirement, operator_fee, min_operator_share_rate, annual_percentage_yield, sharpe_ratio, total_shares, operator_shares, operator_share_fraction, pending_order_count, total_order_count, total_isolated_order_count, transaction_time, position_count, gross_position_value, net_position_value, long_position_value, short_position_value, top_position_fraction, allocated_margin, unrealised_pnl, realised_pnl, funding_paid_out, open_order_count, asset_count, strategy_count, strategy_collateral, pending_unlock_count, source_account)
- Parameters
snapshot_timestamp (datetime.datetime) –
account_index (int) –
- Return type
None