👻
AaveV3ATokenPayback
Action ID: 0x62c722e3
Allows a user to repay with aTokens of the underlying debt asset eg. Pay DAI debt using aDAI tokens. This is a L2 specific action which has
executeActionDirectL2()
where a tightly packed data is sent. const aavePaybackAction = new dfs.actions.aaveV3.AaveV3ATokenPaybackAction(
useDefaultMarket, market, amount, from, rateMode, aTokenAddr, assetId,
);
This is a DFS STANDARD_ACTION.
User needs to approve the DSProxy to pull aTokens
If amount bigger than the current debt is sent just the max. debt amount will be pulled/paid
Input:
/// @param amount Amount of tokens to be paid back (uint.max for full debt)
/// @param from Where are we pulling the payback aTokens from
/// @param rateMode Type of borrow debt Stable: 1, Variable: 2
/// @param assetId The id of the underlying asset to be repaid
/// @param useDefaultMarket If true the action will inject aave default market
/// @param _market Address provider for specific market
struct Params {
uint256 amount;
address from;
uint8 rateMode;
uint16 assetId;
bool useDefaultMarket;
address market;
}
Return value:
return bytes32(paybackAmount);
Events:
emit ActionEvent("AaveV3ATokenPayback", logData);
logger.logActionDirectEvent("AaveV3ATokenPayback", logData);
bytes memory logData = abi.encode(_market, tokenAddr, _amount, _rateMode, _from)
Last modified 7mo ago