Morpho
/getpool
Get the lend and borrow APY for the given pool from the given protocol.
GET https://api.expand.network/lendborrow/getpool
Query Parameters
rpc
String
Remote procedural call URL.
lendBorrowId*
String
Refer to the Lend and Borrow ID page for details.
type*
String
Type of the pool in Morpho. Type can be market or vault.
By Default, market
marketId
String
The market Id of any market in Morpho
vaultAddress
String
The vaultAddress of any vault in Morpho.
https://api.expand.network/lendborrow/getpool?type=vault&lendborrowId=1400&vaultAddress=0x73e65DBD630f90604062f6E02fAb9138e713edD9{
"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. If only the lendBorrowId is provided, the API will return information for all markets and vaults.
GET https://api.expand.network/lendborrow/getpools
Query Parameters
lendBorrowId*
String
Refer to the lend borrow Id page for details.
markets
String
Comma-separated values of market Ids.
vaults
String
Comma-separated values of vault addresses.
https://api.expand.network/lendborrow/getpools?markets=0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64&lendborrowId=1400&vaults=0x73e65DBD630f90604062f6E02fAb9138e713edD9{
"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
rpc
String
Remote procedural call URL.
lendBorrowId*
String
Refer to the lend borrow Id page for details.
address*
String
User account address
marketId*
String
The market Id of any market in Morpho
https://api.expand.network/lendborrow/getuseraccountdata?lendborrowId=1402&address=0x6D41C8D83a68a41A9acE313d171C685874D7898C&marketId=0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5{
"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
rpc
String
Remote procedural call URL.
address*
String
Public address of sender.
lendBorrowId*
String
Refer to the lend borrow Id page for details.
type*
String
Type of the pool in Morpho. Type can be market or vault.
By Default, market
marketId
String
The market Id of any market in Morpho
vaultAddress
String
The vaultAddress of any vault in Morpho.
https://api.expand.network/lendborrow/getuserpositions?lendborrowId=1402&address=0x8Ec0f66424152134DB6673060449eF4139CaC8Ae&vaultAddress=0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A&type=vault{
"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
lendBorrowId*
String
Refer to the Lend and Borrow ID page for details.
amount*
String
Number of tokens to be borrowed.
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.
to*
String
Receiver public address.
marketId
String
The market Id of any market in Morpho
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898"
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x50d8cd4b0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "130190",
"estimationCheck": true,
"referenceId": "69ef6fe0f90c48a99a8fa3d09810de5b"
}
}With gasPriority (medium):
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898",
"gasPriority":"medium"
}With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x50d8cd4b0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000186a000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "130190",
"gasPrice": "2862245",
"estimationCheck": true,
"referenceId": "e10a5491c0914c4fb1bac32247291533"
}
}/deposit
Trigger the deposit transaction from the given protocol.
POST https://api.expand.network/lendborrow/deposit
Request Body
lendBorrowId*
String
Refer to the Lend and Borrow ID page for details.
type*
String
Type of the pool in Morpho. Type can be market or vault.
By Default, market
amount*
String
Number of tokens to be deposited.
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.
marketId
String
The market Id of any market in Morpho.
Note - When Type param is market, marketId is required
vaultAddress
String
The vaultAddress of any vault in Morpho.
Note - When Type param is vault, vaultAddress is required
onBehalfOf
String
Public address of the user on whose behalf the deposit action will be executed.
Note - When Type param is market, onBehalfOf is applicable
collateral
Boolean
if true,token will be as collateral to borrow loan asset.
By Default, true
Note - When Type param is market, collateral is applicable
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"onBehalfOf": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"gas": "89898"
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x238d65790000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad600000000000000000000000000000000000000000000000000000000000005f5e1000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000",
"gas": "89898",
"estimationCheck": true,
"referenceId": "a42f2073ed7b41e78dd33283cd6eac55"
}
}With marketId :
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "100000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"onBehalfOf": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"gas": "89898"
}With gasPriority:
{
"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
lendBorrowId*
String
Refer to the Lend and Borrow ID page for details.
marketId*
String
The market Id of any market in Morpho.
amount*
String
Number of tokens to be repaid.
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.
onBehalfOf
String
Public address of the user on whose behalf the repay action will be executed.
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "1000000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898"
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x20b76e810000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000",
"gas": "90925",
"estimationCheck": true,
"referenceId": "95d1630ee5aa4df0b40dc37b126dbb04"
}
}With gasPriority (medium):
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "1000000000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898",
"gasPriority":"medium"
}With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x20b76e810000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad60000000000000000000000000000000000000000000000000000000000003b9aca0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c00000000000000000000000000000000000000000000000000000000000001200000000000000000000000000000000000000000000000000000000000000000",
"gas": "90925",
"gasPrice": "2851744",
"estimationCheck": true,
"referenceId": "f4ca9f37ecfa465ebaf927558e0dcbb5"
}
}/withdraw
Trigger the withdraw transaction from the given protocol.
POST https://api.expand.network/lendborrow/withdraw
Request Body
lendBorrowId*
String
Refer to the Lend and Borrow ID page for details.
type*
String
Type of the pool in Morpho. Type can be market or vault.
By Default, market
amount*
String
Number of tokens to withdraw.
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.
to*
String
Receiver public address.
onBehalfOf
String
Public address of the user on whose behalf the deposit action will be executed.
Note - When Type param is market, onBehalfOf is applicable
collateral
Boolean
if true,token will be as collateral to borrow loan asset.
By Default, true
Note - When Type param is market, collateral is applicable
vaultAddress
String
The vaultAddress of any vault in Morpho.
Note - When Type param is vault, vaultAddress is required
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "10000",
"marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
"gas": "89898"
}{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0xBBBBBbbBBb9cC5e90e3b3Af64bdAF62C37EEFFCb",
"value": "0",
"data": "0x8720316d0000000000000000000000004200000000000000000000000000000000000006000000000000000000000000833589fcd6edb6e08f4c7c32d4f71b54bda02913000000000000000000000000d09048c8b568dbf5f189302bea26c9edabfc485800000000000000000000000046415998764c29ab2a25cbea6254146d50d226870000000000000000000000000000000000000000000000000bef55718ad6000000000000000000000000000000000000000000000000000000000000000027100000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "138441",
"estimationCheck": true,
"referenceId": "8eec8150896e4fdaa26d4d1a1338d676"
}
}With vaultAddress :
{
"lendborrowId": "1402",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"amount": "10000",
"vaultAddress": "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
"gas": "89898",
"type":"vault"
}With gasPriority:
{
"status": 200,
"msg": "success",
"data": {
"chainId": "8453",
"from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
"to": "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
"value": "0",
"data": "0xb460af9400000000000000000000000000000000000000000000000000000000000027100000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c0000000000000000000000006d41c8d83a68a41a9ace313d171c685874d7898c",
"gas": "89898",
"estimationCheck": true,
"referenceId": "8f3cd53512dd49548cd5d5528e087b24"
}
}Last updated

