Order lifecycle

Every order can be paused, resumed, re-planned and cancelled by its owner. The contract's verdict on the next slice tells you exactly why it is or is not filling.

Status

canExecute(id) returns one status, checked in this order:

StatusCodeMeaning
cancelled2Cancelled by its owner; the rest was refunded
filled3Nothing left: completed, or the rest was refunded (check refunded)
expired4Past the deadline; anyone may refund the rest to the owner
paused10Paused by its owner; nothing fills until it is resumed
not-started5Before the start time
waiting-for-slot6This slot already filled; the next opens at nextSlotAt
spread-too-high7This side's spread is above the order's cap: held
trend-against8Trend pause is on and a trend runs with this side: held
below-limit9The quote is worse than the order's limit price: held
ready0The next slice can fill now

Managing an order

CallWhoEffect
pause / resumeOwnerHold and release fills. A paused order can still be cancelled or refunded
editOrderOwnerRe-plan the REMAINING budget from now: slices, interval, deadline and every rule. Side, recipient and budget are fixed; a paused order stays paused
cancelOwnerRefund what is left at once
closeExpiredAnyoneAfter the deadline, refund what is left to the owner, never to the caller
executeSliceKeeper or ownerFill the current slot's slice if the verdict is ready

The refund record

Every order keeps amountIn (deposited), remaining, refunded and amountOut, so what was actually swapped is amountIn − remaining − refunded from the order alone. The SDK's spentOf and progressOf do this for you.

The deadline is exact. A slice that lands even one second after the deadline reverts as expired; the rest is then refunded.

Unichain Sepolia · chain 1301 · testnetLaunch app