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

Flashloan util #35

Merged
merged 96 commits into from
Feb 20, 2024
Merged

Flashloan util #35

merged 96 commits into from
Feb 20, 2024

Conversation

alfulinku
Copy link
Collaborator

@alfulinku alfulinku commented Jan 12, 2024

This is the smart account implementation that will allow users to take flashloans (from Balancer) and so be able to create leveraged positions

An integration test, working on sepolia, is here

Executing the following scenario:
should test the following scenario with a balancer flashloan and the new multicall account feature:

  • have an account with 10k sDAI
  • flashloan 200k sDAI from balancer
  • approve 210k sDAI to the lending term
  • borrow with 210k sDAI collateral
  • get X gUSDC
  • PSM.redeem X gUSDC for Y USDC
  • swap Y USDC for Z sDAI on uniswapv2
  • reimburse balancer flashloan

REQUIREMENTS: have enough token in the balancer vault (for the flashloan) and a large enough liquidity in univ2 for the swap without too much slippage. The requirements are currently met on sepolia with the current ECG deployment

Gateway implementation also fixes code-423n4/2023-12-ethereumcreditguild-findings#1041

package.json Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@alfulinku alfulinku requested a review from eswak January 12, 2024 15:37
@eswak eswak marked this pull request as ready for review February 8, 2024 08:39
Copy link
Collaborator

@eswak eswak left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (on devrait squash les commits parce que l'historique est pas top)

@eswak eswak merged commit dba62fb into main Feb 20, 2024
@eswak eswak deleted the flashloan-util branch February 20, 2024 14:47
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.

Repayers using EOA accounts can be affected if baddebt is generated when they are repaying loans
2 participants