@somnia-chain/markets-sdk / index / PerpMarginPull
Type Alias: PerpMarginPull
PerpMarginPull =
object
Defined in: packages/sdk/src/perp/linkedWallet.ts:383
One leg of margin pulled to fund a placement (mirror of the indexer PerpMarginPull
entity). Pool side.
source names which wallet paid, and one placement can produce BOTH legs, in this
order:
OwnWallet— the owner's own wallet funded it, sized bymin(balance, allowance).Main— the residual reached the owner's linked MAIN, whose address ispayer.
So a child with no approval of its own contributes zero and the whole requirement
arrives as one Main leg, while a partly-funded child produces two rows for one
order. amount is what THIS leg pulled, never the order's total requirement — sum the
legs sharing an orderId for that.
Gotcha. Do not add these to PerpMainFundingEvent rows: the same wei appears on both sides. See the module header.
Properties
id
id:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:385
Row id (${txHash}_${logIndex}).
account
account:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:387
The account credited, and whose position the order was for (lowercased).
pool
pool:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:389
The PerpPool that pulled (lowercased).
orderId
orderId:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:391
The order whose placement caused the pull — decimal string, matches Order.orderId.
source
source:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:393
OwnWallet | Main — which wallet paid this leg.
amount
amount:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:395
Wei pulled by THIS leg, raw collateral units — not the order's total requirement.
payer
payer:
string|null
Defined in: packages/sdk/src/perp/linkedWallet.ts:397
The main whose wallet was debited (Main only; null for OwnWallet), lowercased.
timestamp
timestamp:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:399
Timestamp (unix seconds) of the pull.
blockNumber
blockNumber:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:401
Block the pull landed in.
txHash
txHash:
string
Defined in: packages/sdk/src/perp/linkedWallet.ts:403
Tx hash the pull landed in.