@somnia-chain/markets-sdk


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

Interface: PerpPositionAnalyticsInputs

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

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

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


avgEntryPrice

avgEntryPrice: bigint

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

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


entryFundingIndex

entryFundingIndex: bigint

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

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


markPrice

markPrice: bigint

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

Current mark price, raw quote units per whole base.


projectedCumulativeFunding

projectedCumulativeFunding: bigint

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

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


oneBase

oneBase: bigint

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

10^decimals of the synthetic base asset.


effectiveImfBps

effectiveImfBps: bigint

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

The OI-scaled IMF actually in force, bps.


maintenanceMarginBps

maintenanceMarginBps: bigint

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

Maintenance threshold, bps.


closeOutMarginBps

closeOutMarginBps: bigint

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

Close-out / takeover threshold, bps.