Mercurial is DeFi’s first dynamic yield infrastructure, starting with highly capital efficient AMM pools built on top of this new layer. The liquidity of any protocol built on this yield infra can be allocated to various lending platforms, and the ratio is adjusted dynamically every few minutes for yield optimization.
- User can deposit to get aggregated yield from various lending platforms
- AMM protocol can build on top of vault for higher yield
- DAO treasury can use the vaults to manage their funds
Fig. 1 Overview of Dynamic Yield Infrastructure
Usually, the vast majority of assets in AMMs are completely un-utilized, while wallets, even if they deposited assets into lending platforms, tend to be under-optimized since yields from lending platforms tend to vary greatly between platforms. By depositing the un-used assets of these protocols and wallets into lending platforms, and optimizing the yield every few minutes, the capital efficiency of these protocols and wallets could be greatly increased.
For Mercurial, we will be creating new dynamic pool, e.g. mSOL-2Pool, USDH-3Pool, SOL-USDC to utilize the yield infrastructure. With the added yield, we will be able to make our pools highly capital efficient and reduce the reliance on LM to sustain or grow the liquidity of the pools.
The system will consist of 4 main components, which we will be elaborating more below:
- 1.Vaults: To consolidate the common tokens across all protocols and provide liquidity for the lending protocols.
- 2.Yield Optimizer: To track APYs across the various lending protocols and dynamically adjust the allocation ratio for maximum yield.
- 3.AMM Module: Set of APIs to allow easy integration between AMMs and the yield infrastructure.
- 4.Reward Handler: To claim yield from the lending protocols, which will be distributed to the LPs and stakers.
Fig. 2 Details for Dynamic Yield Infrastructure
Each Vault in the infra layer stores single token assets, e.g. USDC and SOL, and the majority of the assets will be allocated to various lending protocols to earn yield and rewards. The common tokens used in each connecting AMM or wallet will be stored in a single vault, e.g. USDC from AMM and the wallet will be held in the USDC vault. Users and protocols can deposit liquidity to each Vault directly through a simple interface.
Fig. 3 Example of Vault
The yield optimizer will track the APYs across the various lending protocols and dynamically adjust the asset allocation to optimize the yield for the LPs. Optimization will be done once every few minutes to ensure that maximum yield and rewards are being generated for the LPs at any point in time.
Protocols like AMMs and wallets can integrate with the vaults via SDK. The liquidity in the protocols can be deposited into or withdrawn from the vaults directly via simple API calls. The vaults’ yield can be distributed back to the LPs of the integrated protocols.
The rewards handler will be handling the yield generated by the lending platforms. The yield will be stored in a treasury account before being distributed to the LPs and MER stakers.
Our first module will be AMMs built on this yield infrastructure using the proven spl-token swap. We will be incrementally replacing the current pools with new pools built on this new infrastructure.
To the user, the pools will look the same as previously, but underneath the hoods, the assets will be deposited directly into the vaults in the yield layer and dynamically allocated to the external lending protocols to generate yield and rewards for the LPs.
This will allow LPs for the new AMMs to receive yield from a few different places — the lending interest, the LM collected from the platforms, the AMM trading fees and the mercurial LM.
Fig.4 Mercurial Stable Pools vs Dynamic Stable Pools