Inspiration

Optimal Swap is the optimal routing solution to provide the best swap rate. Just like 1inch or matcha on EVM, a dex aggregator is needed to Aurora and the transaction should be executed under more favorable conditions in real-time.

What it does

Optimal swap has a price oracle function with high liquidity and an optimal swap engine with this price oracle on the Aurora. Our optimal swap engine first finds the optimal swap paths and then executes arbitrage trading for the optimal outcome. Optimal Swap is designed to find the hidden profits which was hindered by the potential danger of the large price impact and slippage from DEX traders.

How we built it

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


Challenges we ran into

  1. Time complexity of the pathfinding algorithm (Optimal swap engine should provide reasonable performance in real-time)
  2. Various swap mechanisms of the pools on the aurora chain (Uniswap V2, Curve)
  3. Collaboration between team members with different

Accomplishments that we're proud of

  1. Our project contributes to the aurora 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 (Pathfinding algorithm, Back end, Front end, Smart contract, etc.) despite the short hackathon schedule.

What we learned

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


What's next for Optimal Swap

In the future, We will integrate near eco-system also. By doing so, we can aggregate the liquidities of the near eco-systems both aurora(solidity based dexes - trisolaris, …) and near(rust, js-based dexes - Ref.Finance, …). It can minimize traders’ price impact & slippage so that traders can get better swap output amounts. Swap volumes could be increased by our products by removing the huddles of the DEX swap system and Liquidity providers could gain more from swap fees.

Built With

Share this project:

Updates