@somnia-chain/markets-sdk


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

Interface: AmendOrdersParams

Defined in: packages/sdk/src/trade.ts:582

Inputs to Trader.amendOrders — cancel N orders and place their replacements atomically. The replacement loses queue priority; use reduceOrder to shrink one in place without re-queueing.

Gotchas — ALL-OR-NOTHING: the first replacement the book will not honour reverts everything with AmendReplacementRejected(requestIndex, reason).

Properties

pool

pool: `0x${string}`

Defined in: packages/sdk/src/trade.ts:584

SpotPool or PerpPool address. NOT a BinaryPool.


amendments

amendments: object[]

Defined in: packages/sdk/src/trade.ts:586

The amendments to apply, in array order. Must be non-empty.

oldOrderId

oldOrderId: string | bigint

The resting order being replaced (decimal string or bigint).

alwaysPlace?

optional alwaysPlace?: boolean

How to handle an oldOrderId already filled/cancelled when the tx lands. False (default) reverts AmendOldOrderGone; true skips the cancel leg and places the replacement anyway (opt-in upsert). It never tolerates an ownership failure — someone else's live order still reverts.

newOrder

newOrder: BatchOrderRequest

The replacement order.


gas?

optional gas?: bigint

Defined in: packages/sdk/src/trade.ts:600

Gas ceiling for this tx.

Default Value

TraderConfig.gas (10,000,000)