A Dutch auction is a limit order whose effective price improves over time until a taker fills it. It is built by placing a balance-decay modifier before the swap formula: _dutchAuctionBalanceIn1D shrinks balanceIn (the maker gives more in), so the order grows progressively cheaper for the taker. The maker's tokens stay in their wallet until a taker fills the order. Programs are encoded for SwapVM, the shared swap engine; this Dutch auction archetype belongs to the 1inch Aqua Limit Order and Fusion product, not to the Aqua AMM router.
Dutch Auction is a Limit Order archetype. The instructions on this page (the _dutchAuction* balance modifiers, _limitSwap1D, and the _invalidate* guards) belong to the limit-order opcode set and run on the limit-order router. They are separate from the Aqua AMM router opcode set (Controls, XYCSwap, XYCConcentrate, Decay, Fee, PeggedSwap, Extruction).
Core instructions
| Instruction | Role |
|---|---|
_staticBalancesXD |
Embed starting balances |
_dutchAuctionBalanceIn1D |
Decay balanceIn over time (taker pays less) |
_dutchAuctionBalanceOut1D |
Grow balanceOut over time (taker receives more) |
_limitSwap1D |
Compute amounts at the decayed rate |
Use _dutchAuctionBalanceIn1D or _dutchAuctionBalanceOut1D (or both) depending on which side you want to move.
Program: balanceIn decay
balanceIn decays from its initial value toward zero over duration. The effective input required from the taker decreases, making the order cheaper as time passes.
Program memory program = ProgramBuilder.init(_opcodes());
bytes memory bytecode = bytes.concat(
program.build(_staticBalancesXD, BalancesArgsBuilder.build(
dynamic([tokenA, tokenB]),
dynamic([uint256(1000e18), uint256(2000e18)])
)),
program.build(_dutchAuctionBalanceIn1D, DutchAuctionArgsBuilder.build(
startTime, // uint40 — auction start (unix seconds)
duration, // uint16 — seconds until full decay
decayFactor // uint64 — decay multiplier (BPS = 1e9)
)),
program.build(_limitSwap1D, LimitSwapArgsBuilder.build(tokenA, tokenB)),
program.build(_invalidateTokenOut1D)
);
Instruction ordering: decay instructions are pre-swap modifiers. Place them after _staticBalancesXD and before _limitSwap1D.
Decay direction reference
| Instruction | Effect | Taker outcome |
|---|---|---|
_dutchAuctionBalanceIn1D |
balanceIn decreases over time |
Taker pays less as time passes |
_dutchAuctionBalanceOut1D |
balanceOut increases over time |
Taker receives more as time passes |
Args (from DutchAuction)
| Field | Size | Type | Description |
|---|---|---|---|
startTime |
5 bytes | uint40 |
Auction start timestamp |
duration |
2 bytes | uint16 |
Seconds until decay completes |
decayFactor |
8 bytes | uint64 |
Rate of decay; BPS = 1e9 |
Total: 15 bytes.
Optional modifiers
| Goal | Add |
|---|---|
| Expiry at auction end | _deadline before balance setup |
| One-shot fill | _invalidateBit1D before balance setup |
| Partial fills | _invalidateTokenOut1D after _limitSwap1D |
| Hard price floor | _requireMinRate1D after _limitSwap1D |
Related
DutchAuction: instruction args and decay math
Limit Order: base pattern without time decay
TWAP / DCA: scheduled drip variant