Function Signature
Description
Perform management actions on a yield position, such as claiming rewards or compounding. Requires apassthrough value obtained from a balance’s pendingAction.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
yieldId | String | Yes | The ID of the yield opportunity to manage |
action | String | Yes | The management action to perform (e.g., "claim", "compound") |
address | String? | No | Wallet address (defaults to current wallet) |
arguments | String? | No | Additional protocol-specific arguments as JSON string |
passthrough | String | Yes | Data from balance pendingAction. Throws MISSING_PASSTHROUGH if null or empty. |
Returns
YieldXyzActionResponse - An object containing:
| Property | Type | Description |
|---|---|---|
id | String | Action ID for tracking |
intent | YieldXyzActionIntent | Action intent (enter, exit, manage) |
type | String | Action type |
yieldId | String | The yield opportunity ID |
address | String | Wallet address used |
amount | String? | Amount |
amountRaw | String? | Raw amount |
amountUsd | String? | USD equivalent amount |
transactions | List<YieldXyzActionTransaction?> | List of transactions to be signed and broadcast |
executionPattern | YieldXyzActionExecutionPattern | Execution pattern (synchronous, asynchronous, batched) |
createdAt | String | Creation timestamp |
completedAt | String? | Completion timestamp |
status | YieldXyzActionStatus | Current status (created, processing, success, failed, canceled, waitingForNext, stale) |
Example
Errors
| Code | Description |
|---|---|
NOT_INITIALIZED | Portal was not initialized |
MISSING_PASSTHROUGH | Passthrough is required for manage. Get it from balance pendingAction. |
YIELD_FAILED | Failed to manage yield position |