{s}omniamarkets

@somnia-chain/markets-sdk


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

Function: getLiquidationPrice()

getLiquidationPrice(marginBank, pool, account, client): Promise<bigint | null>

Defined in: reads.ts:310

Estimated liquidation price for an account's position in one perp pool (raw quote units per whole base), or null when the account is flat in that pool.

Derivation (cross-margin maintenance basis): a long is liquidated when equity falls to the maintenance requirement, i.e. when the mark drops by the account's per-unit maintenance buffer (equity − mmReq) / size; a short when it rises by the same. This uses the WHOLE-account equity/mmReq, so with multiple open positions it is the price at which THIS pool's move alone would trip maintenance (a conservative single-pool estimate, not a full multi-pool solve). Returns 0-floored (a price can't go negative).

Parameters

marginBank

`0x${string}`

pool

`0x${string}`

account

`0x${string}`

client

Returns

Promise<bigint | null>