The seller supplies:
- sell and buy token;
- payment recipient;
- exact sell inventory;
- start and end normalized prices;
- start and end timestamps;
- optional oracle, maximum deviation, and maximum oracle age.
Creation rejects identical token pairs, zero amounts, increasing price curves, schedules longer than 30 days, tokens with more than 18 decimals, and inconsistent oracle settings. The exact sell amount must arrive in escrow.
Before or at the start timestamp, the current price is startPriceX18. During the auction:
price =
startPrice
- (startPrice - endPrice) × elapsed / duration
At or after the end timestamp the view price equals endPriceX18, but fills are no longer accepted.
A fill:
- verifies the auction is active and in its execution window;
- verifies sufficient remaining inventory;
- checks the optional oracle floor;
- calculates the rounded-up buy amount and snapshotted protocol fee;
- checks
totalDue <= maxTotalBuyAmount; - updates auction and aggregate escrow accounting;
- pulls the exact total due from the solver;
- pays the recipient and fee recipient;
- transfers sell inventory to the solver.
The auction closes automatically when remainingSell == 0.
For an oracle price P and deviation d in basis points:
oracleFloor = P × (10_000 - d) / 10_000
The fill reverts when the current auction price is below that floor or the oracle report is zero, from the future, or stale.
- The seller may cancel only while no inventory has been sold.
- Anyone may close an active auction at or after its end time.
- Both paths return remaining inventory to the seller and update
returnedAmount.