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 NameChainLending 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

NameTypeDescription

rpc

String

Remote procedural call URL.

lendborrowId

String

asset*

String

Token address to get the details of.

https://api.expand.network/lendborrow/getpool?lendborrowId=1000&asset=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2

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

NameTypeDescription

lendborrowId

String

assets

String

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

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

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

NameTypeDescription

rpc

String

Remote procedural call URL.

lendborrowId

String

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?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&asset=0x514910771af9ca656af840dff83e8264ecf986ca&lendborrowId=1000&interestRateMode=1

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 TypeDescription

rpc

String

Remote procedural call URL.

address*

String

Public address of sender.

lendborrowId

String

https://api.expand.network/lendborrow/getuserpositions?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1000

back to top

/borrow

Trigger the borrow transaction from the given protocol.

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

Request Body

NameTypeDescription

lendborrowId

String

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": "1000",
    "asset": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F",
    "amount": "100",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "onBehalfOf": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "interestRateMode": "2",
    "gas": "408298"
}

With gasPriority(medium):

{
    "lendborrowId": "1000",
    "asset": "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F",
    "amount": "100",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "onBehalfOf": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "interestRateMode": "2",
    "gas": "408298",
    "gasPriority": "medium"
}

back to top

/deposit

Trigger the deposit transaction from the given protocol.

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

Request Body

NameTypeDescription

lendborrowId

String

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": "1000",
    "asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
    "amount": "10000000000000000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "onBehalfOf": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "408298"
}

With gasPriority (low):

{
    "lendborrowId": "1000",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "10000000000000",
    "from": "0x356db816602c85e2075774bb77d13995c8bab023",
    "onBehalfOf": "0x356db816602c85e2075774bb77d13995c8bab023",
    "gas": "520000",
    "gasPriority": "low"
}

back to top

/repay

Trigger the repay transaction from the given protocol.

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

Request Body

NameTypeDescription

lendborrowId

String

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.

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

With gasPriority (medium):

{
    "lendborrowId": "1000",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "10000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "onBehalfOf": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "interestRateMode": "2",
    "gas": "408298",
    "gasPriority":"medium"
}

back to top

/withdraw

Trigger the withdraw transaction from the given protocol.

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

Request Body

NameTypeDescription

lendborrowId

String

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": "1000",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "1000000000000000000",
    "from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "to": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
    "gas": "408298"
}

With gasPriority (low):

{
    "lendborrowId": "1000",
    "asset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
    "amount": "100000000000",
    "from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "to": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
    "gas": "408298",
    "gasPriority":"low"
}

back to top

Last updated