KyberSwap uses this lib for off-chain tracking and computation, specifically
- Fetch pools;
- Track latest pool states; and
- Simulate expected output for a given input swap amount
in order to search for the optimal aggregated swapping route.
- Off-chain: Implements 3 things in pkg/liquidity-source (pkg/source contains legacy code using big.Int):
- PoolsListUpdater: fetches latest pool list incrementally
- PoolTracker: tracks latest pool state on new log event or on an interval
- PoolSimulator: simulates expected output for a given input swap amount a. It's recommended to use uint256.Int for better performance b. CloneState should also be implemented
- On-chain: Contribute encoding to https://github.com/KyberNetwork/ks-dex-adapter-lib