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

refactor: defer deposit/borrow limit checks to the end_flashloan ix #251

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cxp-13
Copy link

@cxp-13 cxp-13 commented Sep 26, 2024

In #196. The second point is already implemented because in the flashloan_success_1op test in programmes/marginfi/tests/user_actions/flash_loan.rs, the user borrows money and pays it back, which is the process of going from poor health to normal.

The unfulfilled understanding of the first point (Defer deposit/borrow limit checks to the end_flashloan ix) is as follows:

  1. In the lending_account_borrow function, BalanceDecreaseType::Any is passed in when bank_account.borrow, which is the borrow function of BankAccountWrapper.
  2. Because BalanceDecreaseType::Any was passed in, performs Bank's deposit and debit checks.

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.

1 participant