@somnia-chain/markets-sdk


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

Interface: PerpPositionAnalyticsInputs

Defined in: packages/sdk/src/perp/margin.ts:789

Everything the per-position arithmetic needs, and nothing that has to come from a particular block — so perpPositionAnalytics stays pure and testable.

The last six all arrive together from one tryGetHealthSnapshot; the first three are the stored Position.

Properties

size

size: bigint

Defined in: packages/sdk/src/perp/margin.ts:791

SIGNED position size, raw base units (positive = long, negative = short).


avgEntryPrice

avgEntryPrice: bigint

Defined in: packages/sdk/src/perp/margin.ts:793

Volume-weighted average entry price, raw quote units per whole base.


entryFundingIndex

entryFundingIndex: bigint

Defined in: packages/sdk/src/perp/margin.ts:795

Cumulative funding index stamped at open / last settlement (1e18-scaled, signed).


markPrice

markPrice: bigint

Defined in: packages/sdk/src/perp/margin.ts:797

Current mark price, raw quote units per whole base.


projectedCumulativeFunding

projectedCumulativeFunding: bigint

Defined in: packages/sdk/src/perp/margin.ts:799

Cumulative funding per unit INCLUDING unsettled intervals (1e18-scaled, signed).


oneBase

oneBase: bigint

Defined in: packages/sdk/src/perp/margin.ts:801

10^decimals of the synthetic base asset.


effectiveImfBps

effectiveImfBps: bigint

Defined in: packages/sdk/src/perp/margin.ts:803

The OI-scaled IMF actually in force, bps.


maintenanceMarginBps

maintenanceMarginBps: bigint

Defined in: packages/sdk/src/perp/margin.ts:805

Maintenance threshold, bps.


closeOutMarginBps

closeOutMarginBps: bigint

Defined in: packages/sdk/src/perp/margin.ts:807

Close-out / takeover threshold, bps.