-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Gradual Dutch Auction Module #1
Comments
Implementation ConsiderationsIn the previous auction system, a complicated price scaling system was used to cover a broad range of token prices and decimal values while avoiding under/overflows of the math. This was required due to the multiplication of two variables to calculate a price in the original SDA algorithm. This is no longer required. Instead, I believe it makes the most sense to have quote token quantities and auction prices stored in quote token decimals (i.e. quote scale). Base/payout token quantities can be represented in base token decimals (i.e. base scale). The auction price equations detailed above require various math operations not available in standard Solidity. Additionally, there are some negative values used in the equations so it is not strictly unsigned math. Therefore, a FixedPoint Math library is required. The most robust that I have seen is PRBMath. For this case, we will need the |
After further review and discussion with tex, plan to only implement the exponential decay GDA and include a minimum price term in the equation. The updated math can be found here: https://oighty.eth.limo/gda-w-min-price/ |
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 purchaseWe 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 providingWe derive this by inverting the
priceFor
equation.We again take a minimum to truncate the equation to enforce a minimum value.
where:
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 purchasepayoutFor
: number of payout tokens to receive for providingWe derive this by inverting the
priceFor
equation.where:
The text was updated successfully, but these errors were encountered: