PoolTogether V5 uses the CGDA liquidator to sell yield for POOL tokens and contribute those tokens to the prize pool. There are three contracts in this repository:
- LiquidationPair: The core contract that runs a periodic continuous gradual dutch auction.
- LiquidationPairFactory: creates new LiquidationPairs and registers them.
- LiquidationRouter: provides a convenient interface to interact with LiquidationPairs
The LiquidationPair sells one token for another using a periodic continuous gradual dutch auction. The pair does not hold liquidity, but rather prices liquidity held by a ILiquidationSource. The Liquidation Source makes liquidity available to the pair, which facilitates swaps.
A continuous gradual dutch auction is an algorithm that:
- Prices the purchase of tokens against a bonding curve
- Decays the purchase price as time elapses
- Limits the number of tokens purchased according to an emissions rate.
What you get, in a sense, is that a CGDA auction will drop the price until purchases match the rate of emissions.
For more information read the origina Paradigm article on Gradual Dutch Auctions.
The LiquidationPair is periodic, in the sense that it runs a sequence of CGDAs. At the start of each auction period, the LiquidationPair will adjust the target price and emissions rate so that the available liquidity can be sold as efficiently as possible.
Have questions or want the latest news?
Join the PoolTogether Discord or follow us on Twitter:
You may have to install the following tools to use this repository:
- Foundry to compile and test contracts
- direnv to handle environment variables
- lcov to generate the code coverage report
Install dependencies:
npm i
Solve for q, knowing p
We know:
- r: emissionRate
- l: decayConstant
- t: targetFirstSaleTime
- q: purchaseAmount
- p: price