What it does

We aim to construct the price oracle with high liquidity and make optimal swap engine (MaxSwap) with this price oracle on the Polygon chain. Our optimal swap engine first finds the optimal swap paths and then executes arbitrage trading to maximize the outcome. MaxSwap is expected to alleviate the potential danger of the large price impact and slippage from DEX traders on the polygon chain.

How we built it

We build the back-end server which fetches pool information at every block genesis time. Then, we make the swap simulator which imitates real swap mechanisms (Uniswap V2, Uniswap V3, Balancer, Curve, Curve crypto). We develop path finding algorithm which finds optimal swap paths with this simulator. Finally, we build the front-end server which executes smart contract with the recommend swap paths.

Challenges we ran into

  1. Time complexity of the path finding algorithm (Optimal swap engine should provide reasonable performance in real-time)
  2. Various swap mechanisms of the pools on the polygon chain (Uniswap V2, Uniswap V3, Balancer, Curve, Curve crypto)
  3. Collaboration between team members with different domain knowledge

Accomplishments that we're proud of

  1. Our project contributes to the polygon community to handle the price impact and slippage issue.
  2. Our team collaborated with each other to complete a project which requires various domain knowledge (Path finding algorithm, Back end, Front end, Smart contract, etc.) despite the short hackaton schedule.

What we learned

We understand the polygon chain mechanism and learn how to build the smart contract on the polygon environments. Also, we developed the efficient DEX aggregator algorithm with comparable performance to the state-of-the-art aggregator algorithm.

What's next for MaxSwap

We would accelerate the performance of our swap engine with parallel computation with GPU cuda operation. Also, we aim to integrate liquidity of several chains of DEX for the better price oracle and swap engine.

Built With

+ 3 more
Share this project:

Updates