---
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.

# Repay

Process the repayment of borrowed assets to the lending protocol. Whether you’re reducing your debt or fully repaying a loan, this endpoint lets you specify the asset, amount, and repayment mode. Customizable gas parameters allow you to tailor the transaction for cost efficiency and timely execution.

> 💡 
**Compute Unit Value:** `255` (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_repay_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 repay.",
            "example": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2"
          },
          "interestRateMode": {
            "type": "string",
            "description": "Interest rate mode as defined by Aave. Default is 1.",
            "example": "1"
          },
          "onBehalfOf": {
            "type": "string",
            "description": "Public address of the user on whose behalf the repay action will be executed.",
            "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"
          },
          "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"
          },
          "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
          },
          "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"
          }
        },
        "required": [
          "asset",
          "interestRateMode",
          "onBehalfOf",
          "from",
          "amount",
          "marketId"
        ],
        "description": "The request body for a /defi/v1/lendborrow/repay",
        "example": {
          "lendborrowId": "1000",
          "asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
          "interestRateMode": "1",
          "onBehalfOf": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
          "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
          "gas": "100000",
          "amount": "1000000000000000000",
          "gasPriority": "low",
          "enableFee": false,
          "batchOption": "EIP-5792",
          "batcherContract": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca",
          "simulate": false,
          "market": "USDC",
          "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5"
        }
      }
    }
  },
  "tags": [
    {
      "name": "lendborrow",
      "description": "API endpoints for operations related to lending and borrowing"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "paths": {
    "/defi/v1/lendborrow/repay": {
      "post": {
        "tags": [
          "lendborrow"
        ],
        "summary": "Repay",
        "description": "Process the repayment of borrowed assets to the lending protocol. Whether you’re reducing your debt or fully repaying a loan, this endpoint lets you specify the asset, amount, and repayment mode. Customizable gas parameters allow you to tailor the transaction for cost efficiency and timely execution.\n\n> 💡 \n**Compute Unit Value:** `255` (Fixed)",
        "operationId": "lendborrowRepay",
        "requestBody": {
          "required": true,
          "description": "The request body for a /defi/v1/lendborrow/repay",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/_lendborrow_repay_Request"
              },
              "example": {
                "lendborrowId": "1000",
                "asset": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
                "interestRateMode": "1",
                "onBehalfOf": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
                "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
                "gas": "100000",
                "amount": "1000000000000000000",
                "gasPriority": "low",
                "enableFee": false,
                "batchOption": "EIP-5792",
                "batcherContract": "0x9c933f9d2efd76ce25b0d3dde84d3f94e78a50ca",
                "simulate": false,
                "market": "USDC",
                "marketId": "0x3b3769cfca57be2eaed03fcc5299c25691b77781a1e124e7a8d520eb9a7eabb5"
              }
            }
          }
        },
        "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": "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"
                            },
                            "estimationCheck": {
                              "oneOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "boolean"
                                }
                              ],
                              "description": "Flag or value indicating transaction fee/estimate status"
                            },
                            "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`; 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",
                            "estimationCheck",
                            "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"
                              ]
                            },
                            "repayTxn": {
                              "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"
                                },
                                "estimationCheck": {
                                  "oneOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "boolean"
                                    }
                                  ],
                                  "description": "Flag or value indicating transaction fee/estimate status"
                                },
                                "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`; 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",
                                "estimationCheck",
                                "to",
                                "value"
                              ]
                            }
                          },
                          "required": [
                            "createFeeTxn",
                            "repayTxn"
                          ]
                        },
                        {
                          "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": "0x63056E00436Da25BcF48A40dfBbDcc7089351006",
                      "to": "0x87870Bca3F3fD6335C3F4ce8392D69350B4fA4E2",
                      "value": "0",
                      "estimationCheck": true,
                      "gas": "408298",
                      "data": "0x573ade81000000000000000000000000dac17f958d2ee523a2206206994597c13d831ec700000000000000000000000000000000000000000000000000000000000186a0000000000000000000000000000000000000000000000000000000000000000100000000000000000000000063056e00436da25bcf48a40dfbbdcc7089351006",
                      "referenceId": "206365ea298a46c790b0ae51add101c3"
                    }
                  }
                }
              }
            }
          }
        },
        "x-bd-cu": "255",
        "x-bd-cu-type": "fixed",
        "x-internal": false
      }
    }
  },
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  }
}
```