@somnia-chain/markets-sdk


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

Interface: PerpPositionAnalyticsInputs

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

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

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


avgEntryPrice

avgEntryPrice: bigint

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

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


entryFundingIndex

entryFundingIndex: bigint

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

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


markPrice

markPrice: bigint

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

Current mark price, raw quote units per whole base.


projectedCumulativeFunding

projectedCumulativeFunding: bigint

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

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


oneBase

oneBase: bigint

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

10^decimals of the synthetic base asset.


effectiveImfBps

effectiveImfBps: bigint

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

The OI-scaled IMF actually in force, bps.


maintenanceMarginBps

maintenanceMarginBps: bigint

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

Maintenance threshold, bps.


closeOutMarginBps

closeOutMarginBps: bigint

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

Close-out / takeover threshold, bps.