Aave V3

In this section, we will introduce the Aave V3 SDK interfaces, which provide developers with a convenient and efficient way to interact with the Aave V3 protocol. These interfaces cover various aspects of the protocol, including supply, withdraw, borrow, repay, and flash loan. They are designed to be used easily and flexibly.

The following section will introduce the interfaces related to the Aave V3 protocol, which can be accessed through the api.protocols.aavev3. prefix.

Supply

The following code defines interfaces and functions related to the Aave V3 supply logic:

Types

  • SupplyParams: A type that represents the input parameters for the Aave V3 supply logic

interface SupplyParams {
  input: {
    token: {
      chainId: number;
      address: string;
      decimals: number;
      symbol: string;
      name: string;
    };
    amount: string;
  };
  tokenOut: {
    chainId: number;
    address: string;
    decimals: number;
    symbol: string;
    name: string;
  };
}
  • SupplyFields: A type that represents the fields required for the Aave V3 supply logic.

  • SupplyLogic: An interface that extends the Logic interface and represents the Aave V3 supply logic. It includes the rid, and fields properties.

Functions

  • getSupplyTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Aave V3 supply logic on the specified chainId.

  • getSupplyQuotation(chainId: number, params: SupplyParams): An asynchronous function that retrieves a quotation for supplying assets on the Aave V3 protocol with the specified params object on the specified chainId.

  • newSupplyLogic(fields: SupplyFields): A function that creates the Aave V3 supply logic data with the given fields object.

Example Code

Withdraw

The following code defines interfaces and functions related to the Aave V3 withdraw logic:

Types

  • WithdrawParams: A type that represents the input parameters for the Aave V3 withdraw logic

  • WithdrawFields: A type that represents the fields required for the Aave V3 withdraw logic.

  • WithdrawLogic: An interface that extends the Logic interface and represents the Aave V3 withdraw logic. It includes the rid, and fields properties.

Functions

  • getWithdrawTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Aave V3 withdraw logic on the specified chainId.

  • getWithdrawQuotation(chainId: number, params: WithdrawParams): An asynchronous function that retrieves a quotation for withdrawing assets from the Aave V3 protocol with the specified params object on the specified chainId.

  • newWithdrawLogic(fields: WithdrawFields): A function that creates the Aave V3 withdraw logic data with the given fields object.

Example Code

Borrow

The following code defines interfaces and functions related to the Aave V3 borrow logic:

Types

  • BorrowFields: A type that represents the fields required for the Aave V3 borrow logic.

  • BorrowLogic: An interface that extends the Logic interface and represents the Aave V3 borrow logic. It includes the rid, and fields properties.

Functions

  • getBorrowTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Aave V3 borrow logic on the specified chainId.

  • newBorrowLogic(fields: BorrowFields): A function that creates the Aave V3 borrow logic data with the given fields object.

Example Code

Repay

The following code defines interfaces and functions related to the Aave V3 repay logic:

Types

  • RepayParams: A type that represents the input parameters for the Aave V3 repay logic

  • RepayFields: A type that represents the fields required for the Aave V3 repay logic.

  • RepayLogic: An interface that extends the Logic interface and represents the Aave V3 repay logic. It includes the rid, and fields properties.

Functions

  • getRepayTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Aave V3 repay logic on the specified chainId.

  • getRepayQuotation(chainId: number, params: RepayParams): A function that retrieves a quotation for repaying a loan using the specified parameters and Aave V3 protocol on the specified chain.

  • newRepayLogic(fields: RepayFields): A function that creates the Aave V3 repay logic data with the given fields object.

Example Code

FlashLoan

The following code defines functions related to the Aave V3 flash loan logic:

Types

Please refer to the FlashLoan Logic section for more information.

Functions

  • getFlashLoanTokenList(chainId: number): An asynchronous function that retrieves the list of tokens supported by the Aave V3 flash loan logic on the specified chainId.

  • getFlashLoanQuotation(chainId: number, params: FlashLoanParams): An asynchronous function that retrieves a quotation for flash loaning assets on the Aave V3 protocol with the specified params object on the specified chainId.

  • newFlashLoanLogic(fields: FlashLoanFields): A function that creates the Aave V3 flash loan logic data with the given fields object.

  • newFlashLoanLogicPair(loans: FlashLoanFields['loans']): A function that creates the Aave V3 flash loan logic data pair with the given loans object.

Example Code

Last updated