Adding Uniswap v3 LP as Collateral

Compound Finance

published on Jan 28, 2025

Uniswap LP as Collateral

In the shadow of Uniswap launching Unichain, Compound wants to take a leading position on the network.

Introduction

We are excited to present the full scope of work required to integrate Uniswap V3 LP positions as collateral for the Compound V3 protocol. This ambitious project aims to extend the protocol’s functionality while maintaining efficiency and a seamless user experience. As a result, Compound V3 users will soon be able to supply Uniswap V3 LP positions as collateral, opening up new opportunities for liquidity provision and lending.

Solution Overview

Whitelist

The governance will whitelist the pool address representing the asset pair. Each pool can have multiple fee tiers, but typically only one or two tiers per pair are actively used. For example:

  • USDC/USDT has a 0.01% fee tier.
  • ETH/LINK has a 0.3% fee tier. We’ll maintain one (maximum two) pools per pair based on volatility.

Supply

The supply method will use the ERC721 token ID instead of the traditional ERC20 value and asset address. Using Uniswap V3’s libraries, we can compute the pool address and retrieve position details using the position manager. Token IDs will be stored for both user-specific and global positions, enabling efficient tracking.

Total Supply Recalculation

The recalculation of total supply involves extracting underlying assets, converting them into a single asset using Chainlink price feeds, and aggregating the values. To avoid high gas costs associated with recalculations, we propose an off-chain service leveraging Chainlink Automation. This approach minimizes on-chain computation and reduces protocol expenses while maintaining decentralization.

Key Features

  1. Chainlink Automation Integration
    • Chainlink’s decentralized network will handle total supply recalculations.
    • Off-chain calculations will reduce gas costs, and the results will be periodically set on-chain by a keeper contract.
    • The keeper contract must be whitelisted by Compound governance.
  2. Rewards Management
    • Option 1: Absorbers collect rewards and recompound them into the same position, increasing transaction costs for liquidators.
    • Option 2: Users interact with LP positions to rebalance rewards manually.
  3. Buy Collateral
    • A simplified interface for liquidators to purchase collateralized LP positions using token IDs.
  4. Bulker
    • A separate contract to streamline the supply of ERC721 tokens.
    • Provides an option for users to create and supply LP positions in one transaction.

Collaborations

Working on this project has been a fantastic opportunity to collaborate with Chainlink’s Automation team, who provided valuable insights into decentralized recalculations. Their support has been instrumental in crafting a reliable solution.

Team