Create a plan to claim rewards, swap them, and resupply
| Parameter | Type | Description |
|---|---|---|
account_id | string | The sub-account ID |
| Parameter | Type | Required | Description |
|---|---|---|---|
asset | string | Yes | The supply asset to compound into (e.g., "USDC") |
protocol | string | Yes | Protocol: "compound", "aave", or "morpho_vault" |
network | string | Yes | Network name (e.g., "base", "mainnet") |
reward_assets | string[] | Yes | List of reward assets to claim and swap (e.g., ["COMP"]) |
market | string | No | Market reference (required for morpho_vault) |
| 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 empty reward_assets |
| 400 | plan_failed | Could not generate a valid plan (e.g., no rewards to claim) |
| 400 | no_wallet | Account has no wallets |
| 408 | timeout | Folio computation timed out |
| 422 | swap_quote_failed | Could not fetch a swap quote for one of the reward assets |
morpho_vault as the protocol, you must provide the market parameter.