Skip to main content

Yield Protocol

Use Case

You want to build your own money market and offer a fixed saving rate to any dETH holder. You take dETH deposits from many participants and issue an LP token. After 1 year you allow people to redeem the voucher for more dETH. Leveraged borrowing can then happen on those LP tokens to get more dETH etc.

This can be extended to build a self re-paying loan protocol where the savETH yield can re-pay a loan taken out against dETH. The sky is the limit!

Description

The use case mentioned above almost completely covers everything. High level overview of operation:

  • Allow dETH deposits from users and mint shares 1:1 for 1 year

  • Let DAO move dETH into savETH registry to earn yield in an index

  • At some point DAO admin brings back dETH plus interest from the index by calling a single function

  • Users can burn yvDETH to get their dETH + inflation

Features provided by the Smart Contract

  1. For general users:

    • buyShares: Allows users to deposit their dETH and get LP (yvdETH) tokens in return.
    • burnShares: Allows users to redeem their dETH (with increased yield) by burning their LP (yvdETH) tokens.
  2. For admins/DAO:

    • depositIntoSavETHRegistry: Allows the admin to move funds for a particular user from the Smart Contract to the smart contract SavETH Registry.
    • batchDepositSavETHRegistry: Allows the admin to move funds of multiple users from the Smart Contract to SavETH Registry in a single step.
    • withdrawFromSavETHRegistry: Allows the admin to bring back funds from SavETH Registry to the Smart Contract.
    • batchWithdrawFromSavETHRegistry: Allows the admin to bring back funds for multiple users from the SavETHRegistry to the Smart Contract in a single step.

Link to the contract can be found here