aave-v3-core icon indicating copy to clipboard operation
aave-v3-core copied to clipboard

`repay` should not throw when repaying a borrow of the same block

Open jkrivine opened this issue 3 years ago • 3 comments

Reading at the audits it seems AAVE added this check in order to force users to use flashloan instead of the borrow-repay sequence in the block. I think this is wrong for two reasons:

  • a flashloan is a service that has an added value to the user because you can borrow the liquidity of other accounts on the pool (which might justify fees). However a sequence borrow-repay is done on the user's collateral. So preventing this should be considered as abusive.
  • this restriction might become a blocker for cash managers that rely on AAVE pools because their account on aave integrates multiple user's account on their side: user A of the protocol P tries to repay its debt on AAVE via P while user B of the protocol tries to borrow, also via P. This is interpreted as an illegal sequence by the pool's logic that identifies user A and B as P.

jkrivine avatar Jul 15 '22 10:07 jkrivine

Agree with the second point. This requirement has caused some issues for integrators where users positions are aggregated into one single account.

miguelmtzinf avatar Jul 22 '22 07:07 miguelmtzinf

good to know. I am curious why you would disagree with the first point though :)

jkrivine avatar Jul 25 '22 13:07 jkrivine

good to know. I am curious why you would disagree with the first point though :)

I assume was initially designed to prevent free loans of 1 block duration, since there is already a function for that. I dont have any personal preference about this

miguelmtzinf avatar Aug 09 '22 10:08 miguelmtzinf