KyberSwap uses this lib to
- 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.
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 recommened to use uint256.Int for better performance b. CloneState should also be implemented