@somnia-chain/markets-sdk


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

Interface: RepayPerpMainFundingParams

Defined in: packages/sdk/src/trade.ts:1034

Inputs to Trader.repayPerpMainFunding — the CHILD returns principal its main funded.

Signed by the child. The money goes to the payer the bank snapshotted at funding time, not to whoever is linked now.

Extended by

Properties

marginBank?

optional marginBank?: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1036

MarginBank address (from the PerpMarket row), or pass pool to resolve it.


pool?

optional pool?: `0x${string}`

Defined in: packages/sdk/src/trade.ts:1038

A PerpPool — its marginBank() is read (and cached) when marginBank is omitted.


amount

amount: bigint

Defined in: packages/sdk/src/trade.ts:1046

Principal to return, raw units.

Over-asking is SAFE and does not revert: the bank returns min(amount, outstanding, present balance). Pass the outstanding principal from client.getPerpMainFunding to repay in full.


gas?

optional gas?: bigint

Defined in: packages/sdk/src/trade.ts:1052

Gas ceiling for this tx.

Default

TraderConfig.gas (10,000,000)