Pools
Last updated
Last updated
Each pool is determined by pool tokens (same way as Uniswap) and pool type: volatile or stable. Volatile uses normal xy=k curve for pricing and liquidity same way as Uniswap, while stable pools use x^3*y+x*y^3=k curve, which works better if we assume that pricing between pool assets should be close to 1:1.
Swaps, liquidity addition to an existing pool, liquidity removal works the same way as Uniswap V2. Except for one detail, that on each operation the user needs to choose a pool type (stable or volatile, which is sent to smart contracts as bool variable βstableβ for those operations).
When creating a new pool (adding initial liquidity) besides choosing a pool type, a user can specify LP (liquidity providers) lockers fees % (in range from 0% to 100% with 2 decimals). If a user specified this % as more than 0, on an initial liquidity provision it will deploy FeeDistributor and TokenLocker contracts with immutable parameters through LockFactory contract, which is set for Infusion Router contract. This parameter is defined as βlockerFeesPβ in smart contracts everywhere and is immutably stored for each pool and is subtracted from non-locked LP tokens fees on each accrual and sent to FeeDistributor contract, which distributes locked fees to locked LPs in daily epochs. Locked LPs also get 100% of their own earned LP fees.
This is a totally new contract, which is set in a Router contract, responsible for creating TokenLocker and FeeDistributor contracts tied to each pool if specified LP locker fees % (lockerFeesP parameter) > 0. FeeDistributor contract is immutably set at pool Pair contract during pool creation.