Create a plan to migrate a supply position between protocols
| Parameter | Type | Description |
|---|---|---|
account_id | string | The sub-account ID |
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount to migrate in the asset’s smallest unit |
asset | string | Yes | Asset to migrate (e.g., "USDC") |
from_protocol | string | Yes | Source protocol: "compound", "aave", or "morpho_vault" |
to_protocol | string | Yes | Destination protocol: "compound", "aave", or "morpho_vault" |
network | string | Yes | Target network (e.g., "base", "mainnet"). Funds on other chains are bridged automatically. |
from_market | string | No | Source market reference (required for morpho_vault) |
to_market | string | No | Destination market reference (required for morpho_vault) |
migrate_only_supply_balances | boolean | No | If true, only migrate supply balances (default: false) |
| Field | Type | Description |
|---|---|---|
plan_id | string | Unique identifier for this plan (pln_ prefix) |
details | object | Transaction details including EIP-712 signing data |
details.eip712_data.digest | string | The hash to sign with the account’s signer key |
expires_at | string | ISO 8601 timestamp — plan must be executed before this time |
| Status | Code | Description |
|---|---|---|
| 400 | invalid_params | Missing required parameters, unsupported protocol, or missing market reference for morpho_vault |
| 400 | plan_failed | Could not generate a valid plan (e.g., insufficient balance in source) |
| 400 | no_wallet | Account has no wallets |
| 408 | timeout | Folio computation timed out |
morpho_vault as source or destination, you must provide the corresponding from_market or to_market parameter.migrate_only_supply_balances to true to prevent migrating reward or other non-supply balances.