expand.network
  • Overview
  • Getting Started
  • 🔑How do I get my API Key?
  • 📑List of All Endpoints
  • ⚙️SDK
    • Overview
    • Getting Started
  • ⛓️INTEGRATIONS
    • ⚡Blockchains
      • EVM based blockchains
        • Ethereum
        • Binance Smart Chain
        • Avalanche - C
        • Avalanche - P
        • Avalanche - X
        • Polygon
        • Cronos
        • Arbitrum
        • Fantom
        • Optimism
        • Base
        • zkSync Era
        • Mantle
      • Non-EVM based chains
        • Tron
        • Solana
        • Near
        • Algorand
        • Aptos
        • Sui
        • Starknet
        • TON
        • Cosmos Hub
        • Osmosis
        • Stacks
        • Bitcoin
        • Stellar
          • Stellar RWA
        • XRP Ledger
          • XRP Ledger RWA
    • ⚡Bridges
      • Stargate
      • Stargate V2
      • Squid Router
      • Squid Router V2
      • Allbridge Classic
      • Allbridge Core
    • ⚡DEX & DEX Aggregators
      • Uniswap V2
      • Uniswap V3
      • Uniswap X
      • Sushiswap V2
      • PancakeSwap V2
      • PancakeSwap V3
      • Aerodrome
      • Camelot V3
      • Curve V2
      • Balancer V2
      • STON.fi
      • Trader Joe
      • Orca
      • Raydium
      • SDEX
      • Cetus
      • REF Finance
      • Liquidswap
      • Sologenic
      • Alex
      • 0x (Aggregator)
      • 1inch (Aggregator)
      • Kyberswap (Aggregator)
        • Kyberswap ( Limit Order Endpoints )
      • Jupiter (Aggregator)
    • ⚡Derivatives
      • dYdX V4
    • ⚡Fungible Tokens
      • ERC20
      • WETH
    • ⚡Lending Protocols
      • Aave V2
      • Aave V3
      • Compound V2
      • Compound V3
      • Morpho
    • ⚡Yield Aggregators
      • Yearn Finance V2
      • Harvest Finance
      • Pendle
    • ⚡Liquid Staking
      • Chorus One
      • Lido V2
      • Stader
      • Benqi
      • Jito
      • EigenLayer
    • ⚡Non Fungible Tokens
      • ERC721
      • ERC1155
      • Metaplex
    • ⚡Oracles
      • ChainLink
      • WinkLink
      • Pyth Network
      • RedStone
    • ⚡Stablecoins
      • EVM
    • ⚡Synthetics
      • Synthetix
    • ⚡Supported Wallets
      • MPC Wallets
        • DFNS
        • FORDEFI
        • FIREBLOCKS
        • CIRCLE
      • HD Wallets
        • PHANTOM
        • COINBASE
        • TON Wallet
      • Wallet Connect v2
  • How To
    • Execute a Local Swap
    • Execute a Cross Chain Swap
    • Use Limit Orders
    • Lend and Borrow
    • Provision Liquidity
      • Adding Liquidity
      • Removing liquidity
    • Yield Farm
    • Use Our Transaction Decoder
    • Submit an RFQ
    • Subscribe to Events
    • Stream Data (WebSocket)
      • Stream Transaction
      • Stream Trade
      • Stream Gas
      • Stream Ticker Price
    • Source Pricing
    • Track Memecoins
    • Manage Token Approvals
  • Use Cases
    • Trade Reconciliation
    • Portfolio Management
    • Trading Features
    • On-Chain Data: DEX Liquidity Pool Forensics
    • Transaction and Pool Analysis
  • Account Abstraction
    • Overview
      • User Endpoints
      • Paymaster Endpoint
      • Bundler Endpoint
    • ⚙️SDK - Overview
  • Additional Info
    • Error Messages
    • Client-Side Security Essentials
    • Compute Unit Costs
    • API Metadata
    • Audit Certificate
    • Brand Assets
    • FAQs
    • Quicknode Marketplace
      • DEX
      • Lending Protocols
  • ID's
    • Chain IDs
    • Bridge IDs
      • Internal Chain IDs for Bridges
    • DEX IDs
    • Lending Protocol IDs
    • Yield Aggregator ID
    • Liquid Staking IDs
    • Oracle IDs
    • Stablecoin IDs
    • Derivatives IDs
    • Synthetics IDs
  • Mapping
    • Blockchains
    • DEXs
      • Uniswap V2
      • Uniswap V3
      • Sushiswap
      • PancakeSwap
      • Curve
      • Balancer
    • Lending Protocols
      • Aave
      • Compound
  • Protocol Spender
    • Spender list
Powered by GitBook
On this page
  • /getpool
  • /getpools
  • /getuseraccountdata
  • /getuserpositions
  • /borrow
  • /deposit
  • /repay
  • /withdraw
  1. INTEGRATIONS
  2. Lending Protocols

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

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

Name
Type
Description

lendBorrowId*

String

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

Name
Type
Description

rpc

String

Remote procedural call URL.

lendBorrowId*

String

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

Name
Type
Description

rpc

String

Remote procedural call URL.

address*

String

Public address of sender.

lendBorrowId*

String

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

Name
Type
Description

lendBorrowId*

String

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

With ofacCheck :

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

With ofacCheck:

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

Name
Type
Description

lendBorrowId*

String

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

Name
Type
Description

lendBorrowId*

String

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

With ofacCheck:

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

With ofacCheck:

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

Name
Type
Description

lendBorrowId*

String

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

With ofacCheck:

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

With ofacCheck:

{
    "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"
    }
}
PreviousCompound V3NextYield Aggregators

Last updated 6 days ago

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

Refer to the page for details.

⛓️
⚡
Lend and Borrow ID
lend borrow Id
lend borrow Id
lend borrow Id
Lend and Borrow ID
Lend and Borrow ID
Lend and Borrow ID
Lend and Borrow ID