AssetPosition

Documentation for eth_defi.hyperliquid.api.AssetPosition Python class.

class AssetPosition

Bases: object

A single perpetual position.

Returned inside PerpClearinghouseState.

Attributes summary

coin

Perpetual market symbol (e.g.

size

Position size (negative = short)

entry_price

Entry price

unrealised_pnl

Unrealised PnL

margin_used

Margin used for this position

position_value

Position value in USD

liquidation_price

Liquidation price (None if no position)

Methods summary

__init__(coin, size, entry_price, ...)

coin: str

Perpetual market symbol (e.g. "BTC", "ETH")

size: decimal.Decimal

Position size (negative = short)

entry_price: decimal.Decimal | None

Entry price

unrealised_pnl: decimal.Decimal

Unrealised PnL

margin_used: decimal.Decimal

Margin used for this position

position_value: decimal.Decimal

Position value in USD

liquidation_price: decimal.Decimal | None

Liquidation price (None if no position)

__init__(coin, size, entry_price, unrealised_pnl, margin_used, position_value, liquidation_price)
Parameters
Return type

None