[Nextosi] Contracts that enable Uniswap LP tokens as Collateral on Compound

Goal

We were approached by the growth team’s for both Compound and Uniswap who were both excited to (as the title states) add Uniswap V3 LP tokens as Collateral on Compound.

Approach

In response, we’ve developed a novel solution that allows ERC721s to be represented as ERC20s so they work with Compound’s existing infrastructure without the need for any changes to the Compound’s codebase. The solution can be thought of as a vault factory that the Compound DAO will own and control, Compound chooses what Uniswap-Lending-Pool(s) to allow deposited into that vault, and which vault tokens to whitelist on Compound. The vault then handles the complexity of pricing, rebalancing, claiming rewards, and managing the other nuances that set ERC721’s apart from ERC20s.

Stage

To start a conversation about the merits of this approach, the smart contracts have been deployed on testnet, and their current versions have been shared on our github. GitHub - nextosi/Compound20Uniswap721 These are not the final versions of the contracts, they require further refinement & testing, however before proceeding we would like to involve developers from the community to obtain feedback, and to allow the community to enjoy having fun working with some of the contracts we’ve created.

Request

Please review the contract code on github and play around with the frontend interface. These contracts will eventually require an on-chain vote from the Compound community if they’re to be deployed by the DAO and Uni-LP tokens allowed as collateral on any markets. It’s important for the initiative’s future success to acquire feedback that ensures we’re building what’s best for the protocol and supported by the delegates. All contracts are highly modular for changing items like Oracles, Positions, Rebalancing, and Liquidation with whomever deploys the contracts being able to set any variables they wish. This architecture would allow the Compound DAO to rapidly deploy new pools on Compound while maintaining the security and control it needs to adapt to changing markets.

2 Likes

Thank you @Nextosi for the comprehensive Github project & readme, I look forward to testing it out.

I have to admit to skepticism over the value of enabling Uniswap LP as collateral. Aave did this a long time ago with Uniswap V2 LP tokens and found basically zero product-market fit.

Can you walk us through what a liquidation would look like on this market, at a high level? Presumably there is no meaningful liquidity for the tokenized V3 LP, so the contract needs to withdraw some of the LP (or dip into rewards if it is collecting them periodically and the amount to liquidate is small enough) and then sell the withdrawn “underlying collateral” assets for the base asset. Is that what would happen here, or is there some workaround to make this less onerous? Are there additional market execution risks associated with those additional steps?

3 Likes

The growth team is excited for the product’s opportunity to build a closer relationship with Uniswap now that AlphaGrowth runs the Uniswap DAO’s growth program. Uniswap is working with AlphaGrowth to draft a forum post announcing their intention to launch Compound on UniChain. And with the presence of vaults like these on Unichain the investors can use Uniswap and Compound together to build complex positions like Delta Neutral strategies without requiring any additional structured products. I’m excited for the prospect having seen the ideation & collaboration between the two DAOs.

How liquidation works

You’re correct, liquidating Uniswap V3 LP collateral would entail unwinding the LP position, retrieving the underlying tokens, and swapping them into the borrowed asset. The code you can review in github includes a

  1. Rebalancer for periodic fee collection and proactive position adjustments
  2. Liquidator for efficient liquidation execution

Together these Compound-Uniswap integrations can streamline the liquidation process, mitigating gas costs and market impact.

Yes, The Rebalancer can periodically collect fees from LP positions. These accrued fees can help cover smaller liquidation amounts without fully breaking apart the entire position.

While the liquidator contract makes the process more efficient, anyone can call it, keeping the liquidation process decentralized, and a user can choose the pools they would like to use during the liquidation process, if different than the default pools.

Thank you for your efforts in developing contracts that enable Uniswap LP tokens as collateral. Since similar ideas have been explored by other protocols, we’d like to add some color around the historical context to align our understanding. We are interested in learning the key differentiators of this implementation and how this proposal could drive value to Compound.

Our understanding is that much of this development revolves around active liquidity management, which involves automated strategies to maintain liquidity within the active price range, maximize fee income and mitigate risk based on market conditions. Due to the algorithmic and operational complexity of these strategies, several solutions have emerged in this category, including Arrakis Finance, Gamma, and ICHI. The total value locked (TVL) in this category peaked in 2022 before experiencing a significant decline.

LP performance in Uniswap v3 is closely linked to the effectiveness of the underlying execution strategy and infrastructure. Factors such as range selection, rebalancing cadence and gas costs have a significant impact on profitability. In addition, Just-in-time (JIT) liquidity can also reduce returns for LPs that do not employ similar approaches. Building active liquidity management solutions therefore requires careful consideration of all of these factors, along with the non-trivial risks associated with smart contracts.

Given the challenges of active liquidity management, enabling LP tokens as collateral has been explored as a way to unlock additional value for liquidity providers. Several stablecoin and lending protocols have experimented with enabling LP tokens as collateral, but none have achieved widespread adoption currently.

The current smart contract implementation tokenizes Uniswap v3 positions into fungible ERC-20 tokens with a customized Rebalancer contract to automate liquidity range adjustments and fee compounding. This approach seems similar to Arrakis Finance’s (rebranded from Gelato Network) G-UNI.

Questions

  • Use Cases for Uniswap v3 LP as Collateral
    • Based on the earlier examples, one of the few use cases that gained traction is borrowing stablecoins against stable-stable pair LPs (i.e., GUNIV3DAIUSDC in Maker). However, Compound does not have a stablecoin product. What are the potential use cases for go-to-market? What kind of demand do you see for this type of market structure?
  • Partnership vs. Custom Implementation
    • There are a few other active liquidity management solutions (e.g. Arrakis v2) that have been around for a while, and they’re proven in terms of contract implementation and experience with automated infrastructure. What are the trade-offs between partnering with existing solutions versus developing a custom implementation?
  • Rebalancing Strategy
    • How does the rebalancing strategy compare to similar solutions such as G-UNI, Gamma vault, ICHI vaults, etc? What’s the plan for optimizing the rebalancing parameters?
  • Orchestration Infrastructure
    • How will the rebalancing be orchestrated? What automation infrastructure is planned for this purpose?
  • Asset Correlation Structure
    • The asset correlation structure can change significantly based on the positions, especially for volatile asset-stablecoin pair, so the parameters need to be conservative. Do you have a specific methodology in mind for setting the parameters? What are your thoughts on the market risk implications?”

In summary, enabling Uniswap v3 LP tokens as collateral comes with several challenges. Addressing the key questions outlined would be critical to move the project forward.

3 Likes