lendborrow

Migrate

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)

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

Request body

lendborrowId'1200' | '1205'

The unique ID to specify the lending and borrowing protocol for routing relevant queries or transactions.

assetsstring

Comma-separated list of token addresses to migrate.

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

gasstring

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.

enableFeeboolean

Flag to include a basis points fee transaction alongside the main transaction when set to true.

simulateboolean

When true, dry-runs the transaction batch via eth_simulateV1 and returns a simulate field with status and error on each transaction.

Example request

{
  "lendborrowId": "1200",
  "assets": "0x5f98805a4e8be255a32880fdec7f6728c6568ba0,0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2",
  "from": "0xdAe2F6EdDdA6fb4fb60cc02633DE27e2b431B402",
  "gas": "100000",
  "enableFee": false,
  "simulate": false
}

Response

Successful response

statusnumber

Numeric status code indicating success or failure of the API call

msgstring

Human-readable message describing the API result or error

Example response

{
  "status": 200,
  "msg": "success",
  "data": {
    "chainId": "1",
    "from": "0x356dB816602c85e2075774bB77D13995c8Bab023",
    "to": "0xb748952c7bc638f31775245964707bcc5ddfabfc",
    "estimationCheck": true,
    "value": "0",
    "gas": "329000",
    "data": "0x3698d492000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000e0000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000010000000000000000000000006b175474e89094c44da98b954eedeac495271d0f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "referenceId": "76137704aa884a90b6a47082bc65e735"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.