Skip to content

Integrate Liquity V1 Stability Pool for LUSD Collateral Yield #997

@0x4007

Description

@0x4007

Problem

Plain LUSD collateral earns 0% yield. Integrate Stability Pool for ~6.28% APR (Dune data) to fund governance token buybacks, without disrupting liquidity.

Solution

Add StabilityPoolFacet via diamond proxy. Auto-deposit LUSD to pool on mint; withdraw principal on redeem. Harvest ETH/LQTY yields during redeems for buybacks/compounding (protocol-owned only). Piggyback ops on user txs for gas efficiency.

Alternatives Considered

  • AAVE (~3.24% yield, more complex).
  • Leverage/LPs (higher risk).
  • V2 migration (future option for multi-collateral).

Implementation Spec

Prerequisites

  • Audit facet (~$10-20K budget).
  • Integrate IStabilityPool.sol (address: 0x66017D22b0f8556afDd19e1e5b5f1cbD89a6C337).
  • Add 1inch/Uniswap for swaps.
  • New storage: totalPrincipalInPool (uint256), protocolTreasury (address).

Facet Functions

  • depositToPool(uint256 amount): Call provideToSP(amount, address(0)).
  • withdrawFromPool(uint256 amount): Call withdrawFromSP(amount).
  • harvestRewards(): Claim rewards, swap (e.g., 50% to LUSD for compounding, 50% to governance token for buybacks).

Flows

  • Mint: Transfer LUSD → Deposit to pool → Mint uUSD → Update totalPrincipalInPool += amount.
  • Redeem: Burn uUSD → Calc principal → Withdraw/transfer principal → Harvest if rewards > threshold (route to treasury) → Update totalPrincipalInPool -= amount.

Over-Collateralization

Value pool as LUSD equivalent (Chainlink oracles for ETH/LQTY). Redemptions: principal only.

Monitoring/Automation

  • Chainlink/Gelato for optional harvests. It would be nice to sell the ETH/LQTY for LUSD and boost holdings as soon as it is rewarded by the stability pool.
  • Dune alerts for APR/supply.

Testing

  • Unit: Deposit/withdraw/harvest (Foundry).
  • Integration: Mainnet fork; simulate liquidations.
  • Edges: Low liquidity, volatility, mass redeems. Gas: <200K extra per tx.

Deployment

  1. Deploy facet.
  2. diamondCut via multisig.
  3. Verify on Etherscan.
  4. Phased: Opt-in for new deposits.

Risks/Mitigations

  • Yield variability: Fallback to plain LUSD if APR <3%.
  • Supply crunch: Auto-withdraw if < $10M.
  • Security: Audit for reentrancy.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions