Aave V3

Supported Chains

Available on Ethereum Mainnet and Testnet, Arbitrum, Avalanche, Base, 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.

  • /migratePOST - Trigger the migrate transaction from the given protocol.

  • /setuseremodePOST - Trigger the E-Mode options for the user.

  • /exitisolationmodePOST - Trigger the exit of isolation mode options for the user.

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 V3. Please see the lendborrowID for a complete Lending Protocol ID list and more information.

Lending Protocol Name
Chain
Lending Protocol ID

Aave V3

Ethereum

1200

Aave V3

Ethereum Testnet Sepolia

1202

Aave V3

Avalanche

1203

Aave V3

Arbitrum

1204

Aave V3

Polygon

1205

Aave V3

Base

1206

Aave V3

Optimism

1207

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.

https://api.expand.network/lendborrow/getpool?lendborrowId=1200&asset=0x6b175474e89094c44da98b954eedeac495271d0f

/getpools

Returns a list of supply and borrow APYs for assets supported by the Aave V3 protocol.

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

Query Parameters

Name
Type
Description

lendborrowId*

String

Identify the protocol by providing a Lending Protocol ID. For example, Aave V3 on Ethereum is 1200.

assets

String

Provide a comma-separated list of token addresses to filter specific assets. If left blank, data for all assets supported by the protocol will be returned.

user

String

The public address of the sender.

rpc

String

Remote procedural call URL.

https://api.expand.network/lendborrow/getpools?lendborrowId=1200

/getuseraccountdata

Get the repay, borrow, withdraw amount and health factor details for a 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.

https://api.expand.network/lendborrow/getuseraccountdata?interestRateMode=1&address=0x6fCe63859a859a0f30eD09B12F5010d790618ca4&asset=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&lendborrowId=1200

/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
Descriptions

rpc

String

Remote procedural call URL.

address*

String

Public address of sender.

lendBorrowId*

String

Refer to the lend borrow Id page for details.

https://api.expand.network/lendborrow/getuserpositions?address=0x6fCe63859a859a0f30eD09B12F5010d790618ca4&lendborrowId=1200

/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.

referralCode

String

Referral code needed by Aave.

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.

{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "100",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "onBehalfOf": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "interestRateMode": "2",
    "gas": "408298"
}

With gasPriority (low):

{
    "lendborrowId": "1200",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "1000000000",
    "from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "onBehalfOf": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "interestRateMode": "2",
    "gas": "408298",
    "gasPriority":"low"
}

/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.

referralCode*

String

Referral code needed by Aave.

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.

{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "10000000000000000",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "onBehalfOf": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "gas": "408298"
}

With gasPriority (medium):

{
    "lendborrowId": "1200",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "10000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "onBehalfOf": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "408298",
    "gasPriority":"low"
}

/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.

rpc

String

Remote procedural call URL.

amount*

String

Amount to repay.

gasPriority

String

low, medium, or high.

{
    "lendborrowId": "1200",
    "asset": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
    "amount": "100000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "onBehalfOf": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "interestRateMode": "1",
    "gas": "408298"
}

With gasPriority (low):

{
    "lendborrowId": "1200",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "1000000000",
    "from": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "onBehalfOf": "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E",
    "interestRateMode": "2",
    "gas": "408298",
    "gasPriority":"low"
}

/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.

{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "10000000000000000",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "to": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "gas": "408298"
}

With gasPriority:

{
    "lendborrowId": "1200",
    "asset": "0x65afadd39029741b3b8f0756952c74678c9cec93",
    "amount": "10000000000000000",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "to": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "gas": "408298",
    "gasPriority": "high"
}

/migrate

Trigger the migrate transaction from the given protocol.

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

Request Body

Name
Type
Description

lendborrowId*

String

Refer to the Lend and Borrow ID page for details.

assets

String

Token addresses to migrate.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

{
    "lendborrowId": "1200",
    "assets": [
        "0x6b175474e89094c44da98b954eedeac495271d0f"
    ],
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "gas": "329000"
}

With gasPriority:

{
    "lendborrowId": "1200",
    "assets": [
        "0x6b175474e89094c44da98b954eedeac495271d0f"
    ],
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "gas": "329000",
    "gasPriority": "medium"
}

/setuseremode

Trigger the E-Mode options for the user.

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

Request Body

Name
Type
Description

lendborrowId*

String

Refer to the Lend and Borrow ID page for details.

categoryId*

String

0 for default. 1 for stablecoins.

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.

{
    "lendborrowId": "1200",
    "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
    "categoryId": "1",
    "gas": "408298"
}

With gasPriority (low):

{
    "lendborrowId": "1200",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "categoryId": "1",
    "gas": "408298",
    "gasPriority":"low"
}

/exitisolationmode

Trigger the exit of isolation mode options for the user.

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

Request Body

Name
Type
Description

lendborrowId*

String

Refer to the Lend and Borrow ID page for details.

asset*

String

Token address to exit isolation mode.

from*

String

Sender public address.

gas*

String

Maximum gas to be approved for the transaction.

rpc

String

Remote procedural call URL.

{
    "lendborrowId": "1200",
    "asset": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
    "from": "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41",
    "gas": "429000"
}

With gasPriority:

{
    "lendborrowId": "1200",
    "asset": "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
    "from": "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41",
    "gas": "429000",
    "gasPriority": "high"
}

Last updated