Description
Implement a standard Continuous Gradual Dutch Auction with options for Linear and Exponential Price Decay. The concept is based on this article by Paradigm, which covers the Exponential case.
An initial version (where the equations are not updated to these versions) is implemented in src/modules/auctions/GDA.sol.
Auction Pricing Math
Exponential GDA
price in quote tokens for single (infinitesimal) auction at a time t:
priceFor
: number of quote tokens required to purchase
We cannot add a minimum price directly into the equation in the exponential case because we run into issues with a special function case. However, we can truncate the equation with a minimum price.
payoutFor
: number of payout tokens to receive for providing
We derive this by inverting the priceFor
equation.
We again take a minimum to truncate the equation to enforce a minimum value.
where:
-
$k$ is the starting (equilibrium) price of the auction -
$k_{min}$ is the minimum price that the auction will reach -
$\lambda$ is the decay speed constant. This needs to be set with context for the minimum price to avoid sharp bends in the curve as it approaches the minimum. -
$t$ is the time since an individual auction started. -
$T$ is amount of time passed since the oldest available auction started. -
$r$ is the emission speed of the auction in payout tokens per second. It can calculated by the capacity of the auction in payout tokens divided by the duration of the auction in seconds.
Linear GDA
price in quote tokens for single (infinitesimal) auction at a time t:
In the linear case, we can introduce a minimum term into the individual auction equation.
priceFor
: number of quote tokens required to purchase
payoutFor
: number of payout tokens to receive for providing
We derive this by inverting the priceFor
equation.
where:
-
$k$ is the starting (equilibrium) price of the auction -
$k_{min}$ is the minimum price that the auction will reach -
$\lambda$ is the decay speed constant. This needs to be set with context for the minimum price to avoid sharp bends in the curve as it approaches the minimum. -
$t$ is the time since an individual auction started. -
$T$ is amount of time passed since the oldest available auction started. -
$r$ is the emission speed of the auction in payout tokens per second. It can calculated by the capacity of the auction in payout tokens divided by the duration of the auction in seconds.