Summary
BasketSwap is a Dapp that is under development on Arbitrum with Stylus that enables users to easily exchange a basket of tokens for a basket of other tokens in a single, optimized transaction.Think of a tool that would allow you to easily convert your crypto holdings into stablecoins at the best prices at an urgent moment - that's BasketSwap.
BasketSwap was initially created to explore the possibilities of Stylus upon its release on Sepolia testnet. We believe that supporting this project would benefit the Arbitrum ecosystem since it bounds existing apps and provides a more convenient and efficient way to interact with liquidity pools, which might drive user adoption. Besides, the team is excited to build BasketSwap as its core functionality was not possible to implement before Stylus due to EVM memory limitations.
Grant funding will be used to build BasketSwap's smart contracts and UI.
About the project
Why build and use BasketSwap?
A few potential use cases including:
-
exit specific stablecoin and swap into other crypto assets
-
exit all non-stable assets and swap into stablecoins
-
exit specific long-tail crypto holding and swap into other crypto assets
-
exchange all crypto assets into either top-tier crypto assets or stablecoins
-
exchange all stablecoins into top-tier crypto assets
-
etc
All above is executed entirely on-chain and can be used ad-hoc or as a building block for personal or community money management.
The user simply needs to specify their desired input and output tokens along with the quantities of the input tokens. BasketSwap takes care of the rest:
-
determines the pools, the routes and execution prices based on pools liquidity data
-
determines such allocation of basket that minimizes user's losses due to price impact
-
performs all swaps
How it works
The smart contract solves an optimization problem - turns a single BasketSwap call into a series of atomic swaps across different pools and finds routes and amounts for each swap to maximize the value of the returned token basket for the user.
The search for the best allocation is built using adaptive grid search algorithm. It incorporates a diversification strategy to avoid local optima and dynamically adjusts the step size for efficient convergence. This approach is adaptable to various objective functions and works even when the underlying pricing functions are complex.
This algorithm requires a lot more memory than the EVM allows and it's now possible to implement though the use of Stylus.
Current status
While BasketSwap is not yet live, a proof of concept has been established. There is 1 person working on it and your support means the world to me.
The goal
Deploy an MVP on Arbitrum initially integrating with Uniswap V3 pools. If funding permits, expand compatibility to include other DEXes on the network.
BasketSwap History
-
accepted into GG21: Thriving Arbitrum Summer 1 month ago.