👻AaveV3Borrow

Description

Action ID: 0x9e9290b1

Borrow a token from AaveV3 market.

SDK Action

    const aaveBorrowAction = new dfs.actions.aaveV3.AaveV3BorrowAction(
        true, nullAddress, amount.toString(), to, rateMode, assetId, true, nullAddress,
    );

Contract

This is a DFS STANDARD_ACTION.

Input:

    /// @param amount Amount of tokens to be borrowed
    /// @param to The address we are sending the borrowed tokens to
    /// @param rateMode Type of borrow debt Stable: 1, Variable: 2
    /// @param assetId The id of the token to be borrowed
    /// @param useDefaultMarket If true the action will inject aave default market
    /// @param useOnBehalf If true the action will inject _onBehalf addr
    /// @param market Address provider for specific market
    /// @param onBehalf On whose behalf we borrow the tokens, defaults to proxy
    struct Params {
        uint256 amount;
        address to;
        uint8 rateMode;
        uint16 assetId;
        bool useDefaultMarket;
        bool useOnBehalf;
        address market;
        address onBehalf;
    }

Return value:

return bytes32(borrowAmount);

Events:

emit ActionEvent("AaveV3Borrow", logData);

logger.logActionDirectEvent("AaveV3Borrow", logData);

bytes memory logData = abi.encode(_market, tokenAddr, _amount, _rateMode, _to, _onBehalf);

Last updated