Core concepts
DEX Functionalities
Before concentrated liquidity there was only one major liquidity solution across the broader defi, we coin this term as "Uniswap v2" pools and below we will discuss its implementation into Pharaoh.
Swaps
On PHARAOH, similar to other decentralized exchanges (DEXs), users can swap tokens for others. The slippage and trade price are determined based on the total value locked in the liquidity pairs and whether arbitrage activities have balanced the pool to its market rate.
PHARAOH features two types of Liquidity Pools, each with its own swap curve:
Volatile (UniV2-Style): This is the basic type of pool where tokens are paired with equal weights i nterms of dollar value. The volatile swap curve is used to facilitate trades within these pools. The math for these pools is as followed:
Correlated (Andre-Style): PHARAOH utilizes a stable swap curve that is an efficient implementation compared to other DEXs. The stable swap curve, originally devised by Andre, offers near-zero slippage and is designed to honor his innovative approach to stable swaps. The math for these pools is as followed:
A more technical visual of the ve(3.3) Swap Curves
To provide a graphical representation of the ve(3,3) swap curves, the graph below illustrates the variance between 0 and 100. It demonstrates that the Green (Correlated) curve exhibits less slippage from the mean as the K value fluctuates.
_insert graph here _
This visualization, as complicated as it may seem, helps users understand the behavior of the swap curves and the corresponding slippage levels associated with different values of K. PHARAOH aims to provide an optimized trading experience with minimal slippage, enhancing liquidity provision and ensuring efficient token swaps for users.
Speaking of swap fees!
Fees are adjustable by the PHARAOH multisig if need be, to ensure the competitiveness and attractiveness for vePHAR holders. The average ranges* of each will be around:
- Volatile (0.2-2%)
- Correlated (0.01%-0.03%)
- Native (1%-3%) In the event of extreme market volatility, the PharaohReserve can hike the fees past the ranges, within reason.
The theoretical MIN and MAX for the pair fees is (1<= Fee <= 500bps). This means the minimum fee is 0.01%, and the highest is 5.00%.
Liquidity Provider Staking
In the v1 PHARAOH model, LP providers do not earn swap fees since 100% of fees go to vePHAR holders. Instead, staking gauges are implemented to incentivize users to provide LP tokens to earn attractive APRs. The more votes allocated to a pair, the more PHAR that will be emitted to the gauge in the following epoch. A user's gauge boost influences the rewarding rate of each LP position. The larger your vePHAR position, the higher LP boost you will have in proportion to your position. You can read more about gauge boosting in the ___ section.