@somnia-chain/markets-sdk


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

Type Alias: PerpMainFundingEvent

PerpMainFundingEvent = object

Defined in: packages/sdk/src/perp/linkedWallet.ts:432

One movement of a main's claim against a child (mirror of the indexer PerpMainFundingEvent entity). Bank side, and the running principal.

  • Funded — a main's wallet was debited for the child. amount moved; payer is the main; outstandingPrincipal is the claim after.
  • Settled — the child's own losses discharged part of the claim at a flat moment. NO money moved, so amount is null and previousPrincipaloutstandingPrincipal is the whole content. payer is null: a settle has no counterparty.
  • Returned — principal went home, by either signed route (repayFunding by the child or recallFromChild by the payer). Both settle against the SNAPSHOTTED payer, which is why payer here can differ from the child's current main.

Gotchas.

  • amount is null on Settled, and that is not missing data — it is the point. Treating null as zero is right for a cash total and wrong for a claim total; the claim still fell, which outstandingPrincipal records.
  • Do not add these to PerpMarginPull rows. Same wei, two sides. See the module header.
  • The live claim is client.getPerpMainFunding — a bank read. This is how it got there, not what it is now.

Properties

id

id: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:434

Row id (${txHash}_${logIndex}).


account

account: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:436

The child account the claim is against (lowercased).


kind

kind: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:438

Funded | Settled | Returned.


payer

payer: string | null

Defined in: packages/sdk/src/perp/linkedWallet.ts:440

The main on the other side (lowercased). Null on Settled, which has no counterparty.


amount

amount: string | null

Defined in: packages/sdk/src/perp/linkedWallet.ts:442

Wei that actually moved, raw collateral units. Null on Settled — see the type note.


previousPrincipal

previousPrincipal: string | null

Defined in: packages/sdk/src/perp/linkedWallet.ts:444

The claim BEFORE this event (Settled only).


outstandingPrincipal

outstandingPrincipal: string | null

Defined in: packages/sdk/src/perp/linkedWallet.ts:446

The claim after this event.


timestamp

timestamp: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:448

Timestamp (unix seconds) of the movement.


blockNumber

blockNumber: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:450

Block the movement landed in.


txHash

txHash: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:452

Tx hash the movement landed in.