Fill

Documentation for eth_defi.hyperliquid.position.Fill Python class.

class Fill

Bases: object

Parsed fill data from Hyperliquid API.

This is an intermediate representation of raw API fill data with proper typing.

Attributes summary

coin

side

size

price

timestamp_ms

start_position

closed_pnl

direction_hint

hash

order_id

trade_id

fee

fee_token

timestamp

Convert 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
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

eth_defi.hyperliquid.position.Fill

property timestamp: datetime.datetime

Convert millisecond timestamp to datetime.