AssetPosition
Documentation for eth_defi.hyperliquid.api.AssetPosition Python class.
- class AssetPosition
Bases:
objectA single perpetual position.
Returned inside
PerpClearinghouseState.Attributes summary
Perpetual market symbol (e.g.
Position size (negative = short)
Entry price
Unrealised PnL
Margin used for this position
Position value in USD
Liquidation price (
Noneif 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 (
Noneif no position)
- __init__(coin, size, entry_price, unrealised_pnl, margin_used, position_value, liquidation_price)
- Parameters
coin (str) –
size (decimal.Decimal) –
entry_price (decimal.Decimal | None) –
unrealised_pnl (decimal.Decimal) –
margin_used (decimal.Decimal) –
position_value (decimal.Decimal) –
liquidation_price (decimal.Decimal | None) –
- Return type
None