The problem CrossVault solves
Yield opportunities in DeFi are scattered across several chains, and chasing all the yield opportunities becomes a nightmare, why? because
- We need to spread your assets across different networks
- We need to hold native tokens in each of these networks (to pay for the gas fee), and it's somewhat of a pain to set up these chains with native currencies
- We need to manually sign multiple transactions, hop multiple apps, and pay multiple fees, moving funds around and paying fees at multiple steps
- We need to reconcile your vault shares from several chains in case you want to see how you are performing
- There are tools to make this easier, but these tools are again scattered
How it works?
CrossVault does two levels of standardization. Firstly, the vault strategies are wrapped into a recently proposed EIP standard ERC 4626 (Tokenized standard vault). After this first level of standardization, we register the wrapped Vault across all the supported chains in CrossVault. We have written a factory for the same so that deploying such contracts is easy, and even other protocols can use in future.
After these contracts are deployed, depositing and withdrawing to the vault becomes one-user-click functionality. This is how that looks like from user's perspective
- User selects the vault they want to deposit to.
- The user enters the amount of underlying asset they want to deposit, and submits the transaction to our router. Since we're multi-chain, this can be done from any supported chain in the CrossVault.
That's it, once the cross-chain sync is complete, the user sees the vault shares/assets in the source chain.
Challenges we ran into
- The most challenging part was to think about atomicity and syncing state across the chains.
- The second most challenging part was to think of a UX where the user has to do only 1 click
- We have used Router Protocol for part of the cross-chain magic. It took us a bit of time to wrap our head around how it works (in terms of how the fee is deducted, what parameters to pass for bridging and router send, etc).
PS: The router team was super helpful.