@somnia-chain/markets-sdk / index / AmendOrderParams
Interface: AmendOrderParams
Defined in: packages/sdk/src/trade.ts:633
Inputs to Trader.amendOrder — cancel ONE resting order and place its replacement atomically, with no gap on the book.
Gotchas — the replacement loses queue priority (it re-enters at the back of the price-time queue for its price); use Trader.reduceOrder to shrink an order in place instead. The call is NON-PAYABLE: the cancel leg delivers the old order's freed native to the WALLET, which the non-payable place leg cannot reach, so a native auto-pull amend reverts — fund native replacements from a manual-vault balance.
Properties
pool
pool:
`0x${string}`
Defined in: packages/sdk/src/trade.ts:635
SpotPool or PerpPool address. NOT a BinaryPool — see Trader.amendOrder.
oldOrderId
oldOrderId:
string|bigint
Defined in: packages/sdk/src/trade.ts:637
The resting order being replaced (decimal string or bigint).
alwaysPlace?
optionalalwaysPlace?:boolean
Defined in: packages/sdk/src/trade.ts:644
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 IncorrectSender.
newOrder
newOrder:
BatchOrderRequest
Defined in: packages/sdk/src/trade.ts:646
The replacement order.
gas?
optionalgas?:bigint
Defined in: packages/sdk/src/trade.ts:648
Gas ceiling for this tx.
Default Value
TraderConfig.gas (10,000,000)