@somnia-chain/markets-sdk / index / PlaceOrderParams
Interface: PlaceOrderParams
Defined in: packages/sdk/src/trade.ts:139
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:141
BinaryPool address.
side
side:
BinarySide
Defined in: packages/sdk/src/trade.ts:146
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:148
YES limit price as raw collateral units per whole outcome token (price × 10^decimals).
quantity
quantity:
bigint
Defined in: packages/sdk/src/trade.ts:150
Outcome-token quantity, raw units.
outcomeToken?
optionaloutcomeToken?:`0x${string}`
Defined in: packages/sdk/src/trade.ts:155
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:157
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:159
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:161
Collateral (buy-side escrow) token; resolved from the pool if omitted.
expireTimestampNs?
optionalexpireTimestampNs?:bigint
Defined in: packages/sdk/src/trade.ts:175
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:181
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.
autoApprove?
optionalautoApprove?:boolean
Defined in: packages/sdk/src/trade.ts:183
Approve the escrow token to the pool if allowance is short (default true).
builder?
optionalbuilder?:`0x${string}`
Defined in: packages/sdk/src/trade.ts:189
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:194
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:200
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:202
Gas ceiling for this tx.
Default Value
TraderConfig.gas (10,000,000)