{s}omniamarkets

@somnia-chain/markets-sdk


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

Interface: PlaceSpotStopOrderParams

Defined in: trade.ts:423

Inputs to Trader.placeSpotStopOrder — a stop-loss / take-profit order the SpotStopOrderRegistry holds pending and places on the pool when the mark price crosses the trigger. Funded by SOMI msg.value for the trigger gas.

Properties

registry

registry: `0x${string}`

Defined in: trade.ts:425

SpotStopOrderRegistry address (the per-pool registry).


pool

pool: `0x${string}`

Defined in: trade.ts:430

The SpotPool the registry trades on — needed for the operator-auth check, the ERC-20 escrow approval, and the native vault pre-load math.


operatorRegistry?

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

Defined in: trade.ts:435

Shared OperatorPermissionsRegistry where the one-time global approval is granted. Resolved from the live config (addresses.operatorPermissionsRegistry) if omitted.


isBid

isBid: boolean

Defined in: trade.ts:437

True = buy stop (escrows quote at trigger); false = sell stop (escrows base/native).


quantity

quantity: bigint

Defined in: trade.ts:439

Base quantity to trade at trigger, raw base units.


triggerPrice

triggerPrice: bigint

Defined in: trade.ts:441

Mark price that arms the trigger (raw quote per whole base).


triggerOperator

triggerOperator: 0 | 1

Defined in: trade.ts:443

0 = GTE (trigger when mark ≥ triggerPrice), 1 = LTE (mark ≤ triggerPrice).


stopOrderType

stopOrderType: 0 | 1

Defined in: trade.ts:445

0 = LIMIT (uses limitPrice), 1 = MARKET (slippage-bounded).


limitPrice?

optional limitPrice?: bigint

Defined in: trade.ts:447

Limit price for a LIMIT stop order (raw quote per whole base).


quoteToken

quoteToken: `0x${string}`

Defined in: trade.ts:449

Quote token — the input escrow on a buy stop.


baseToken

baseToken: `0x${string}`

Defined in: trade.ts:451

Base token — the input escrow on a (non-native) sell stop.


baseIsNative?

optional baseIsNative?: boolean

Defined in: trade.ts:453

True when the base asset is native SOMI (sell stops pre-load the pool vault).


somiPayment?

optional somiPayment?: bigint

Defined in: trade.ts:458

SOMI to fund the reactivity subscription gas. Read from registry.somiPaymentPerOrder() if omitted.


skipOperatorApproval?

optional skipOperatorApproval?: boolean

Defined in: trade.ts:463

Skip the one-time operator-approval check/tx (default false). Set true if you know the registry is already operator-approved for this owner.


autoApprove?

optional autoApprove?: boolean

Defined in: trade.ts:465

Approve the ERC-20 escrow token to the pool if allowance is short (default true).


gas?

optional gas?: bigint

Defined in: trade.ts:467

Gas ceiling for this tx.

Default Value

TraderConfig.gas (10,000,000)