LighterPoolSnapshot

Documentation for eth_defi.lighter.vault.LighterPoolSnapshot Python class.

class LighterPoolSnapshot

Bases: object

Point-in-time Lighter pool and account state.

Values come from one /api/v1/account response. Historical arrays such as share_prices and daily_returns are 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 SQL NULL/Pandas NaN when joined to older price history.

Attributes summary

snapshot_timestamp

Naive UTC time at which the API response was observed

account_index

Lighter pool account index

account_status

Account-level status code

pool_status

Pool-level status code from pool_info

account_type

Lighter account type code

account_trading_mode

Lighter account trading-mode code

total_asset_value

Canonical account NAV in the deployment's collateral currency

cross_asset_value

Cross-margin asset value in the deployment's collateral currency

collateral

Account collateral in the deployment's collateral currency

available_balance

Free account balance in the deployment's collateral currency

initial_margin_requirement

Cross-margin initial requirement in the deployment's collateral currency

maintenance_margin_requirement

Cross-margin maintenance requirement in the deployment's collateral currency

operator_fee

Operator performance fee as reported by Lighter

min_operator_share_rate

Minimum operator ownership rate as reported by Lighter

annual_percentage_yield

API annual percentage yield snapshot

sharpe_ratio

API Sharpe ratio snapshot

total_shares

Total outstanding pool shares

operator_shares

Shares owned by the pool operator

operator_share_fraction

Operator ownership fraction calculated from current share counts

pending_order_count

Account-level pending order count

total_order_count

Lifetime order count

total_isolated_order_count

Lifetime isolated-order count

transaction_time

Source transaction time, in the API's integer time unit

position_count

Number of current position records

gross_position_value

Sum of absolute position values in the deployment's collateral currency

net_position_value

Signed position value in the deployment's collateral currency

long_position_value

Sum of long position values in the deployment's collateral currency

short_position_value

Sum of short position values in the deployment's collateral currency

top_position_fraction

Largest position value divided by gross position value

allocated_margin

Sum of position allocated margin in the deployment's collateral currency

unrealised_pnl

Sum of unrealised position PnL in the deployment's collateral currency

realised_pnl

Sum of realised position PnL in the deployment's collateral currency

funding_paid_out

Sum of funding paid out in the deployment's collateral currency

open_order_count

Sum of open-order counts attached to positions

asset_count

Number of current asset records

strategy_count

Number of configured strategy records

strategy_collateral

Sum of strategy collateral in the deployment's collateral currency

pending_unlock_count

Number of pending unlock records

source_account

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
Return type

None