Aave V2

Supported Chains

Available on Ethereum , Avalanche and Polygon.

Available Endpoints:

Click on the endpoint to jump to the section with full details

  • /getpoolGET - Get the lend and borrow APY for the given pool from AAVE protocol.

  • /getpools GET - Get the list of supply and borrow APYs of the mentioned assets.

  • /getuseraccountdata GET - Get the repay, borrow, withdraw amount and health factor details for the given user.

  • /getuserpositions GET - Retrieves the lending and borrowing positions of a user, including details such as token balances and collateral usage status.

  • /borrow POST - Trigger the borrow transaction from the given protocol.

  • /deposit POST - Trigger the deposit transaction from the given protocol.

  • /repayPOST - Trigger the repay transaction from the given protocol.

  • /withdrawPOST - Trigger the withdraw transaction from the given protocol.

Lending Protocol IDs

Many endpoints have a parameter where you can provide a lendborrow ID.

Below is a list of lendborrow IDs related to Aave V2. Please see the lendborrowID for a complete Lending Protocol ID list and more information.

Lending Protocol Name
Chain
Lending Protocol ID

Aave V2

Ethereum

1000

Aave V2

Avalanche

1003

Aave V2

Polygon

1005

Endpoint Details

/getpool

Get the lend and borrow APY for the given pool from AAVE protocol.

GET https://api.expand.network/lendborrow/getpool

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token address to get the details of.

back to top

/getpools

Get the list of supplies and borrow APYs from the AAVE V2 protocol.

GET https://api.expand.network/lendborrow/getpools

Query Parameters

Name
Type
Description

lendborrowId

String

Refer to the lend borrow Id page for details.

assets

String

Comma-separated token address. If not provided, it will fetch all the supported assets

address

String

User wallet address

back to top

/getuseraccountdata

Get the repay, borrow, withdraw amount and health factor details for the given user.

GET https://api.expand.network/lendborrow/getuseraccountdata

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

lendborrowId

String

Refer to the lend borrow Id page for details.

asset*

String

Token address.

address*

String

Public address of sender.

interestRateMode*

String

Interest mode as per Aave. Is set '1' as default.

back to top

/getuserpositions

Retrieves the lending and borrowing positions of a user, including details such as token balances and collateral usage status.

GET https://api.expand.network/lendborrow/getuserpositions

Query Parameters

Name
Type
Description

rpc

String

Remote procedural call URL.

address*

String

Public address of sender.

lendborrowId

String

Refer to the lend borrow Id page for details.

back to top

/borrow

Trigger the borrow transaction from the given protocol.

POST https://api.expand.network/lendborrow/borrow

Request Body

Name
Type
Description

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token address to borrow.

amount*

String

Number of tokens to be borrowed.

interestRateMode*

String

Interest mode as per Aave. 0 for static and 1 for variable.

onBehalfOf*

String

Required in case borrow need to be done on behalf of other public address.

from*

String

Sender public address.

gas

String

Maximum gas to be approved for transaction.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

With gasPriority(medium):

back to top

/deposit

Trigger the deposit transaction from the given protocol.

POST https://api.expand.network/lendborrow/deposit

Request Body

Name
Type
Description

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token address to deposit.

amount*

String

Number of tokens to deposit.

onBehalfOf*

String

Required in case deposit need to be done on behalf of other public address.

from*

String

Sender public address.

gas

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

involveBaseToken

String

0 for any ERC-20 token, 1 for ETH.

gasPriority

String

low, medium, or high.

With gasPriority (low):

back to top

/repay

Trigger the repay transaction from the given protocol.

POST https://api.expand.network/lendborrow/repay

Request Body

Name
Type
Description

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token address to repay.

interestRateMode*

String

Interest mode as per Aave. 0 for static and 1 for variable.

onBehalfOf*

String

Required in case repay need to be done on behalf of other public address.

from*

String

Sender public address.

gas

String

Maximum gas to be approved for the transaction.

amount*

String

Number of tokens to repay.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

With gasPriority (medium):

back to top

/withdraw

Trigger the withdraw transaction from the given protocol.

POST https://api.expand.network/lendborrow/withdraw

Request Body

Name
Type
Description

lendborrowId

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token address to be withdraw.

amount*

String

Number of tokens to withdraw.

to*

String

Recipient public address.

from*

String

Sender public address.

gas

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

gasPriority

String

low, medium, or high.

With gasPriority (low):

back to top

Last updated