Supported Chains
Available on Ethereum , Avalanche and Polygon.
Available Endpoints:
Click on the endpoint to jump to the section with full details
/ getpool GET
- 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.
/ d eposit POST
- Trigger the deposit transaction from the given protocol.
/r epay POST
- Trigger the repay transaction from the given protocol.
/ withdraw POST
- 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.
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
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getpool?lendborrowId=1000&asset=0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"poolAddress" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"variableBorrowRate" : "2.46" ,
"stableBorrowRate" : "4.54" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "0.38" ,
"ltv" : "82.5" ,
"availableLiquidity" : "113254567932739787526717" ,
"reserveSize" : "163635814986025319212051"
}
}
back to top
/getpools
Get the list of supply and borrow APYs of the mentioned assets.
GET
https://api.expand.network/lendborrow/getpools
Query Parameters
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getpools?lendborrowId=1000&assets=0x6b175474e89094c44da98b954eedeac495271d0f,0xdac17f958d2ee523a2206206994597c13d831ec7,0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2,0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"USDT" : {
"tokenAddress" : "0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"poolAddress" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"variableBorrowRate" : "8.86" ,
"stableBorrowRate" : "11.97" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "3.49" ,
"ltv" : "0" ,
"availableLiquidity" : "36229656747924" ,
"reserveSize" : "170232207636879" ,
"tokenSymbol" : "USDT"
} ,
"WETH" : {
"tokenAddress" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"poolAddress" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"variableBorrowRate" : "2.46" ,
"stableBorrowRate" : "4.54" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "0.38" ,
"ltv" : "82.5" ,
"availableLiquidity" : "113254567932739787526717" ,
"reserveSize" : "163635816874333127938154" ,
"tokenSymbol" : "WETH"
} ,
"DAI" : {
"tokenAddress" : "0x6b175474e89094c44da98b954eedeac495271d0f" ,
"poolAddress" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"variableBorrowRate" : "19.70" ,
"stableBorrowRate" : "22.70" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "8.16" ,
"ltv" : "63" ,
"availableLiquidity" : "11908974093988509993079312" ,
"reserveSize" : "69456285774462651380581683" ,
"tokenSymbol" : "DAI"
} ,
"USDC" : {
"tokenAddress" : "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48" ,
"poolAddress" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"variableBorrowRate" : "10.69" ,
"stableBorrowRate" : "12.69" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "4.82" ,
"ltv" : "80" ,
"availableLiquidity" : "21761314942801" ,
"reserveSize" : "223904283007709" ,
"tokenSymbol" : "USDC"
}
}
}
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
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getuseraccountdata?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&asset=0x514910771af9ca656af840dff83e8264ecf986ca&lendborrowId=1000&interestRateMode=1
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"tokenAddress" : "0x514910771af9ca656af840dff83e8264ecf986ca" ,
"repayAmount" : "0" ,
"borrowAmount" : "473877059646280" ,
"borrowErrorMessage" : "The Stable Rate is not enabled for this currency" ,
"withdrawAmount" : "0" ,
"healthFactor" : "1086711741859975271"
}
}
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
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getuserpositions?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1000
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : [
{
"aToken" : "0x030bA81f1c18d280636F32af80b9AAd02Cf0854e" ,
"underlyingAsset" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"scaledATokenBalance" : "5294314974264415" ,
"usageAsCollateralEnabledOnUser" : true
} ,
{
"aToken" : "0x028171bCA77440897B824Ca71D1c56caC55b68A3" ,
"underlyingAsset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"scaledATokenBalance" : "7412180471335674791" ,
"usageAsCollateralEnabledOnUser" : true
}
]
}
back to top
/borrow
Trigger the borrow transaction from the given protocol.
POST
https://api.expand.network/lendborrow/borrow
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1000" ,
"asset" : "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F" ,
"amount" : "100" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"onBehalfOf" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"interestRateMode" : "2" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xa415bcad000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f00000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
"referenceId" : "73d8435c30b6432aa661e8c90215e863"
}
}
Sample Request Sample Response
With gasPriority(medium):
Copy {
"lendborrowId" : "1000" ,
"asset" : "0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F" ,
"amount" : "100" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"onBehalfOf" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"interestRateMode" : "2" ,
"gas" : "408298" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xa415bcad000000000000000000000000c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f00000000000000000000000000000000000000000000000000000000000000640000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
"gasPrice" : "4115928188" ,
"referenceId" : "a9c5748d49b44d0581111f7ea11c8a61"
}
}
back to top
/deposit
Trigger the deposit transaction from the given protocol.
POST
https://api.expand.network/lendborrow/deposit
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1000" ,
"asset" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"amount" : "10000000000000000" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"onBehalfOf" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xe8eda9df000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2000000000000000000000000000000000000000000000000002386f26fc1000000000000000000000000000063056e00436da25bcf48a40dfbbdcc70893510060000000000000000000000000000000000000000000000000000000000000000",
"referenceId" : "e7354f7c396f451f98359be5db31bd4a"
}
}
Sample Request Sample Response
With gasPriority (low):
Copy {
"lendborrowId" : "1000" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "10000000000000" ,
"from" : "0x356db816602c85e2075774bb77d13995c8bab023" ,
"onBehalfOf" : "0x356db816602c85e2075774bb77d13995c8bab023" ,
"gas" : "520000" ,
"gasPriority" : "low"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x356db816602c85e2075774bb77d13995c8bab023" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "520000" ,
"data": "0xe8eda9df0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000009184e72a000000000000000000000000000356db816602c85e2075774bb77d13995c8bab0230000000000000000000000000000000000000000000000000000000000000000",
"gasPrice" : "3459319856" ,
"referenceId" : "240aa659656d499699de5fa6ff05fefa"
}
}
back to top
/repay
Trigger the repay transaction from the given protocol.
POST
https://api.expand.network/lendborrow/repay
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1000" ,
"asset" : "0xdAC17F958D2ee523a2206206994597C13D831ec7" ,
"amount" : "100000" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"onBehalfOf" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"interestRateMode" : "2" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x573ade81000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000000000200000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
"referenceId" : "40901b075cf4426bb13daa25adb69d72"
}
}
Sample Request Sample Response
With gasPriority (medium):
Copy {
"lendborrowId" : "1000" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "10000000000" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"onBehalfOf" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"interestRateMode" : "2" ,
"gas" : "408298" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x573ade810000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000002540be4000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000fae7d9854995e28beb1b1da864ee2a1e2ec17f07",
"gasPrice" : "3904209506" ,
"referenceId" : "d37a6d9d3a084066a980aaafd2ca5e61"
}
}
back to top
/withdraw
Trigger the withdraw transaction from the given protocol.
POST
https://api.expand.network/lendborrow/withdraw
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1000" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "1000000000000000000" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x69328dec0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f0000000000000000000000000000000000000000000000000de0b6b3a764000000000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
"referenceId" : "3fd62ffec3264f33962ef2978b6e0892"
}
}
Sample Request Sample Response
With gasPriority (low):
Copy {
"lendborrowId" : "1000" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "100000000000" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"to" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"gas" : "408298" ,
"gasPriority" : "low"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"to" : "0x7d2768dE32b0b80b7a3454c06BdAc94A69DDc7A9" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x69328dec0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000174876e800000000000000000000000000fae7d9854995e28beb1b1da864ee2a1e2ec17f07",
"gasPrice" : "3312899520" ,
"referenceId" : "d7fd42b08f9344b79511bf4fc13970f9"
}
}
back to top