We develop a staking arbitrage cross-layer (layer 2) alpha strategy showcasing the need for and use of seamless cross-layer bridging and liquidity transfers
We break our hackathon project into two exciting sub-projects: First - what is the layer 2 alpha strategy? Imagine an investor who is staking in the Arbitrum Curve tricrypto pool (chosen because it exists on both arbitrum and polygon). They receive LP tokens for doing so. Now, say that the activity (trading volume) on the equivalent Polygon pool increases and they want to move their tokens over there instead. Currently, this is not a user-friendly and also an error-prone method. Money can be lost and the investor might not react quickly enough to take full advantage of the shift in volume (which in turn generates revenue for LPs). We want to show that by automating this process and having a quick and safe way to transfer LP tokens between networks alpha can be derived. This, in turn, can help the DeFi community at large and also help break down network silos. Our hackathon goal is to build this strategy and to release a proof of concept to the world! So - to accomplish this: First, we prove that the layer 2 strategy is beneficial to liquidity providers on layer 2. We leverage Moralis with web3.py for this to get on-chain data and analyze it. We show that indeed our proposed hackathon project and its product: the layer 2 alpha strategy can help investors gain more yield. The strategy we build is a strong source of cross-layer alpha - a unique way to expand the DeFi space and its capabilities. We then use The Graph to analyze future benefits of our product. We believe this is the first ever cross-layer cross-chain LP token "fee arbitrage" strategy available to the broader public! Second, we employ Composable Finance's SDK to actually build and accomplish this goal. This library (soon to be released to the public) is used in Composable Finance's new Mosaic bridge. In fact, we added liquidity to this bridge and the ability to transfer LP tokens. In support of this, we also create a lot of content in the form of medium posts to cover the details of our technology, how we implemented it, and how the community at large can benefit from this. We had a lot of fun building this for the betterment of the community and we hope this will be of great benefit to all!
How it's made
We first leverage Moralis and web3.py to study and quantify the alpha associated with fee arbitrage on Layer 2 networks. We focus on Polygon and Arbitrum including the Layer 1 Ethereum mainnet. Then, we employ the newly released Composable Finance SDK and the Composable Finance Mosaic bridge to build this strategy. Finally, we use The Graph to analyze future benefits as well. People can then use this strategy to achieve cross-layer cross-chain alpha.