LedgerEvent

Documentation for eth_defi.hyperliquid.trade_history_db.LedgerEvent Python class.

class LedgerEvent

Bases: object

A deposit, withdrawal, or other non-funding ledger event from DuckDB storage.

Represents a row from the ledger table. The event_type field contains the raw API type string (e.g. "vaultDeposit", "vaultWithdraw", "deposit", "withdraw").

Attributes summary

timestamp

Event timestamp

timestamp_ms

Timestamp in milliseconds (for storage and sorting)

event_type

Raw API event type (e.g.

usdc

USDC amount

vault

Associated vault address (if any)

Methods summary

__init__(timestamp, timestamp_ms, ...)

timestamp: datetime.datetime

Event timestamp

timestamp_ms: int

Timestamp in milliseconds (for storage and sorting)

event_type: str

Raw API event type (e.g. “vaultDeposit”, “withdraw”, “deposit”)

usdc: float

USDC amount

vault: str | None

Associated vault address (if any)

__init__(timestamp, timestamp_ms, event_type, usdc, vault)
Parameters
Return type

None