Skip to main content

Module historical_pnl

Module historical_pnl 

Source

Structsยง

DepositEvent ๐Ÿ”’
One deposit/withdraw ledger event, chronologically ordered by caller.
HistoricalPnlApiResponse
HistoricalPnlQuery

Functionsยง

cumulative_net_deposits_per_snapshot ๐Ÿ”’
Walk an ordered deposit/withdraw event stream against a snapshot-timestamp stream, returning the cumulative net_deposits at each snapshot. Events with event_ts_ms <= snapshot_ts count toward that snapshot; events with equal timestamps are applied in the order they appear in events.
get_historical_pnl
Get historical equity snapshots for a wallet.
mask_wallet ๐Ÿ”’
Short helper to mask a wallet address in log output: keeps the first 6 and last 4 hex characters, so operators can correlate errors without logging the full identifier.