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
/ 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.
/ migrate POST
- Trigger the migrate 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 V3. 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=1200&asset=0x6b175474e89094c44da98b954eedeac495271d0f
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"tokenAddress" : "0x6b175474e89094c44da98b954eedeac495271d0f" ,
"poolAddress" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"variableBorrowRate" : "17.17" ,
"stableBorrowRate" : "18.67" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "11.96" ,
"ltv" : "63" ,
"availableLiquidity" : "8950905768339714587617037" ,
"reserveSize" : "125705701896860739215535363"
}
}
/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=1200&assets=0x6b175474e89094c44da98b954eedeac495271d0f,0xdac17f958d2ee523a2206206994597c13d831ec7
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"DAI" : {
"tokenAddress" : "0x6b175474e89094c44da98b954eedeac495271d0f" ,
"poolAddress" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"variableBorrowRate" : "17.17" ,
"stableBorrowRate" : "18.67" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "11.96" ,
"ltv" : "63" ,
"availableLiquidity" : "8950901953526498539017315" ,
"reserveSize" : "125705713336460316284795466" ,
"tokenSymbol" : "DAI"
} ,
"USDT" : {
"tokenAddress" : "0xdac17f958d2ee523a2206206994597c13d831ec7" ,
"poolAddress" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"variableBorrowRate" : "8.51" ,
"stableBorrowRate" : "13.78" ,
"variableSupplyRate" : "0" ,
"stableSupplyRate" : "6.66" ,
"ltv" : "75" ,
"availableLiquidity" : "163271122884760" ,
"reserveSize" : "1253789585075279" ,
"tokenSymbol" : "USDT"
}
}
}
/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?interestRateMode=1&address=0x6fCe63859a859a0f30eD09B12F5010d790618ca4&asset=0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48&lendborrowId=1200
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"tokenAddress" : "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48" ,
"repayAmount" : "0" ,
"borrowAmount" : "15336571492" ,
"borrowErrorMessage" : "The Stable Rate is not enabled for this currency" ,
"withdrawAmount" : "0" ,
"healthFactor" : "1965438342704054090"
}
}
/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=0x6fCe63859a859a0f30eD09B12F5010d790618ca4&lendborrowId=1200
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : [
{
"aToken" : "0x4d5F47FA6A74757f35C14fD3a6Ef8E3C9BC514E8" ,
"underlyingAsset" : "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" ,
"scaledATokenBalance" : "29369928160004078694" ,
"usageAsCollateralEnabledOnUser" : true
}
]
}
/borrow
Trigger the borrow transaction from the given protocol.
POST
https://api.expand.network/lendborrow/borrow
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x65afadd39029741b3b8f0756952c74678c9cec93" ,
"amount" : "100" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"onBehalfOf" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"interestRateMode" : "2" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xa415bcad00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000000000000000006400000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45"
}
}
Sample Request Sample Response
With gasPriority (low):
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "1000000000" ,
"from" : "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E" ,
"onBehalfOf" : "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E" ,
"interestRateMode" : "2" ,
"gas" : "408298" ,
"gasPriority" : "low"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xa415bcad0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000003b9aca00000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000004c99d660a51d41be5d47d66a3d89d5b83d92f27e",
"gasPrice" : "14089187713"
}
}
/deposit
Trigger the deposit transaction from the given protocol.
POST
https://api.expand.network/lendborrow/deposit
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x65afadd39029741b3b8f0756952c74678c9cec93" ,
"amount" : "10000000000000000" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"onBehalfOf" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xe8eda9df00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a450000000000000000000000000000000000000000000000000000000000000000",
"referenceId" : "7fb853868e4749879ef57d96aae5b9a2"
}
}
Sample Request Sample Response
With gasPriority (medium):
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "10000000000" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"onBehalfOf" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"gas" : "408298" ,
"gasPriority" : "low"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0xe8eda9df0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f00000000000000000000000000000000000000000000000000000002540be400000000000000000000000000fae7d9854995e28beb1b1da864ee2a1e2ec17f070000000000000000000000000000000000000000000000000000000000000000",
"gasPrice" : "2800283955" ,
"referenceId" : "6bc93df7b66e4c1c9d069f6c88459a77"
}
}
/repay
Trigger the repay transaction from the given protocol.
POST
https://api.expand.network/lendborrow/repay
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"asset" : "0xdAC17F958D2ee523a2206206994597C13D831ec7" ,
"amount" : "100000" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"onBehalfOf" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"interestRateMode" : "1" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x63056E00436Da25BcF48A40dfBbDcc7089351006" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x573ade81000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
"referenceId" : "206365ea298a46c790b0ae51add101c3"
}
}
Sample Request Sample Response
With gasPriority (low):
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x6B175474E89094C44Da98b954EedeAC495271d0F" ,
"amount" : "1000000000" ,
"from" : "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E" ,
"onBehalfOf" : "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E" ,
"interestRateMode" : "2" ,
"gas" : "408298" ,
"gasPriority" : "low"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x4C99D660A51D41bE5D47D66a3d89d5B83D92f27E" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x573ade810000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000020000000000000000000000004c99d660a51d41be5d47d66a3d89d5b83d92f27e",
"gasPrice" : "2658967750" ,
"referenceId" : "f6c53d54c20241e3a49458a90a4e7c6d"
}
}
/withdraw
Trigger the withdraw transaction from the given protocol.
POST
https://api.expand.network/lendborrow/withdraw
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x65afadd39029741b3b8f0756952c74678c9cec93" ,
"amount" : "10000000000000000" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x69328dec00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45",
"referenceId" : "934bca3df66d411ab6ed56ab879badd9"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x65afadd39029741b3b8f0756952c74678c9cec93" ,
"amount" : "10000000000000000" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"gas" : "408298" ,
"gasPriority" : "high"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data": "0x69328dec00000000000000000000000065afadd39029741b3b8f0756952c74678c9cec93000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45",
"gasPrice" : "3851175507" ,
"referenceId" : "1875f3d54ba14016b0231d763b5a949e"
}
}
/migrate
Trigger the migrate transaction from the given protocol.
POST
https://api.expand.network/lendborrow/migrate
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"assets" : [
"0x6b175474e89094c44da98b954eedeac495271d0f"
] ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"gas" : "329000"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"to" : "0xb748952c7bc638f31775245964707bcc5ddfabfc" ,
"value" : "0" ,
"gas" : "329000" ,
"data": "0x3698d492000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"referenceId" : "76137704aa884a90b6a47082bc65e735"
}
}
Sample Request Sample Response
With gasPriority:
Copy {
"lendborrowId" : "1200" ,
"assets" : [
"0x6b175474e89094c44da98b954eedeac495271d0f"
] ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"gas" : "329000" ,
"gasPriority" : "medium"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x356dB816602c85e2075774bB77D13995c8Bab023" ,
"to" : "0xb748952c7bc638f31775245964707bcc5ddfabfc" ,
"value" : "0" ,
"gas" : "329000" ,
"data": "0x3698d492000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"gasPrice" : {
"gasPrice" : "3297136333"
} ,
"referenceId" : "fce1e543076e4bc9b23c74afaa114d3f"
}
}
/setuseremode
Trigger the E-Mode options for the user.
POST
https://api.expand.network/lendborrow/setuseremode
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"categoryId" : "1" ,
"gas" : "408298"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data" : "0x28530a470000000000000000000000000000000000000000000000000000000000000001" ,
"referenceId" : "85e2f3fd6c904f2bb55305c1d9075ee3"
}
}
Sample Request Sample Response
With gasPriority (low):
Copy {
"lendborrowId" : "1200" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"categoryId" : "1" ,
"gas" : "408298" ,
"gasPriority" : "low"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "408298" ,
"data" : "0x28530a470000000000000000000000000000000000000000000000000000000000000001" ,
"gasPrice" : "2914558556" ,
"referenceId" : "cf07b3d78fc348e49da9e8511f9f5794"
}
}
/exitisolationmode
Trigger the exit of isolation mode options for the user.
POST
https://api.expand.network/lendborrow/exitisolationmode
Request Body
Sample Request Sample Response
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2" ,
"from" : "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41" ,
"gas" : "429000"
}
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "429000" ,
"data": "0x5a3b74b90000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a20000000000000000000000000000000000000000000000000000000000000000",
"referenceId" : "8581446eb9aa421dabf15ce8b55cb25d"
}
Sample Request Sample Response
With gasPriority:
Copy {
"lendborrowId" : "1200" ,
"asset" : "0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2" ,
"from" : "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41" ,
"gas" : "429000" ,
"gasPriority" : "high"
}
With gasPriority:
Copy {
"status" : 200 ,
"msg" : "success" ,
"data" : {
"chainId" : "1" ,
"from" : "0xf7426829DBAAc7F26b48C49A04a93fc4f75cfa41" ,
"to" : "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2" ,
"value" : "0" ,
"gas" : "429000" ,
"data": "0x5a3b74b90000000000000000000000009f8f72aa9304c8b593d555f12ef6589cc3a579a20000000000000000000000000000000000000000000000000000000000000000",
"referenceId" : "8581446eb9aa421dabf15ce8b55cb25d"
}