---
title: "Migrate"
method: POST
path: "/defi/v1/lendborrow/migrate"
tags: ["lendborrow"]
---

# Migrate

`POST /defi/v1/lendborrow/migrate`

## Request

- Base URL: `https://svc.blockdaemon.com`
- URL: `https://svc.blockdaemon.com/defi/v1/lendborrow/migrate`
- Auth: API key in header `X-API-Key`

Facilitate the migration of your positions between different lending protocols. This endpoint enables you to seamlessly transfer your assets from one protocol to another, ensuring continuity of your positions while optimizing gas usage and minimizing downtime.

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

## Request body

- LendborrowMigrateRequest: The request body for a /defi/v1/lendborrow/migrate
  - `lendborrowId` '1200' | '1205': The unique ID to specify the lending and borrowing protocol for routing relevant queries or transactions.
  - `assets` string: Comma-separated list of token addresses to migrate.
  - `from` string, required: 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.
  - `gas` string: 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.
  - `enableFee` boolean: Flag to include a basis points fee transaction alongside the main transaction when set to true.
  - `simulate` boolean: When true, dry-runs the transaction batch via eth_simulateV1 and returns a simulate field with status and error on each transaction.

## Response `200`

Successful response

- object
  - `status` number: Numeric status code indicating success or failure of the API call
  - `msg` string: Human-readable message describing the API result or error
  - `data` union
    - object
      - `chainId` string, required: Blockchain network identifier (EVM chain ID, Solana chain name, etc.)
      - `from` string, required: Sender's wallet address
      - `to` string, required: Recipient's wallet address
      - `value` string, required: Amount being transferred or involved in a transaction
      - `gas` string: Gas limit for the transaction
      - `gasPrice` string: Price per gas unit for the transaction
      - `data` string, required: Main payload object or array returned by the API
      - `estimationCheck` union, required: Flag or value indicating transaction fee/estimate status
        - string
        - boolean
      - `referenceId` string, required: Unique ID for tracking a specific transaction or operation
      - `simulate` object: Present when the request used `simulate: true`; eth_simulateV1 summary (omitted when simulation was not run).
        - `status` 'success' | 'failure', required
        - `error` string, nullable, required: Failure reason when status is failure; null when status is success
    - object
      - `createFeeTxn` object, required
        - `chainId` string, required: Blockchain network identifier (EVM chain ID, Solana chain name, etc.)
        - `from` string, required: Sender's wallet address
        - `to` string, required: Recipient's wallet address
        - `value` string, required: Amount being transferred or involved in a transaction
        - `gasPrice` string: Price per gas unit for the transaction
        - `gas` string: Gas limit for the transaction
        - `simulate` object: Present when the request used `simulate: true` with `enableFee: true`; fee leg eth_simulateV1 summary.
          - `status` 'success' | 'failure', required
          - `error` string, nullable, required: Failure reason when status is failure; null when status is success
      - `migrateTxn` object, required
        - `chainId` string, required: Blockchain network identifier (EVM chain ID, Solana chain name, etc.)
        - `from` string, required: Sender's wallet address
        - `to` string, required: Recipient's wallet address
        - `value` string, required: Amount being transferred or involved in a transaction
        - `gas` string: Gas limit for the transaction
        - `gasPrice` string: Price per gas unit for the transaction
        - `data` string, required: Main payload object or array returned by the API
        - `estimationCheck` union, required: Flag or value indicating transaction fee/estimate status
          - string
          - boolean
        - `referenceId` string, required: Unique ID for tracking a specific transaction or operation
        - `simulate` object: Present when the request used `simulate: true`; eth_simulateV1 summary (omitted when simulation was not run).
          - `status` 'success' | 'failure', required
          - `error` string, nullable, required: Failure reason when status is failure; null when status is success

---

[API](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api.md) - [All operations](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/llms.txt) - [OpenAPI document](https://skmtc.dev/blockdaemon/apis/blockdaemon-defi-api/revisions/ec053b7c8041?raw)
