Introduction to Protocol
SyncSwap v1 is the first version of the exchange protocol released in 2023 during the early days of the zkSync Alpha Mainnet.
SyncSwap Protocol v2/v2.1 are iterations of the v1 protocol. V2 features security enhancements and a new pool type - Aqua Pool to achieve Concentrated Liquidity (CL).
Changes in V2
New Pool Type - Aqua Pool
Aqua Pool is a new pool model introduced in SyncSwap V2. There are only two pool models/types in V1 - Classic and Stable.
Classic Pool works like Uniswap v2 pools, utilizing x*y=k algorithm to support general tradings.
Stable Pool works like Curve v1's Stableswap pools, utilizing a hybrid curve to support stablecoin tradings.
Aqua Pool works like Curve v2's twocrypto pools, utilizing a dynamic hybrid curve with a built-in auto rebalancing mechanism to support volatile assets and LST assets tradings.
Security Improvements
V2 Pools feature security improvements to solve some vulnerabilities like read-only reentrancy. It's audited by top security firms like Halborn, Zellic.
The V1 Pools remain working securely and processing most of the transactions, however V1 pools cannot be used for oracles.
How SyncSwap Protocol works
Deployed contract addresses can be found at https://docs.syncswap.xyz/syncswap/smart-contracts/smart-contracts
Pool Factory
The liquidity pools can be created by corresponding pool factories of their pool type. There are three factories.
SyncSwap Classic Pool Factory
SyncSwap Stable Pool Factory
SyncSwap Aqua Pool Factory
Pool Master
Once a pool is created, the factory will register the pool with Pool Master. Pool Master works like a registry for pools and factories.
Pools of specific (2) tokens and types can be looked up via Pool Master.
Fee Manager
Fee Manager contract stores default and custom swap fees of all pools. Fee Manager can be updated so it's not recommended to use a fixed address. You can get the latest fee manager contract address via functions in the Pool Master.
A Fee Data struct will be returned by querying the pool swap fee, it contains a min fee, max fee and a gamma variable.
minFee - the current minimum fee of the pool
maxFee - the current maximum fee of the pool
gamma - a variable affects dynamic fee volatility, fees will be less volatile with higher gamma
Currently, only Aqua Pool supports dynamic fee, gamma is usually 0 for Stable and Classic Pools (minFee will be equal to maxFee if the fee is fixed)
For backward compatibility, there is also a function to get the swap fee in uint256 directly instead of fee data, it's deprecated as Aqua Pool has dynamic fee enabled and gamma, min/max fees are required.
Last updated