POST /v1/yield/prepare
Pricing policy — $0.01 per call via x402 when payment enforcement is enabled. Current pre-prod deployment keeps x402 disabled. When enforced, attach the
X-PAYMENT header.- deposit (default): Discover best vault, score, and return deposit calldata. For unconfigured EOAs, includes EIP-7702 setup.
- redeem: Build calldata for withdrawing from a vault position.
- rebalance: Move funds from one vault to a better one. Always returns the recommended vault strategy with APY, risk, and TVL data.
Parameters
enum
Operation type: deposit into vault, redeem from vault, or rebalance between vaultsAllowed values:
deposit, redeem, rebalanceDefault: "deposit"string
Asset to deposit (e.g., “USDC”). Required for deposit.
string
Amount to deposit in human-readable form (e.g., “10000”). Required for deposit.
enum
Target chainAllowed values: active chain keys from
rhaios-config.yaml for the deployment. Current pre-prod profile supports ethereum and base.Default: "base"string
required
Agent’s EOA address
string
required
Target vault ID from yield_discover. Required for all operations.
Number of shares to redeem (as string for BigInt). Provide shares or percentage, not both.
number
Percentage of position to redeem. Provide shares or percentage, not both.
Example
Response
The response varies based on whether your wallet needs first-time EIP-7702 setup.Deposit — wallet already configured (needsSetup: false)
Deposit — first-time wallet, full setup (needsSetup: true, setupType: "full")
Deposit — module re-initialization (needsSetup: true, setupType: "modules")
When delegation already exists but modules failed to initialize (e.g., initializeAccount() reverted silently in a prior setup attempt):
needsSetup is true, sign and submit the setup transaction first, then call POST /v1/yield/prepare again to get the execution payload. For setupType: "full", sign a Type-4 (EIP-7702) transaction with authorization_list. For setupType: "modules", sign a regular Type-2 (EIP-1559) self-call transaction.