Understanding the Perpetual Ecosystem Basis Trading Protocol Lemma: How to Achieve Arbitrage in Perpetual Contracts?
Written by: angelilu
During last year's DeFi Summer, the success of the AMM mechanism showcased the scalability of on-chain finance, leading to changes in the previously centralized perpetual contract market landscape. Decentralized perpetual contract platforms began to emerge, but due to issues such as performance and depth, there were not many users and funds on these platforms. However, with the launch of various Layer 2 solutions this year, decentralized derivatives platforms have rapidly developed by overcoming performance issues, with new projects emerging continuously and leading projects developing their own ecosystems.
In February of this year, the decentralized perpetual contract trading platform Perpetual Protocol achieved a daily trading volume exceeding $100 million, leveraging the relatively fast and low-cost sidechain xDai. In the new V2 version, Perpetual will launch on the Ethereum Layer 2 network Arbitrum and will utilize the liquidity of Uniswap V3.
Meanwhile, Perpetual's ecosystem is also developing, with the basis trading protocol Lemma Finance being one of the first to receive funding from the Perpetual ecosystem fund, providing a platform for automated arbitrage using perpetual contracts in the decentralized market.
What is Lemma Finance
In traditional finance, basis refers to the difference between the spot price and the futures price. By applying the concept of basis, investors can hedge against price changes in the spot market by simultaneously engaging in equal but opposite buy and sell activities in the spot and futures markets for the same category of goods.
Perpetual contracts are a unique type of derivative trading in cryptocurrency, and the funding rate is a specific model within perpetual contracts, referring to the periodic payments made to long or short traders based on the difference between the perpetual contract market and the spot price. In perpetual futures contracts, when there are more long traders for a certain asset, it drives up the futures price, causing the perpetual futures contract price to be higher than the spot price. At this point, the basis is negative, and the funding rate is positive. To balance supply and demand, long traders must pay fees to short traders (suppressing long positions and incentivizing short positions), and vice versa.
Some professional traders utilize the funding rate model to earn profits while hedging certain risks, but this operation requires a level of expertise and has certain thresholds. Therefore, Lemma combines the funding rate arbitrage model using smart contracts, allowing users to simply deposit funds into Lemma, which will automatically execute trades to achieve arbitrage.
Lemma's Strategy
Lemma currently integrates with the decentralized derivatives trading platform Perpetual, supporting ETH as the asset type. According to its official documentation, after users deposit ETH into the platform, Lemma first checks the current funding rate situation on the decentralized derivatives exchange and then selects the corresponding hedging profit method.
For example, in the current situation, the funding rate for Perpetual's ETH contract has remained negative for some time, indicating that the amount of short positions exceeds that of long positions, which means it is in a "short pays long" situation. In this case, Lemma will first sell all the Ethereum deposited by the user and convert it into USDC. Then, it will buy a long position on Perpetual equivalent to the amount of Ethereum the user deposited. This way, the overall Ethereum holdings of the platform will match the user's deposit, while also earning additional funding income from the "short pays long" situation. Lemma will also reinvest the received funding fees to buy more Ethereum long contracts, providing users with more returns.
When the funding rate is positive, meaning the platform is in a "long pays short" situation, Lemma will deposit half of the user's Ethereum assets into the Perpetual platform to open a short position, thereby hedging the price fluctuation risk of the remaining half of the assets in the platform. This portion of the short position will regularly receive funding income from "long pays short."
Of course, in practice, Lemma's strategy may be much more complex, influenced by factors such as gas costs, slippage, and market conditions. In simple terms, when the funding rate of the contract platform chosen by Lemma is negative, the platform will convert the user's deposited Ethereum spot into an equivalent long position to earn additional funding fee income. When the funding rate is positive, the platform will hedge the price fluctuation risk of the short position using the spot while earning the funding fee from the short position.
Conclusion
Lemma Finance is currently in the testing phase, and during testing, it has reached its funding limit. The team indicates that the protocol may also face various risks such as negative funding rates, slippage, and other fees. The protocol operates through smart contracts deployed on the Ethereum blockchain, and future upgrades and modifications will increasingly be managed in a community-driven manner. Lemma's official documentation states that it will integrate more exchanges, and Perpetual has announced that Lemma will soon be deployed on the Arbitrum mainnet, possibly related to the upcoming launch of Perpetual V2 on Arbitrum.