DeFi Saver
Search
K
👻

AaveBorrow

Borrow a token a from an AaveV2 market.

Description

Action ID: 0x5faaad42
Network mainnet: (Deployed address | Code)
Borrow a token a from an AaveV2 market.

SDK Action

const aaveBorrowAction = new dfs.actions.aave.AaveBorrowAction(
market,
tokenAddr,
amount,
rateMode,
to,
onBehalfOf,
);

Contract

This is a DFS STANDARD_ACTION.
Input:
/// @param market Address provider for specific market
/// @param tokenAddr The address of the token to be borrowed
/// @param amount Amount of tokens to be borrowed
/// @param rateMode Rate mode, 1 - stable, 2 - variable
/// @param to The address we are sending the borrowed tokens to
/// @param onBehalf On behalf of address we are borrowing, defaults to proxy
struct Params {
address market;
address tokenAddr;
uint256 amount;
uint256 rateMode;
address to;
address onBehalf;
}
Return value:
return bytes32(borrowAmount);
Events:
emit ActionEvent("AaveBorrow", logData);
logger.logActionDirectEvent("AaveBorrow", logData);
bytes memory logData = abi.encode(
_market,
_tokenAddr,
_amount,
_rateMode,
_to,
_onBehalf
)