Skip to content

Auctions

LI.FI intent supports four order types: Simple limit orders, Dutch auctions, Exclusive limit orders, and Exclusive dutch auctions. Each intent output encodes a specific order type. Generally, all outputs should be of the same order type.

For an order with multiple outputs, the solver of the first output will always be the recipient of the inputs. The inputs cannot be claimed until all outputs are filled. The auction happens on-chain, with the winner determined by speed.

LI.FI intent limit orders are simple: single price, first execution. That means the amount set in OutputDescription is final and will be what you are paying. The output can be filled once per orderId (the output is hashed and stored in a map with orderId).

The winner of an order is the first solver to call fill(...) and set their identifier for the output.

You can identify Limit Orders by output.context of either 0x or the order type 0x00.

LI.FI intent Dutch auctions are capped dutch auctions. They are fixed in price before and after certain timestamps. The slope, startTime, and stopTime are encoded in output.context.

The winner of an order is the first solver to call fill(...) and set their identifier as the output. Notice that the win selection is equivalent to the limit order, except the earlier the fill is called, the more the solver pays.

You can identify Dutch Auctions by the order type: 0x01. The context is encoded as: bytes1(0x01) | uint32(startTime) | uint32(stopTime) | uint256(slope), with the final amount being computed as:

uint32 currentTime = max(block.timestamp, startTime);
if (stopTime < currentTime) return amount;
uint256 timeDiff = stopTime - currentTime;
return amount + slope * timeDiff;

The maximum amount of the auction is amount + (stopTime - startTime) * slope.

You can find the on-chain implementation here.