FundingPayment
Documentation for eth_defi.hyperliquid.trade_history.FundingPayment Python class.
- class FundingPayment
Bases:
objectA single funding payment from the Hyperliquid
userFundingendpoint.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
coinfunding_rateusdcposition_sizetimestamptimestamp_mshashn_samplesMethods 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
coin (str) –
funding_rate (decimal.Decimal) –
usdc (decimal.Decimal) –
position_size (decimal.Decimal) –
timestamp (datetime.datetime) –
timestamp_ms (int) –
n_samples (int) –
- Return type
None
- classmethod from_api_response(data)
Parse a funding payment from API response data.
The
userFundingAPI returns entries with adeltasub-object containing the actual funding fields (coin, usdc, szi, fundingRate).- Parameters
data (dict) – Raw funding dict from
userFundingAPI response.- Returns
Parsed FundingPayment object.
- Return type