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

Name
Type
Description

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

/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

Name
Type
Description

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

/getuseraccountdata

Get the repay, borrow, withdraw amount and health factor details for the given user.

GET https://api.expand.network/lendborrow/getuseraccountdata

Query Parameters

Name
Type
Description

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

/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

Name
Type
Description

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

/borrow

Trigger the borrow transaction from the given protocol.

POST https://api.expand.network/lendborrow/borrow

Request Body

Name
Type
Description

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.

ofacCheck

Boolean

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

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"
}

With gasPriority (medium):

{
    "lendborrowId": "1402",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "100000",
    "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
    "gas": "89898",
    "gasPriority":"medium"
}

With ofacCheck :

{
    "lendborrowId": "1400",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "100000",
    "marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
    "gas": "89898",
    "gasPriority":"medium",
    "ofacCheck": true
}

/deposit

Trigger the deposit transaction from the given protocol.

POST https://api.expand.network/lendborrow/deposit

Request Body

Name
Type
Description

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.

ofacCheck

Boolean

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

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"
}

With marketId :

{
    "lendborrowId": "1402",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "100000000",
    "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
    "onBehalfOf": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "gas": "89898"
}

/repay

Trigger the repay transaction from the given protocol.

POST https://api.expand.network/lendborrow/repay

Request Body

Name
Type
Description

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.

ofacCheck

Boolean

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

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"
}

With gasPriority (medium):

{
    "lendborrowId": "1402",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "1000000000",
    "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
    "gas": "89898",
    "gasPriority":"medium"
}

With ofacCheck:

{
    "lendborrowId": "1400",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "1000000000",
    "marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
    "gas": "89898",
    "gasPriority":"medium",
    "ofacCheck": true
}

/withdraw

Trigger the withdraw transaction from the given protocol.

POST https://api.expand.network/lendborrow/withdraw

Request Body

Name
Type
Description

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.

ofacCheck

Boolean

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

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"
}

With vaultAddress :

{
    "lendborrowId": "1402",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "10000",
    "vaultAddress": "0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
    "gas": "89898",
    "type":"vault"
}

With ofacCheck:

{
    "lendborrowId": "1400",
    "from": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "to": "0x6D41C8D83a68a41A9acE313d171C685874D7898C",
    "amount": "10000",
    "marketId": "0x64d65c9a2d91c36d56fbc42d69e979335320169b3df63bf92789e2c8883fcc64",
    "gas": "89898",
    "ofacCheck": true
}

Last updated