@somnia-chain/markets-sdk / index / PlaceSpotOrderParams
Interface: PlaceSpotOrderParams
Defined in: packages/sdk/src/trade.ts:299
Inputs to Trader.placeSpotOrder — a spot limit or market order on a SpotPool.
Properties
pool
pool:
`0x${string}`
Defined in: packages/sdk/src/trade.ts:301
SpotPool address.
isBid
isBid:
boolean
Defined in: packages/sdk/src/trade.ts:303
True = buy the base asset (pay quote); false = sell base (pay base/native).
price
price:
bigint
Defined in: packages/sdk/src/trade.ts:308
Limit price — raw quote units per whole base token. For a MARKET order pass a crossing price (best opposite level ± slippage); it bounds the escrow.
quantity
quantity:
bigint
Defined in: packages/sdk/src/trade.ts:310
Base quantity, raw base units.
baseDecimals
baseDecimals:
number
Defined in: packages/sdk/src/trade.ts:312
Base-token decimals (for the buy-side escrow math).
quoteToken
quoteToken:
`0x${string}`
Defined in: packages/sdk/src/trade.ts:314
Quote token (approved on a buy).
baseToken
baseToken:
`0x${string}`
Defined in: packages/sdk/src/trade.ts:316
Base token (approved on a non-native sell).
baseIsNative?
optionalbaseIsNative?:boolean
Defined in: packages/sdk/src/trade.ts:318
True when the base asset is native SOMI (sell pays via msg.value).
expireTimestampNs?
optionalexpireTimestampNs?:bigint
Defined in: packages/sdk/src/trade.ts:332
Order expiry in ns. Defaults to ~50y (GTC). A spot pool has no market
expiry to outlive, so the binary verb's OrderExpiryBeyondMarket cap does
not apply here.
Two traps, both silent:
- A timestamp already in the PAST does not revert. The pool skips the placement and returns no order id, so the transaction succeeds having placed nothing.
- An expired order does NOT auto-return its escrow. The funds stay locked in the pool until someone sweeps it — Trader.cancelExpiredOrders reclaims them, and is callable by anyone, not only the owner.
orderType?
optionalorderType?:number
Defined in: packages/sdk/src/trade.ts:334
0 limit (default) or 2 market (IOC). See ORDER_TYPE.
autoApprove?
optionalautoApprove?:boolean
Defined in: packages/sdk/src/trade.ts:336
Approve the escrow token if allowance is short (default true).
builder?
optionalbuilder?:`0x${string}`
Defined in: packages/sdk/src/trade.ts:342
Routing/builder frontend address to attribute the order to. Requires the trader to have opted this builder in via Trader.approveBuilder on this pool. Omit (or zero) for no routing fee.
builderFeeBpsTimes1k?
optionalbuilderFeeBpsTimes1k?:bigint
Defined in: packages/sdk/src/trade.ts:349
Per-order builder/routing fee in the pool's native bps×1000 unit (≤ the
pool's maxBuilderFee ceiling AND ≤ the trader's approval). 0 = none.
The ceiling is owner-updatable on a SpotPool, so read it rather than
caching it indefinitely.
gas?
optionalgas?:bigint
Defined in: packages/sdk/src/trade.ts:351
Gas ceiling for this tx.
Default Value
TraderConfig.gas (10,000,000)