@somnia-chain/markets-sdk / index / PlaceOrderParams
Interface: PlaceOrderParams
Defined in: packages/sdk/src/trade.ts:170
Inputs to Trader.placeOrder — a binary YES/NO limit or market order on a BinaryPool.
Properties
pool
pool:
`0x${string}`
Defined in: packages/sdk/src/trade.ts:172
BinaryPool address.
side
side:
BinarySide
Defined in: packages/sdk/src/trade.ts:177
Side + outcome ("BUY_YES" | "SELL_YES" | "BUY_NO" | "SELL_NO") — mapped onto the pool's OrderKind enum. Buys escrow collateral, sells escrow outcome tokens.
price
price:
bigint
Defined in: packages/sdk/src/trade.ts:179
YES limit price as raw collateral units per whole outcome token (price × 10^decimals).
quantity
quantity:
bigint
Defined in: packages/sdk/src/trade.ts:181
Outcome-token quantity, raw units.
outcomeToken?
optionaloutcomeToken?:`0x${string}`
Defined in: packages/sdk/src/trade.ts:186
Outcome-token singleton + this pool's YES/NO ids. Resolved from the pool (IBinaryPool.outcomeToken/yesId/noId) if omitted.
yesId?
optionalyesId?:bigint
Defined in: packages/sdk/src/trade.ts:188
This pool's YES position id on the singleton; resolved from the pool if omitted.
noId?
optionalnoId?:bigint
Defined in: packages/sdk/src/trade.ts:190
This pool's NO position id on the singleton; resolved from the pool if omitted.
collateral?
optionalcollateral?:`0x${string}`
Defined in: packages/sdk/src/trade.ts:192
Collateral (buy-side escrow) token; resolved from the pool if omitted.
expireTimestampNs?
optionalexpireTimestampNs?:bigint
Defined in: packages/sdk/src/trade.ts:206
Order expiry in ns. Defaults to the POOL'S MARKET EXPIRY, not to a far
future — a binary order must satisfy 0 < expireNs <= pool.marketExpiryNs
or the pool rejects it with OrderExpiryBeyondMarket, which keeps the book
drainable by the expiry sweeps once the market locks.
So an order left to default stops resting when its market expires. On a rolling series that is hours, not decades. There is no GTC here; ~50y is the spot and perp default, where there is no market expiry to outlive.
A value already in the past reverts (OrderAlreadyExpired) — a deliberate
choice is honoured verbatim rather than silently clamped.
orderType?
optionalorderType?:number
Defined in: packages/sdk/src/trade.ts:212
OrderBook OrderType (see ORDER_TYPE): 0 NormalOrder (rest), 1 FillOrKill, 2 ImmediateOrCancel, 3 PostOnly. Defaults to 0. A market order is an IOC (2) placed at the price extreme so it crosses immediately and cancels the remainder.
selfMatchingOption?
optionalselfMatchingOption?:number
Defined in: packages/sdk/src/trade.ts:217
Self-match behaviour when this order crosses your OWN resting order, default
0 (CANCEL_TAKER). See SELF_MATCHING_OPTION.
autoApprove?
optionalautoApprove?:boolean
Defined in: packages/sdk/src/trade.ts:219
Approve the escrow token to the pool if allowance is short (default true).
builder?
optionalbuilder?:`0x${string}`
Defined in: packages/sdk/src/trade.ts:225
Routing/builder frontend address to attribute the order to. Requires the trader to have opted this builder in via Trader.approveBuilder. Omit (or zero) for no routing fee.
builderFeeBpsTimes1k?
optionalbuilderFeeBpsTimes1k?:bigint
Defined in: packages/sdk/src/trade.ts:230
Per-order builder/routing fee in the pool's native bps×1000 unit (≤ the
venue's frozen maxBuilderFee ceiling AND ≤ the trader's approval). 0 = none.
userData?
optionaluserData?:bigint
Defined in: packages/sdk/src/trade.ts:236
Opaque market-maker bookkeeping tag (v2). Forwarded verbatim to the pool
(stored on the order + emitted in OrderPlaced); the SDK never interprets it
and the pool no longer uses it for side derivation. Default 0.
gas?
optionalgas?:bigint
Defined in: packages/sdk/src/trade.ts:242
Gas ceiling for this tx.
Default
TraderConfig.gas (10,000,000)