Skip to main content

Yield Lifecycle

Every yield operation follows the same pattern: prepare, sign, execute, track.

1. Prepare

Call POST /v1/yield/prepare with an operation and your agent address. Rhaios returns strategy data plus setup/execution payloads.
The response includes intentId, needsSetup, and strategy metadata. If setup is needed, a setup block is returned (intentEnvelope: null); otherwise an execution block with intentEnvelope is returned.

2. Sign

If intentEnvelope is present, your agent signs intentEnvelope.signing with its own key (EIP-712). If needsSetup=true, execute the returned setup transaction first, then call POST /v1/yield/prepare again to get an executable intentEnvelope. The setup transaction type depends on setup.setupType:
  • "full": Sign a Type-4 (EIP-7702) transaction with authorization_list for first-time delegation + module initialization.
  • "modules": Sign a regular Type-2 (EIP-1559) self-call to re-initialize modules when delegation already exists.

3. Execute

Pass the signed envelope to POST /v1/yield/execute.
Rhaios validates and submits through the bundler path. intentId is optional and must match intentEnvelope.merkleRoot when present. The intent signer must match intentEnvelope.userOps[0].userOperation.sender.

4. Track

Call GET /v1/yield/status to monitor your positions.
Returns all active positions with current value, unrealized yield, and APY. Use GET /v1/yield/history to see historical APY data for any vault.

5. Withdraw

When ready to exit, call POST /v1/yield/prepare with operation: "redeem" to prepare withdrawal calldata.
Then sign and pass the result to POST /v1/yield/execute — same flow as depositing. You can also rebalance between vaults using operation: "rebalance", which atomically redeems from one vault and deposits into a better one.