aave-v3-core
aave-v3-core copied to clipboard
Allow `withdraw` function to be called on behalf of some account.
Currently all interactions with the pool can be done onbehalf
of another account (modulo approval), except withdraw
.
This makes it gas costly for a protocol managing user's funds on AAVE because it needs to transfer overlyings from the user's account to the protocol's account before being able to withdraw. Unless there is a good reason not to do this (i'd be curious to know), in general it is a nice feature that all functions that pull funds from a protocol (here, borrow and withdraw) can be done 'onBehalf' and 'to' some accounts (with the required approval).
@jkrivine How would you give allowance to someone to withdraw on your behalf?
Dont do it i didnt give no one permission
@jkrivine How would you give allowance to someone to withdraw on your behalf?
well, you can borrow on someone's behalf by using a special approval of the debt token, a similar scheme could be used on aToken
using an approveDelegate
function. When a delegatee wants to withdraw on delegator's behalf the logic would need to check that:
- Allowance is enough to withdraw
- the health factor of the delegator's account permits the withdrawal
@jkrivine How would you give allowance to someone to withdraw on your behalf?
well, you can borrow on someone's behalf by using a special approval of the debt token, a similar scheme could be used on
aToken
using anapproveDelegate
function. When a delegatee wants to withdraw on delegator's behalf the logic would need to check that:
- Allowance is enough to withdraw
- the health factor of the delegator's account permits the withdrawal
The concept is straightforward, but I think a "withdraw on somone's behalf" does not bring value. As a user:
- I can send directly my aToken to another user so he can withdraw
- I can approve another user, so I can still earn yield until he pulls and withdraws.
I suggest you to open a thread in the governance forum so the community can discuss about it