Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/leveraged steth #159

Merged
merged 33 commits into from
Mar 28, 2024
Merged

Feat/leveraged steth #159

merged 33 commits into from
Mar 28, 2024

Conversation

Andreadinenno
Copy link
Contributor

@Andreadinenno Andreadinenno commented Mar 1, 2024

Implement a leveraged strategy on wstETH using the aave protocol. The vault essentially manages a CDP with wstETH collateral and ETH debt.

Configuration:

  • targetLTV: the Loan to Value the vault looks to maintain
  • maxLTV: the maximum Loan to Value the vault can reach before triggering a rebalance

High level view of the flows:

  • Deposit -> takes wstETH from user and deposits into lending protocol
  • Withdraw -> if the amount requested to withdraw gest the vault above maxLTV, repay part of the debt (full repay if totalAssets withdraw) and withdraw that amount. If not, simply withdraw amount.
  • Increase leverage -> if vault LTV is lower than target, the vault does a loan of ETH, wraps into wstETH, deposits into CDP.
  • Reduce leverage -> if vault LTV is higher than target, the vault does a flash loan of ETH, repay part of debt, withdraws wstETH, swaps for ETH (needed to repay the flashloan)

@Andreadinenno Andreadinenno marked this pull request as ready for review March 11, 2024 14:26
@RedVeil RedVeil requested a review from 0xruhum March 15, 2024 15:09
test/vault/adapter/lido/LeveragedWstETHAdapter.t.sol Outdated Show resolved Hide resolved
src/vault/adapter/lido/LeveragedWstETHAdapter.sol Outdated Show resolved Hide resolved
src/vault/adapter/lido/LeveragedWstETHAdapter.sol Outdated Show resolved Hide resolved
src/vault/adapter/lido/LeveragedWstETHAdapter.sol Outdated Show resolved Hide resolved
src/vault/adapter/lido/LeveragedWstETHAdapter.sol Outdated Show resolved Hide resolved
@RedVeil RedVeil merged commit a79680b into main Mar 28, 2024
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants