@somnia-chain/markets-sdk / index / PerpPositionAnalyticsInputs
Interface: PerpPositionAnalyticsInputs
Defined in: packages/sdk/src/perp/margin.ts:797
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:799
SIGNED position size, raw base units (positive = long, negative = short).
avgEntryPrice
avgEntryPrice:
bigint
Defined in: packages/sdk/src/perp/margin.ts:801
Volume-weighted average entry price, raw quote units per whole base.
entryFundingIndex
entryFundingIndex:
bigint
Defined in: packages/sdk/src/perp/margin.ts:803
Cumulative funding index stamped at open / last settlement (1e18-scaled, signed).
markPrice
markPrice:
bigint
Defined in: packages/sdk/src/perp/margin.ts:805
Current mark price, raw quote units per whole base.
projectedCumulativeFunding
projectedCumulativeFunding:
bigint
Defined in: packages/sdk/src/perp/margin.ts:807
Cumulative funding per unit INCLUDING unsettled intervals (1e18-scaled, signed).
oneBase
oneBase:
bigint
Defined in: packages/sdk/src/perp/margin.ts:809
10^decimals of the synthetic base asset.
effectiveImfBps
effectiveImfBps:
bigint
Defined in: packages/sdk/src/perp/margin.ts:811
The OI-scaled IMF actually in force, bps.
maintenanceMarginBps
maintenanceMarginBps:
bigint
Defined in: packages/sdk/src/perp/margin.ts:813
Maintenance threshold, bps.
closeOutMarginBps
closeOutMarginBps:
bigint
Defined in: packages/sdk/src/perp/margin.ts:815
Close-out / takeover threshold, bps.