@somnia-chain/markets-sdk


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

Interface: UnifiedPosition

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

An open perp position, human units.

Properties

symbol

symbol: string

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

The perp's tradable symbol.


chainId

chainId: number

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

Numeric chain id the market lives on.


side

side: "short" | "long"

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

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


contracts

contracts: number

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

Absolute position size in base units.


entryPrice

entryPrice: number

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

Average entry price, human quote units.


markPrice?

optional markPrice?: number

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

Current EMA mark price, human quote units.


unrealizedPnl?

optional unrealizedPnl?: number

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

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


liquidationPrice?

optional liquidationPrice?: number

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

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:559

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


datetime?

optional datetime?: string

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

ISO-8601 of timestamp.


info

info: unknown

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

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