Increment Swap is a dual-mode decentralized exchange (DEX) on Flow blockchain supporting both volatile pairs (adopting Uniswap-V2 CPAMM curve, suitable for uncorrelated assets like Flow/USDC) and pegged pairs (adopting Solidly-Stableswap curve, suitable for correlated assets like USDC/FUSD, Flow/stFlow, et al.).
It allows users to create arbitrary trading pairs between fungible tokens in a permissionless way, including basic functionalities like CreatePair, AddLiquidity, RemoveLiquidity, Swap, TWAP-Oracle, Flashloan, etc.
It adopts the factory pattern that each unique trading pair is deployed using the SwapPair template file, with a factory contract storing all deployed pairs.
On-chain time-weighted average price oracle of each of the trading pair is supported by snapshoting cumulative data on the first call of any block. Developers can choose different window size to support different TWAP data.
The trading fee is set to 0.3% for volatile pairs and 0.04% for pegged pairs by default. All of the trading fees goes to liquidity providers (LP) initially. However, there's a switch that factory admin can opt to turn on to earn 1/6 of the trading fees.
There're several fee parameters configurable by the factory admin:
Trading fee of volatile pairs (default to 0.3%)
Trading fee of pegged pairs (default to 0.04%)
Rate of flashloan repayment (default to 0.05%)
feeTo switch (default off, i.e. no protocol cut from the trading fees)
protocol fee cut (default to 0% as feeTo is off, once feeTo is on it's default to 1/6)