fetch_account_funding

Documentation for eth_defi.hyperliquid.trade_history.fetch_account_funding function.

fetch_account_funding(session, address, start_time=None, end_time=None, timeout=30.0)

Fetch all funding payments for an account with automatic pagination.

Fetches funding payment history from the Hyperliquid API using the userFunding endpoint with automatic forward pagination.

Payments are yielded in chronological order (oldest first).

Example:

from datetime import datetime, timedelta
from eth_defi.hyperliquid.session import create_hyperliquid_session
from eth_defi.hyperliquid.trade_history import fetch_account_funding

session = create_hyperliquid_session()
address = "0x1e37a337ed460039d1b15bd3bc489de789768d5e"

payments = list(
    fetch_account_funding(
        session,
        address,
        start_time=datetime.now() - timedelta(days=7),
    )
)
print(f"Fetched {len(payments)} funding payments")
Parameters
Returns

Iterator of funding payments sorted by timestamp ascending (oldest first).

Raises

requests.HTTPError – If the HTTP request fails after retries.

Return type

Iterator[eth_defi.hyperliquid.trade_history.FundingPayment]