---
updatedAt: 2026-05-14T11:27:34.000Z
---

Fetch the complete documentation index at: https://docs.blockdaemon.com/llms.txt. Use this file to discover all available pages before exploring further. Append .md to any documentation page URL to get its markdown version.

# Withdraw With Approval

Process the withdrawal of deposited assets from a lending protocol with automated approval handling. Returns an array of transactions: an ERC-20 approval transaction (only when required) followed by the withdrawal transaction. This eliminates the need for manual allowance management before withdrawal.

> 💡 
**Compute Unit Value:** `205` (Fixed)

# OpenAPI definition

```json
{
  "openapi": "3.0.0",
  "info": {
    "contact": {
      "name": "Blockdaemon",
      "email": "info@blockdaemon.com"
    },
    "description": "The Blockdaemon DeFi API provides a single interface to a multitude of DeFi projects and blockchains",
    "title": "Blockdaemon DeFi API",
    "version": "1.0.0",
    "x-logo": {
      "altText": "Blockdaemon logo",
      "backgroundColor": "#fafafa",
      "url": "https://storage.googleapis.com/blockdaemon-app-static-images/marketing/PNG/dark-logo.png"
    }
  },
  "externalDocs": {
    "description": "Blockdaemon DeFi documentation",
    "url": "http://www.blockdaemon.com/api/defi"
  },
  "servers": [
    {
      "url": "https://svc.blockdaemon.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "`X-API-Key: <Token>` header must be set to authenticate API requests.You can create tokens in the \"Configure\" tab of your API access area at https://app.blockdaemon.com."
      }
    },
    "schemas": {
      "_lendborrow_withdraw-with-approval_Request": {
        "type": "object",
        "properties": {
          "lendborrowId": {
            "type": "string",
            "description": "The unique ID to specify the lending and borrowing protocol for routing relevant queries or transactions.",
            "enum": [
              "1000",
              "1003",
              "1005",
              "1200",
              "1208",
              "1203",
              "1204",
              "1205",
              "1206",
              "1207",
              "1100",
              "1300",
              "1302",
              "1400",
              "1401",
              "1402",
              "1403",
              "1404"
            ],
            "example": "1000"
          },
          "asset": {
            "type": "string",
            "description": "Token address of the asset to withdraw.",
            "example": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
          },
          "amount": {
            "type": "string",
            "description": "Number of tokens, specified in the token's smallest denomination (base units). Do not send human-readable decimal values. Examples: 1 WETH (18 decimals) = \"1000000000000000000\"; 1 USDC (6 decimals) = \"1000000\".",
            "example": "1000000000000000000"
          },
          "to": {
            "type": "string",
            "description": "Blockchain address of the recipient. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...).",
            "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
          },
          "from": {
            "type": "string",
            "description": "Blockchain address of the sender. For EVM chains, use a checksummed hex address (e.g., 0xABCDEF...). This address must hold sufficient balance and will sign the transaction.",
            "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
          },
          "gas": {
            "type": "string",
            "description": "Maximum number of gas units to allocate for the transaction, as an integer string (e.g., '200000'). If omitted, gas is estimated automatically. Note: this is gas units, not wei or gwei.",
            "example": "100000"
          },
          "gasPriority": {
            "type": "string",
            "description": "Specifies the priority level for gas fees (e.g., 'low', 'medium', or 'high'), which influences the transaction speed and cost.",
            "example": "low"
          },
          "enableFee": {
            "type": "boolean",
            "description": "Flag to include a basis points fee transaction alongside the main transaction when set to true.",
            "example": false
          },
          "batchOption": {
            "type": "string",
            "description": "Transaction batching standard to use. Supported values: 'EIP-5792' (wallet-level batching via wallet_sendCalls) or 'EIP-7702' (EOA code delegation via batcherContract). Requires batcherContract when using EIP-7702.",
            "enum": [
              "EIP-5792",
              "EIP-7702"
            ],
            "example": "EIP-5792"
          },
          "batcherContract": {
            "type": "string",
            "description": "The EOA address of the batcher that will be used to execute the transaction when using EIP-7702 batching. If not provided, the default batcher contract for the chain will be used.",
            "example": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca"
          },
          "simulate": {
            "type": "boolean",
            "description": "When true, dry-runs the transaction batch via eth_simulateV1 and returns a simulate field with status and error on each transaction.",
            "example": false
          },
          "useCustomVaults": {
            "type": "boolean",
            "description": "A boolean flag to scope the API request. If true, the request will be processed using the partner's dedicated vaults. If false or omitted, it uses the standard public pools.",
            "example": false
          },
          "market": {
            "type": "string",
            "description": "The market of the asset, such as USDC or WETH. Defaults to USDC.",
            "example": "USDC"
          },
          "marketId": {
            "type": "string",
            "description": "Specifies the market Id of any market in Morpho.",
            "example": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5"
          },
          "vaultAddress": {
            "type": "string",
            "description": "Specifies the vaultAddress of any vault in Morpho.",
            "example": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c"
          },
          "onBehalfOf": {
            "type": "string",
            "description": "Public address of the user on whose behalf the borrow action will be executed.",
            "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
          },
          "collateral": {
            "type": "boolean",
            "description": "Specifies the condition for depositing the token as a supply to earn the yields only or use it as collateral to borrow loan asset.",
            "example": false
          }
        },
        "required": [
          "amount",
          "to",
          "from"
        ],
        "description": "The request body for a /defi/v1/lendborrow/withdraw-with-approval",
        "example": {
          "lendborrowId": "1000",
          "asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
          "amount": "1000000000000000000",
          "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
          "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
          "gas": "100000",
          "gasPriority": "low",
          "enableFee": false,
          "batchOption": "EIP-5792",
          "batcherContract": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca",
          "simulate": false,
          "useCustomVaults": false,
          "market": "USDC",
          "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
          "vaultAddress": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
          "onBehalfOf": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
          "collateral": false
        }
      }
    }
  },
  "tags": [
    {
      "name": "lendborrow",
      "description": "API endpoints for operations related to lending and borrowing"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/defi/v1/lendborrow/withdraw-with-approval": {
      "post": {
        "tags": [
          "lendborrow"
        ],
        "summary": "Withdraw With Approval",
        "description": "Process the withdrawal of deposited assets from a lending protocol with automated approval handling. Returns an array of transactions: an ERC-20 approval transaction (only when required) followed by the withdrawal transaction. This eliminates the need for manual allowance management before withdrawal.\n\n> 💡 \n**Compute Unit Value:** `205` (Fixed)",
        "operationId": "lendborrowWithdrawWithApproval",
        "requestBody": {
          "required": true,
          "description": "The request body for a /defi/v1/lendborrow/withdraw-with-approval",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/_lendborrow_withdraw-with-approval_Request"
              },
              "example": {
                "lendborrowId": "1000",
                "asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                "amount": "1000000000000000000",
                "to": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
                "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
                "gas": "100000",
                "gasPriority": "low",
                "enableFee": false,
                "batchOption": "EIP-5792",
                "batcherContract": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca",
                "simulate": false,
                "useCustomVaults": false,
                "market": "USDC",
                "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5",
                "vaultAddress": "0xa258C4606Ca8206D8aA700cE2143D7db854D168c",
                "onBehalfOf": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
                "collateral": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "number",
                      "description": "Numeric status code indicating success or failure of the API call",
                      "example": 200
                    },
                    "msg": {
                      "type": "string",
                      "description": "Human-readable message describing the API result or error"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "type": "array",
                          "description": "Ordered EVM transactions: optional ERC-20 approve then withdraw, or withdraw only when allowance is sufficient.",
                          "items": {
                            "type": "object",
                            "properties": {
                              "chainId": {
                                "type": "string",
                                "description": "Blockchain network identifier (EVM chain ID, Solana chain name, etc.)",
                                "example": "1"
                              },
                              "from": {
                                "type": "string",
                                "description": "Sender's wallet address",
                                "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
                              },
                              "to": {
                                "type": "string",
                                "description": "Recipient's wallet address",
                                "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
                              },
                              "value": {
                                "type": "string",
                                "description": "Amount being transferred or involved in a transaction",
                                "example": "10"
                              },
                              "gas": {
                                "type": "string",
                                "description": "Gas limit for the transaction",
                                "example": "100000"
                              },
                              "gasPrice": {
                                "type": "string",
                                "description": "Price per gas unit for the transaction",
                                "example": "10000"
                              },
                              "data": {
                                "type": "string",
                                "description": "Main payload object or array returned by the API",
                                "example": "0x40e53eb7000000000000000000000000000000000000000000000000000000000016e360"
                              },
                              "referenceId": {
                                "type": "string",
                                "description": "Unique ID for tracking a specific transaction or operation",
                                "example": "8eec8150896e4fdaa26d4d1a1338d676"
                              },
                              "simulate": {
                                "type": "object",
                                "description": "Present when the request used `simulate: true`; per-leg `eth_simulateV1` summary (omitted when simulation was not run).",
                                "properties": {
                                  "status": {
                                    "type": "string",
                                    "enum": [
                                      "success",
                                      "failure"
                                    ]
                                  },
                                  "error": {
                                    "type": "string",
                                    "nullable": true,
                                    "description": "Failure reason when status is failure; null when status is success"
                                  }
                                },
                                "required": [
                                  "status",
                                  "error"
                                ]
                              }
                            },
                            "required": [
                              "chainId",
                              "from",
                              "data",
                              "referenceId",
                              "to",
                              "value"
                            ]
                          }
                        },
                        {
                          "type": "object",
                          "properties": {
                            "createFeeTxn": {
                              "type": "object",
                              "properties": {
                                "chainId": {
                                  "type": "string",
                                  "description": "Blockchain network identifier (EVM chain ID, Solana chain name, etc.)",
                                  "example": "1"
                                },
                                "from": {
                                  "type": "string",
                                  "description": "Sender's wallet address",
                                  "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
                                },
                                "to": {
                                  "type": "string",
                                  "description": "Recipient's wallet address",
                                  "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
                                },
                                "value": {
                                  "type": "string",
                                  "description": "Amount being transferred or involved in a transaction",
                                  "example": "10"
                                },
                                "gasPrice": {
                                  "type": "string",
                                  "description": "Price per gas unit for the transaction",
                                  "example": "10000"
                                },
                                "gas": {
                                  "type": "string",
                                  "description": "Gas limit for the transaction",
                                  "example": "100000"
                                },
                                "simulate": {
                                  "type": "object",
                                  "description": "Present when the request used `simulate: true` with `enableFee: true`; fee leg `eth_simulateV1` summary.",
                                  "properties": {
                                    "status": {
                                      "type": "string",
                                      "enum": [
                                        "success",
                                        "failure"
                                      ]
                                    },
                                    "error": {
                                      "type": "string",
                                      "nullable": true,
                                      "description": "Failure reason when status is failure; null when status is success"
                                    }
                                  },
                                  "required": [
                                    "status",
                                    "error"
                                  ]
                                }
                              },
                              "required": [
                                "chainId",
                                "from",
                                "to",
                                "value"
                              ]
                            },
                            "withdrawWithApprovalTxn": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "chainId": {
                                    "type": "string",
                                    "description": "Blockchain network identifier (EVM chain ID, Solana chain name, etc.)",
                                    "example": "1"
                                  },
                                  "from": {
                                    "type": "string",
                                    "description": "Sender's wallet address",
                                    "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
                                  },
                                  "to": {
                                    "type": "string",
                                    "description": "Recipient's wallet address",
                                    "example": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402"
                                  },
                                  "value": {
                                    "type": "string",
                                    "description": "Amount being transferred or involved in a transaction",
                                    "example": "10"
                                  },
                                  "gas": {
                                    "type": "string",
                                    "description": "Gas limit for the transaction",
                                    "example": "100000"
                                  },
                                  "gasPrice": {
                                    "type": "string",
                                    "description": "Price per gas unit for the transaction",
                                    "example": "10000"
                                  },
                                  "data": {
                                    "type": "string",
                                    "description": "Main payload object or array returned by the API",
                                    "example": "0x40e53eb7000000000000000000000000000000000000000000000000000000000016e360"
                                  },
                                  "referenceId": {
                                    "type": "string",
                                    "description": "Unique ID for tracking a specific transaction or operation",
                                    "example": "8eec8150896e4fdaa26d4d1a1338d676"
                                  },
                                  "simulate": {
                                    "type": "object",
                                    "description": "Present when the request used `simulate: true` with `enableFee: true`; per-leg `eth_simulateV1` summary.",
                                    "properties": {
                                      "status": {
                                        "type": "string",
                                        "enum": [
                                          "success",
                                          "failure"
                                        ]
                                      },
                                      "error": {
                                        "type": "string",
                                        "nullable": true,
                                        "description": "Failure reason when status is failure; null when status is success"
                                      }
                                    },
                                    "required": [
                                      "status",
                                      "error"
                                    ]
                                  }
                                },
                                "required": [
                                  "chainId",
                                  "from",
                                  "data",
                                  "referenceId",
                                  "to",
                                  "value"
                                ]
                              }
                            }
                          },
                          "required": [
                            "createFeeTxn",
                            "withdrawWithApprovalTxn"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": "string"
                            },
                            "chainId": {
                              "type": "string"
                            },
                            "referenceId": {
                              "type": "string"
                            },
                            "methodUsed": {
                              "type": "string",
                              "enum": [
                                "EIP-5792",
                                "EIP-7702"
                              ]
                            },
                            "calls": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "to": {
                                    "type": "string"
                                  },
                                  "value": {
                                    "type": "string"
                                  },
                                  "data": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "to",
                                  "value",
                                  "data"
                                ]
                              }
                            }
                          },
                          "required": [
                            "from",
                            "chainId",
                            "referenceId",
                            "methodUsed",
                            "calls"
                          ]
                        },
                        {
                          "title": "Generated schema for EIP-7702",
                          "type": "object",
                          "properties": {
                            "from": {
                              "type": "string"
                            },
                            "chainId": {
                              "type": "string"
                            },
                            "referenceId": {
                              "type": "string"
                            },
                            "methodUsed": {
                              "type": "string"
                            },
                            "to": {
                              "type": "string"
                            },
                            "data": {
                              "type": "string"
                            },
                            "value": {
                              "type": "string"
                            },
                            "batcherContract": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "from",
                            "chainId",
                            "referenceId",
                            "methodUsed",
                            "to",
                            "data",
                            "value",
                            "batcherContract"
                          ]
                        }
                      ]
                    }
                  },
                  "example": {
                    "status": 200,
                    "msg": "success",
                    "data": [
                      {
                        "chainId": "1",
                        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
                        "to": "0x98C23E9d8f34FEFb1B7BD6a91B7FF122F4e16F5c",
                        "gas": "51692",
                        "value": "0",
                        "data": "0x095ea7b300000000000000000000000054d9abeed8415446f8c736d198a8797156b41a93000000000000000000000000000000000000000000000000002386f26fc10000",
                        "referenceId": "878b54fb5a674e4db5de982600669fce"
                      },
                      {
                        "chainId": "1",
                        "from": "0x829bFB482331b9Dc2BEcb5483ecA79c0578c3A45",
                        "to": "0x54d9ABeed8415446F8C736D198a8797156b41a93",
                        "gas": "500000",
                        "value": "0",
                        "data": "0xb460af94000000000000000000000000000000000000000000000000002386f26fc10000000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45000000000000000000000000829bfb482331b9dc2becb5483eca79c0578c3a45",
                        "referenceId": "878b54fb5a674e4db5de982600669fce"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "x-bd-cu": "205",
        "x-bd-cu-type": "fixed",
        "x-internal": false
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```