PositionEvent
Documentation for eth_defi.hyperliquid.position.PositionEvent Python class.
- class PositionEvent
Bases:
objectRepresents a position change event reconstructed from fill data.
Position events are derived by processing fills chronologically and detecting when positions are opened, closed, increased, or decreased.
Attributes summary
event_typecoindirectionsizepricetimestampposition_afterrealized_pnlfill_hashorder_idtrade_idfeefee_tokenMethods summary
__init__(event_type, coin, direction, size, ...)- __init__(event_type, coin, direction, size, price, timestamp, position_after, realized_pnl=None, fill_hash=None, order_id=None, trade_id=None, fee=None, fee_token=None)
- Parameters
event_type (eth_defi.hyperliquid.position.PositionEventType) –
coin (str) –
direction (eth_defi.hyperliquid.position.PositionDirection) –
size (decimal.Decimal) –
price (decimal.Decimal) –
timestamp (datetime.datetime) –
position_after (decimal.Decimal) –
realized_pnl (Optional[decimal.Decimal]) –
fee (Optional[decimal.Decimal]) –
- Return type
None