FundingPayment

Documentation for eth_defi.hyperliquid.trade_history.FundingPayment Python class.

class FundingPayment

Bases: object

A single funding payment from the Hyperliquid userFunding endpoint.

Funding is paid/received periodically (typically hourly) for open perpetual positions. Negative USDC means funding was paid by the holder; positive means funding was received.

Attributes summary

coin

funding_rate

usdc

position_size

timestamp

timestamp_ms

hash

n_samples

Methods summary

__init__(coin, funding_rate, usdc, ...[, ...])

from_api_response(data)

Parse a funding payment from API response data.

__init__(coin, funding_rate, usdc, position_size, timestamp, timestamp_ms, hash=None, n_samples=1)
Parameters
Return type

None

classmethod from_api_response(data)

Parse a funding payment from API response data.

The userFunding API returns entries with a delta sub-object containing the actual funding fields (coin, usdc, szi, fundingRate).

Parameters

data (dict) – Raw funding dict from userFunding API response.

Returns

Parsed FundingPayment object.

Return type

eth_defi.hyperliquid.trade_history.FundingPayment