Fill
Documentation for eth_defi.hyperliquid.position.Fill Python class.
- class Fill
Bases:
objectParsed fill data from Hyperliquid API.
This is an intermediate representation of raw API fill data with proper typing.
Attributes summary
coinsidesizepricetimestamp_msstart_positionclosed_pnldirection_hinthashorder_idtrade_idfeefee_tokenConvert millisecond timestamp to datetime.
Methods summary
__init__(coin, side, size, price, ...)from_api_response(data)Parse a fill from API response data.
- __init__(coin, side, size, price, timestamp_ms, start_position, closed_pnl, direction_hint, hash, order_id, trade_id, fee, fee_token)
- Parameters
coin (str) –
side (str) –
size (decimal.Decimal) –
price (decimal.Decimal) –
timestamp_ms (int) –
start_position (decimal.Decimal) –
closed_pnl (decimal.Decimal) –
direction_hint (str) –
fee (decimal.Decimal) –
fee_token (str) –
- Return type
None
- classmethod from_api_response(data)
Parse a fill from API response data.
- Parameters
data (dict) – Raw fill dict from API
- Returns
Parsed Fill object
- Return type
- property timestamp: datetime.datetime
Convert millisecond timestamp to datetime.