Idea on how to bring stETH to Anchor protocol

Background:
LIDO allows users to stake their ETH into the ETH2.0 PoS network. Normally you need to run your own node and require at least 32ETH to participate. Also your funds will be locked until ETH2.0 is released. But with LIDO you can stake your ETH and get back stETH + the 5% (current) staking reward from ETH2.0. The benefit of this is that stETH can be swapped for ETH at any time so you are no longer locked until ETH2.0 is released.

Getting staking rewards:
The way stETH hands out staking rewards is via rebasing. Every day at 12:00UTC the amount of stETH in everyone’s wallet will slightly increase to account for the rewards earned that day from ETH2.0. This does not cost any fees since the stETH contract is rebasing and not sending you more stETH.

The problem for using stETH:
Although stETH is a freely tradable asset it does have issues when being used as collateral. Most DEXs and AAVE do not support rebasing of assets locked into the protocol. So depositing stETH into AAVE will lead you to lose your rewards for the time that it is locked. LIDO has already solved this but creating wrapped stETH (Wrapped stETH (wstETH) | Lido: Help).
In a nutshell, you lock your stETH into a contract that returns wstETH to you. This wstETH can be locked into any DEX or lending platform while the stETH you wrapped accrues staking rewards in the background. When you unwrap your wstETH you will receive stETH deposited + rewards. This is done in a similar way to how aUST can usually be traded for more UST since aUST represents deposited UST + interest earned.

How to bring stETH to Anchor:
Terra and Anchor (to the best of my knowledge) do not support rebasing either. But this is not an issue, the LIDO team has already solved the problem for us. We can simply copy their wstETH strategy to bring staking rewards to Anchor. This can be done by immediately wrapping any stETH bridged to Terra. This is how it would work:

  1. User on Ethereum network has stETH.
  2. User bridges stETH to Terra. In the background what the bridge does is wrap stETH + send wstETH to Terra (Terra-wstETH)
  3. User receives Terra-wstETH and deposits it into Anchor protocol as collateral.
  4. Anchor immediately sends the Terra-wstETH back to Etherum. This means Terra-wstETH gets converted back to stETH on Ethereum.
  5. Anchor wallet on Ethereum accumulates stETH rewards via rebasing everyday. Possibly selling stETH of UST every day and sending UST back to Terra.
  6. User wants to withdraw collateral. Anchor sends stETH back to Terra-wstETH and refunds user the original Terra-wstETH deposited.
  7. User bridges Terra-wstETH back to stETH on Ethereum and continues receiving staking rewards on their stETH.

Thanks to somethingelse on Discord for showing me Anchor Devs implementation idea for this: anchor-collateral-steth/spec.md at main · lidofinance/anchor-collateral-steth · GitHub.
The main difference between my idea and theirs is that with their idea all holders of stETH on Terra will lose their staking rewards regardless of whether it is deposited into Anchor or not as collateral. In my solution all users keep their staking rewards unless they deposit collateral, analogous to how bLuna holders get staking rewards unless they deposit their bLuna as collateral.

Similar to how you can claim bLuna rewards unless you deposit it as collateral.

Let me know what you think. If everyone likes this I can get working on this ASAP! Or if developers want to take over, they would do a better job anyway.

About fees, again thanks to somethingelse on discord.

With the Dev’s current method there are only two transfers between Ethereum and Terra.

  1. stETH → bETH (user sends eth to terra).
  2. bETH -stETH to return funds (user removes eth from terra).
  • the cost of losing rewards.

With my idea there are 4 transfers.
stETH → Terra-wstETH. (user sends eth to terra).
bonded-Terra-wstETH → stETH (anchor sends eth to ethereum).
stETH → Terra-wstETH (anchor returns eth to ethereum).
Terra-wstETH → stETH (user removes eth from terra).
4 transfers but users get to keep rewards when ETH is not being used as collateral.

However, Dev’s current way FORCES users to send unused bETH back to Ethreum immediatly so they do not continue losing their reward. Mine lets users keep ETH on terra indefinitely since they continue to gain rewards when not bonded to Anchor. This could inspire more use cases for staked ETH on terra. Not just Anchor.

bETH is currently in development. Btw, revisions has been made such that bETH holders also accrue rewards, even if they don’t put it into Anchor.

On a sidenote, do you have interest in developing Terra smart contracts? There’s a couple of dev ideas for improving Anchor contracts if you’re interested.

If a user holds bETH in their wallet, is their claim of rewards in more bETH or does it claim in UST? If the latter, it would automatically create demand for UST (backend swaps bETH rewards for LUNA and then burns LUNA for UST) and increase LUNA price.

We’re planning to give rewards in UST

Wowwwww. This will create automatic demand for UST. Brilliant!

Hi! such a late reply I am sorry, had some work I had to do and did not follow the forum. I am interested in developing, but I do admit I have little experience with smart contracts, although I am proficient on python. Let me know something I can try tackling as I am very interested!

Great to hear - could you drop me a Telegram dm to @ryanology045 ?