@somnia-chain/markets-sdk


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

Type Alias: PerpPoolStatus

PerpPoolStatus = object

Defined in: packages/sdk/src/perp/registry.ts:89

One factory-deployed perp market and whether it can actually be traded.

restricted and registered are independent gates that fail for unrelated reasons. A market can be perfectly registered with the bank and still be close-only, or unrestricted and never activated. Both have to pass, which is what tradeable folds together.

Properties

pool

pool: Address

Defined in: packages/sdk/src/perp/registry.ts:91

The PerpPool beacon proxy.


baseToken

baseToken: Address

Defined in: packages/sdk/src/perp/registry.ts:93

The synthetic base ERC-20 the market tracks.


marginBank

marginBank: Address

Defined in: packages/sdk/src/perp/registry.ts:103

The MarginBank this pool settles against, read from the pool itself.

Effectively a per-network singleton, but taken per-pool because the pool is what the settlement path actually uses — so this is the bank a later getMarginAccount / getPerpPosition / getLiquidationPrice for this market must be addressed to. Carrying it here means a consumer never has to source it separately, and never has to hardcode it per chain.


restricted

restricted: boolean

Defined in: packages/sdk/src/perp/registry.ts:113

True when the market is CLOSE-ONLY: position-increasing orders revert MarketRestricted, while closes, reduces and cancels still work.

Restricted markets stay visible on purpose — holders still have to close positions, cancel orders and withdraw collateral, and liquidation runs on them unchanged. Reversible: a restriction can be a temporary wind-down rather than a retirement.


registered

registered: boolean | null

Defined in: packages/sdk/src/perp/registry.ts:131

Whether marginBank has this pool registered — the ACTIVATION gate.

Coming from the factory only proves a pool is authentic; addPerpPool is the separate step that makes it usable, and removePerpPool revokes it. An unregistered pool rejects every settlement callback and every quote view while still reading as an ordinary market from the factory.

null when the gate is genuinely unreadable, from either of two causes: the pool's MarginBank predates isPerpPoolRegistered, or that pool's bank reads failed while other pools' succeeded. Nothing substitutes for it — getPoolTier is itself gated on registration (so it collapses to 0 for both an uncovered-but-registered market and an unregistered one) and getActivePerpPools is per-account, not the registry.

On the read-failure cause, marginBank is the zero address: the pool's own bank could not be established either, so do not address a settlement read to it.


tradeable

tradeable: boolean | null

Defined in: packages/sdk/src/perp/registry.ts:139

Both gates passed — not restricted AND registered. The list to show as tradeable.

null when registered is unknown: with one of the two gates unreadable, tradeability is genuinely undetermined, and reporting false would hide live markets while true would advertise dead ones.