Compound V2
/getpool
Get the lend and borrow APY for the given pool from the given protocol.
GET
https://api.expand.network/lendborrow/getpool
Query Parameters
https://api.expand.network/lendborrow/getpool?lendborrowId=1100&asset=usdc
{
"status": 200,
"msg": "success",
"data": {
"tokenAddress": "0x39aa39c021dfbae8fac545936693ac917d5e7563",
"poolAddress": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"variableBorrowRate": "0",
"stableBorrowRate": "15.317159470377728",
"variableSupplyRate": "0",
"stableSupplyRate": "5.076408388218856",
"ltv": "85.5",
"availableLiquidity": "27577473960885",
"reserveSize": "18717058035630"
}
}
/getpools
Get the list of supply and borrow APYs of the mentioned assets.
GET
https://api.expand.network/lendborrow/getpools
Query Parameters
https://api.expand.network/lendborrow/getpools?lendborrowId=1100&assets=USDT,usDC,rep
{
"status": 200,
"msg": "success",
"data": {
"USDC": {
"tokenAddress": "0x39aa39c021dfbae8fac545936693ac917d5e7563",
"poolAddress": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"variableBorrowRate": "0",
"stableBorrowRate": "15.317159470377728",
"variableSupplyRate": "0",
"stableSupplyRate": "5.076408388218856",
"ltv": "85.5",
"availableLiquidity": "27577473960885",
"reserveSize": "18717058035630"
},
"REP": {
"tokenAddress": "0x158079ee67fce2f58472a96584a73c7ab9ac95c1",
"poolAddress": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"variableBorrowRate": "0",
"stableBorrowRate": "4.560470927786797",
"variableSupplyRate": "0",
"stableSupplyRate": "0",
"ltv": "0",
"availableLiquidity": "1014353018766752581455",
"reserveSize": "3549421684597720326"
},
"USDT": {
"tokenAddress": "0xf650c3d88d12db855b8bf7d11be6c55a4e07dcc9",
"poolAddress": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"variableBorrowRate": "0",
"stableBorrowRate": "13.938973764802665",
"variableSupplyRate": "0",
"stableSupplyRate": "10.934276001927245",
"ltv": "0",
"availableLiquidity": "31414050451046",
"reserveSize": "4507835539299"
}
}
}
/getuseraccountdata
Get the repay, borrow, withdraw amount and health factor details for the given user.
GET
https://api.expand.network/lendborrow/getuseraccountdata
Query Parameters
https://api.expand.network/lendborrow/getuseraccountdata?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1100&asset=DAI
{
"status": 200,
"msg": "success",
"data": {
"tokenAddress": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"repayAmount": "0",
"borrowAmount": "3977431061236148758",
"withdrawAmount": "1052289347511965358",
"healthFactor": "0"
}
}
/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
https://api.expand.network/lendborrow/getuserpositions?address=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1100
{
"status": 200,
"msg": "success",
"data": [
{
"cToken": "0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643",
"underlyingAsset": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"scaledCTokenBalance": "4504491746",
"usageAsCollateralEnabledOnUser": true
},
{
"cToken": "0x4Ddc2D193948926D02f9B1fE9e1daa0718270ED5",
"underlyingAsset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
"scaledCTokenBalance": "4980469",
"usageAsCollateralEnabledOnUser": true
},
{
"cToken": "0xf650C3d88D12dB855b8bf7D11Be6C55A4e07dCC9",
"underlyingAsset": "0xdAC17F958D2ee523a2206206994597C13D831ec7",
"scaledCTokenBalance": "0",
"usageAsCollateralEnabledOnUser": true
},
{
"cToken": "0xFAce851a4921ce59e912d19329929CE6da6EB0c7",
"underlyingAsset": "0x514910771AF9Ca656af840dff83E8264EcF986CA",
"scaledCTokenBalance": "59526195",
"usageAsCollateralEnabledOnUser": true
}
]
}
/entermarketstatus
Checks whether the user approved before depositing.
GET
https://api.expand.network/lendborrow/entermarketstatus
Query Parameters
https://api.expand.network/lendborrow/entermarketstatus?account=0x6Fb447Ae94F5180254D436A693907a1f57696900&lendborrowId=1100
{
"status": 200,
"msg": "success",
"data": {
"enterMarketStatus": [
"0x20572e4c090f15667cF7378e16FaD2eA0e2f3EfF",
"0x822397d9a55d0fefd20F5c4bCaB33C5F65bd28Eb",
"0xCEC4a43eBB02f9B80916F1c718338169d6d5C1F0"
]
}
}
/entermarket
Compound needs the user to approve before they can start deposit.
POST
https://api.expand.network/lendborrow/entermarket
Query Parameters
{
"lendborrowId": "1100",
"asset": "DAI",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gas": "298800"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"value": "0",
"gas": "298800",
"data": "0xc2998238000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005d3a536e4d6dbd6114cc1ead35777bab948e3643",
"referenceId": "b2975c19e2594dcabbf193d25b4b6100"
}
}
With gasPriority:
{
"lendborrowId": "1100",
"asset": "DAI",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gas": "298800",
"gasPriority": "medium"
}
With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"value": "0",
"gas": "298800",
"data": "0xc2998238000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000010000000000000000000000005d3a536e4d6dbd6114cc1ead35777bab948e3643",
"gasPrice": "4124373646",
"referenceId": "d3596cbd688b452fba6aa0185a948869"
}
}
/borrow
Trigger the withdraw transaction from the given protocol.
POST
https://api.expand.network/lendborrow/borrow
Request Body
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "100000",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gas": "442020"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "442020",
"data": "0xc5ebeaec00000000000000000000000000000000000000000000000000000000000186a0",
"referenceId": "bf5abab50f85428b86d08cc1e06bf193"
}
}
With gasPriority (medium):
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "100000000000000",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"gas": "192020",
"gasPriority":"medium"
}
With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "192020",
"data": "0xc5ebeaec00000000000000000000000000000000000000000000000000005af3107a4000",
"gasPrice": "4050857834",
"referenceId": "6123347ffa3648a2b81110ab098d0ced"
}
}
/deposit
Trigger the deposit transaction from the given protocol.
POST
https://api.expand.network/lendborrow/deposit
Request Body
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "1000000000000000000",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gas": "192020"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "192020",
"data": "0xa0712d680000000000000000000000000000000000000000000000000de0b6b3a7640000",
"referenceId": "337e28b9a35e45138e41d38b49d4f957"
}
}
With gasPriority (medium):
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "100000000000000",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"gas": "192020",
"gasPriority":"medium"
}
With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "192020",
"data": "0xa0712d6800000000000000000000000000000000000000000000000000005af3107a4000",
"gasPrice": "4152465976",
"referenceId": "e97309d3381e4ac79dd9addc9b58ae50"
}
}
/repay
Trigger the repay transaction from the given protocol.
POST
https://api.expand.network/lendborrow/repay
Request Body
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "100000",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gas": "152020"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "152020",
"data": "0x0e75270200000000000000000000000000000000000000000000000000000000000186a0",
"referenceId": "853ac7eba20b4002a739568ac0a362e0"
}
}
With gasPriority (medium):
{
"lendborrowId": "1100",
"asset": "USDC",
"amount": "100000000000000",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"gas": "192020",
"gasPriority":"medium"
}
With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0x39aa39c021dfbae8fac545936693ac917d5e7563",
"value": "0",
"gas": "192020",
"data": "0x0e75270200000000000000000000000000000000000000000000000000005af3107a4000",
"gasPrice": "3952066622",
"referenceId": "57030a6f5aa84526a1081543fe566e0c"
}
}
/withdraw
Trigger the withdraw transaction from the given protocol.
POST
https://api.expand.network/lendborrow/withdraw
Request Body
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "1000000000000000000",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"gas": "312020"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "312020",
"data": "0x852a12e30000000000000000000000000000000000000000000000000de0b6b3a7640000",
"referenceId": "b6e17376297348ebbe4e82fd5429b267"
}
}
With gasPriority (medium):
{
"lendborrowId": "1100",
"asset": "DAI",
"amount": "100000000000",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"gas": "192020",
"gasPriority":"medium"
}
With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0x5d3a536e4d6dbd6114cc1ead35777bab948e3643",
"value": "0",
"gas": "192020",
"data": "0x852a12e3000000000000000000000000000000000000000000000000000000174876e800",
"gasPrice": "4091632147",
"referenceId": "512d96edebab41b692a408d508c96ffc"
}
}
/exitmarket
Trigger the exit market transaction for the given protocol
POST
https://api.expand.network/lendborrow/exitmarket
Request Body
{
"lendborrowId": "1100",
"asset": "dai",
"from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
"gas": "40000"
}
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x6Fb447Ae94F5180254D436A693907a1f57696900",
"to": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"value": "0",
"gas": "40000",
"data": "0xede4edd00000000000000000000000005d3a536e4d6dbd6114cc1ead35777bab948e3643",
"referenceId": "2a7d6bd372b14b20b4d854daa01487b3"
}
}
With gasPriority (medium):
{
"lendborrowId": "1100",
"asset": "DAI",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"gas": "40000",
"gasPriority":"medium"
}
With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0xfAE7D9854995E28BEB1B1da864ee2A1E2EC17f07",
"to": "0x3d9819210a31b4961b30ef54be2aed79b9c9cd3b",
"value": "0",
"gas": "40000",
"data": "0xede4edd00000000000000000000000005d3a536e4d6dbd6114cc1ead35777bab948e3643",
"gasPrice": "4248417967",
"referenceId": "8d28cea2f5c84704831bfbcbeba4cedb"
}
}
Following is the list of supported tokens :
Last updated