@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / UnifiedPosition

Interface: UnifiedPosition

Defined in: packages/sdk/src/unified/structs.ts:451

An open perp position, human units.

Properties

symbol

symbol: string

Defined in: packages/sdk/src/unified/structs.ts:453

The perp's tradable symbol.


side

side: "short" | "long"

Defined in: packages/sdk/src/unified/structs.ts:455

Position direction (from the sign of the on-chain size).


contracts

contracts: number

Defined in: packages/sdk/src/unified/structs.ts:457

Absolute position size in base units.


entryPrice

entryPrice: number

Defined in: packages/sdk/src/unified/structs.ts:459

Average entry price, human quote units.


markPrice?

optional markPrice?: number

Defined in: packages/sdk/src/unified/structs.ts:461

Current EMA mark price, human quote units.


unrealizedPnl?

optional unrealizedPnl?: number

Defined in: packages/sdk/src/unified/structs.ts:463

(mark − entry) × signed size, human quote units. Excludes pending funding.


liquidationPrice?

optional liquidationPrice?: number

Defined in: packages/sdk/src/unified/structs.ts:474

Estimated liquidation price, human quote units — the price at which THIS market's move alone would trip the account's cross-margin maintenance requirement. undefined when it can't be derived (a stale mark anywhere in the account reverts the health read this needs).

Solved with both sides of equity == mmReq moving against the mark; see perpLiquidationPrice for the identity and what is held constant. For the price a proposed order would move this to, use client.previewPerpLiquidationPrice.


timestamp?

optional timestamp?: number

Defined in: packages/sdk/src/unified/structs.ts:476

When the position last changed on-chain (ms).


datetime?

optional datetime?: string

Defined in: packages/sdk/src/unified/structs.ts:478

ISO-8601 of timestamp.


info

info: unknown

Defined in: packages/sdk/src/unified/structs.ts:480

The native reads: { position, state } (raw bigints).