/getpool
Get the lend and borrow APY for the given pool from the given protocol.
GET
https://api.expand.network/lendborrow/getpool
Query Parameters
Remote procedural call URL.
Type of the pool in Morpho. Type can be market
or vault
.
By Default, market
The market Id of any market in Morpho
The vaultAddress of any vault in Morpho.
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getpool?type=vault&lendborrowId=1400&vaultAddress=0x73e65DBD630f90604062f6E02fAb9138e713edD9
Copy {
"status": 200,
"msg": "success",
"data": {
"vaultAddress": "0x73e65DBD630f90604062f6E02fAb9138e713edD9",
"tokenAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"vaultName": "Spark DAI Vault",
"vaultSymbol": "spDAI",
"supplyRate": "6.06",
"availableLiquidity": "325518806949113057381630581",
"reserveSize": "289872316816044079545447980"
}
}
/getpools
Get the list of supply and borrow APYs of the mentioned assets.
GET
https://api.expand.network/lendborrow/getpools
Query Parameters
Comma-separated values of market Ids.
Comma-separated values of vault addresses.
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getpools?markets=0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64&lendborrowId=1400&vaults=0x73e65DBD630f90604062f6E02fAb9138e713edD9
Copy {
"status": 200,
"msg": "success",
"data": {
"markets": [
{
"marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"collateralToken": "0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf",
"irm": "0x870aC11D48B15DB9a138Cf899d20F13F79Ba00BC",
"lltv": "86.00",
"loanToken": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
"oracle": "0xA6D6950c9F177F1De7f7757FB33539e3Ec60182a",
"totalSupplyAssets": "91178314521285",
"totalSupplyShares": "88057968168916986611",
"totalBorrowAssets": "71620534801282",
"totalBorrowShares": "68827873391191546341",
"supplyRate": "2.90",
"borrowRate": "3.69"
}
],
"vaults": [
{
"vaultAddress": "0x73e65DBD630f90604062f6E02fAb9138e713edD9",
"tokenAddress": "0x6B175474E89094C44Da98b954EedeAC495271d0F",
"vaultName": "Spark DAI Vault",
"vaultSymbol": "spDAI",
"supplyRate": "6.06",
"availableLiquidity": "325519009252834784304726208",
"reserveSize": "289872316816044079545447980"
}
]
}
}
/getuseraccountdata
Get the repay, borrow, withdraw amount and health factor details for the given user.
GET
https://api.expand.network/lendborrow/getuseraccountdata
Query Parameters
Remote procedural call URL.
The market Id of any market in Morpho
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getuseraccountdata?lendborrowId=1402&address=0x6D41C8D83a68a41A9acE313d171C685874D7898C&marketId=0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5
Copy {
"status": 200,
"msg": "success",
"data": {
"loanToken": "0x4200000000000000000000000000000000000006",
"collateralToken": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"withdrawAmount": "68248",
"borrowAmount": "37028344541760",
"repayAmount": "17226029830095",
"isHealthy": true,
"healthFactor": "3149557613096377183"
}
}
/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
Remote procedural call URL.
Public address of sender.
Type of the pool in Morpho. Type can be market
or vault
.
By Default, market
The market Id of any market in Morpho
The vaultAddress of any vault in Morpho.
Sample Request Sample Response
Copy https://api.expand.network/lendborrow/getuserpositions?lendborrowId=1402&address=0x8Ec0f66424152134DB6673060449eF4139CaC8Ae&vaultAddress=0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A&type=vault
Copy {
"status": 200,
"msg": "success",
"data": {
"underlyingAsset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
"supplyAmount": "294299667",
"supplyShares": "290465033665393431108"
}
}
/borrow
Trigger the borrow transaction from the given protocol.
POST
https://api.expand.network/lendborrow/borrow
Request Body
Number of tokens to be borrowed.
Maximum gas to be approved for the transaction.
Remote procedural call URL.
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
The market Id of any market in Morpho
Sample Request Sample Response
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898"
}
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x50d8cd4b0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "130190",
"estimationCheck": true,
"referenceId": "69ef6fe0f90c48a99a8fa3d09810de5b"
}
}
Sample Request Sample Response
With gasPriority (medium):
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898",
"gasPriority":"medium"
}
With gasPriority:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x50d8cd4b0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "130190",
"gasPrice": "2862245",
"estimationCheck": true,
"referenceId": "e10a5491c0914c4fb1bac32247291533"
}
}
Sample Request Sample Response
With ofacCheck :
Copy {
"lendborrowId": "1400",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000",
"marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"gas": "89898",
"gasPriority":"medium",
"ofacCheck": true
}
With ofacCheck:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x50d8cd4b000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000a6d6950c9f177f1de7f7757fb33539e3ec60182a000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "89898",
"gasPrice": "600594992",
"estimationCheck": true,
"insights": {
"to": {
"issues": [],
"verdict": {
"code": 0,
"label": "NO_ISSUES"
}
}
},
"referenceId": "124c863c84dc4bdbadc97e5bd131cb68"
}
}
/deposit
Trigger the deposit transaction from the given protocol.
POST
https://api.expand.network/lendborrow/deposit
Request Body
Type of the pool in Morpho. Type can be market
or vault
.
By Default, market
Number of tokens to be deposited.
Maximum gas to be approved for the transaction.
Remote procedural call URL.
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
The market Id of any market in Morpho.
Note - When Type
param is market, marketId
is required
The vaultAddress of any vault in Morpho.
Note - When Type
param is vault, vaultAddress
is required
Public address of the user on whose behalf the deposit action will be executed.
Note - When Type
param is market, onBehalfOf
is applicable
if true,
token will be as collateral to borrow loan asset.
By Default, true
Note - When Type
param is market, collateral
is applicable
Sample Request Sample Response
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"onBehalfOf": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"gas": "89898"
}
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x238d65790000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000",
"gas": "89898",
"estimationCheck": true,
"referenceId": "a42f2073ed7b41e78dd33283cd6eac55"
}
}
Sample Request Sample Response
With marketId :
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"onBehalfOf": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"gas": "89898"
}
With gasPriority:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x238d65790000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000",
"gas": "89898",
"estimationCheck": true,
"referenceId": "cb0652e00fb64fbb8207ce318aec8f9a"
}
}
/repay
Trigger the repay transaction from the given protocol.
POST
https://api.expand.network/lendborrow/repay
Request Body
The market Id of any market in Morpho.
Number of tokens to be repaid.
Maximum gas to be approved for the transaction.
Remote procedural call URL.
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
Public address of the user on whose behalf the repay action will be executed.
Sample Request Sample Response
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "1000000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898"
}
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x20b76e810000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000",
"gas": "90925",
"estimationCheck": true,
"referenceId": "95d1630ee5aa4df0b40dc37b126dbb04"
}
}
Sample Request Sample Response
With gasPriority (medium):
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "1000000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898",
"gasPriority":"medium"
}
With gasPriority:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x20b76e810000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000",
"gas": "90925",
"gasPrice": "2851744",
"estimationCheck": true,
"referenceId": "f4ca9f37ecfa465ebaf927558e0dcbb5"
}
}
Sample Request Sample Response
With ofacCheck:
Copy {
"lendborrowId": "1400",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "1000000000",
"marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"gas": "89898",
"gasPriority":"medium",
"ofacCheck": true
}
With ofacCheck:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x20b76e81000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000a6d6950c9f177f1de7f7757fb33539e3ec60182a000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000",
"gas": "89898",
"gasPrice": "478357454",
"estimationCheck": true,
"insights": {
"to": {
"issues": [],
"verdict": {
"code": 0,
"label": "NO_ISSUES"
}
}
},
"referenceId": "1ef5f8982c69466591c9967fe3db2b91"
}
}
/withdraw
Trigger the withdraw transaction from the given protocol.
POST
https://api.expand.network/lendborrow/withdraw
Request Body
Type of the pool in Morpho. Type can be market
or vault
.
By Default, market
Number of tokens to withdraw.
Maximum gas to be approved for the transaction.
Remote procedural call URL.
if true,
provides insights of the contract and tokens involved in the transaction.
By Default, false
Available on Ethereum, Polygon, BSC, Avalanche, Arbitrum and Optimism Mainnet
Public address of the user on whose behalf the deposit action will be executed.
Note - When Type
param is market, onBehalfOf
is applicable
if true,
token will be as collateral to borrow loan asset.
By Default, true
Note - When Type
param is market, collateral
is applicable
The vaultAddress of any vault in Morpho.
Note - When Type
param is vault, vaultAddress
is required
Sample Request Sample Response
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "10000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898"
}
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x8720316d0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "138441",
"estimationCheck": true,
"referenceId": "8eec8150896e4fdaa26d4d1a1338d676"
}
}
Sample Request Sample Response
With vaultAddress :
Copy {
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "10000",
"vaultAddress": "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
"gas": "89898",
"type":"vault"
}
With gasPriority:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
"value": "0",
"data": "0xb460af9400000000000000000000000000000000000000000000000000000000000027100000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "89898",
"estimationCheck": true,
"referenceId": "8f3cd53512dd49548cd5d5528e087b24"
}
}
Sample Request Sample Response
With ofacCheck:
Copy {
"lendborrowId": "1400",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "10000",
"marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
"gas": "89898",
"ofacCheck": true
}
With ofacCheck:
Copy {
"status": 200,
"msg": "success",
"data": {
"chainId": "1",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x8720316d000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48000000000000000000000000cbb7c0000ab88b473b1f5afd9ef808440eed33bf000000000000000000000000a6d6950c9f177f1de7f7757fb33539e3ec60182a000000000000000000000000870ac11d48b15db9a138cf899d20f13f79ba00bc0000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "89898",
"estimationCheck": "Returned error: execution reverted: arithmetic underflow or overflow",
"insights": {
"to": {
"issues": [],
"verdict": {
"code": 0,
"label": "NO_ISSUES"
}
}
},
"referenceId": "6d02683c5c63485d84d6877778d2fcbf"
}
}