{s}omniamarkets

@somnia-chain/markets-sdk


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

Interface: PlaceOrderParams

Defined in: trade.ts:135

Inputs to Trader.placeOrder — a binary YES/NO limit or market order on a BinaryPool.

Properties

pool

pool: `0x${string}`

Defined in: trade.ts:137

BinaryPool address.


side

side: BinarySide

Defined in: trade.ts:142

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: trade.ts:144

YES limit price as raw collateral units per whole outcome token (price × 10^decimals).


quantity

quantity: bigint

Defined in: trade.ts:146

Outcome-token quantity, raw units.


outcomeToken?

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

Defined in: trade.ts:151

Outcome-token singleton + this pool's YES/NO ids. Resolved from the pool (IBinaryPool.outcomeToken/yesId/noId) if omitted.


yesId?

optional yesId?: bigint

Defined in: trade.ts:153

This pool's YES position id on the singleton; resolved from the pool if omitted.


noId?

optional noId?: bigint

Defined in: trade.ts:155

This pool's NO position id on the singleton; resolved from the pool if omitted.


collateral?

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

Defined in: trade.ts:157

Collateral (buy-side escrow) token; resolved from the pool if omitted.


expireTimestampNs?

optional expireTimestampNs?: bigint

Defined in: trade.ts:159

Order expiry in ns. Defaults to ~50y (GTC).


orderType?

optional orderType?: number

Defined in: trade.ts:165

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?

optional autoApprove?: boolean

Defined in: trade.ts:167

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


builder?

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

Defined in: trade.ts:173

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?

optional builderFeeBpsTimes1k?: bigint

Defined in: trade.ts:178

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?

optional userData?: bigint

Defined in: trade.ts:184

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?

optional gas?: bigint

Defined in: trade.ts:186

Gas ceiling for this tx.

Default Value

TraderConfig.gas (10,000,000)