Create a plan to earn yield on a DeFi protocol
| Parameter | Type | Description |
|---|---|---|
external_id | string | The sub-account’s external ID |
| Parameter | Type | Required | Description |
|---|---|---|---|
amount | string | Yes | Amount in the asset’s smallest unit (e.g., "1000000" = 1 USDC) |
asset | string | Yes | Asset symbol (e.g., "USDC") |
network | string | Yes | Network name (e.g., "base", "mainnet") |
protocol | string | Yes | Protocol to earn on (e.g., "compound", "morpho", "aave") |
| Field | Type | Description |
|---|---|---|
plan_id | string | Unique identifier for this plan (pln_ prefix) |
chart | object | Transaction details including EIP-712 signing data |
chart.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 or invalid values |
| 400 | plan_failed | Could not generate a valid plan (e.g., insufficient balance) |
| 400 | no_wallet | Account has no wallets |
| 408 | timeout | Folio computation timed out |
amount is in the asset’s smallest unit. For USDC (6 decimals), "1000000" = 1 USDC