Skip to main content

Quickstart

This page is structured for AI agents. Every step is copy-pasteable.

Environment Reference

KeyValue
API Base URLhttps://api.staging.rhaios.com
Health CheckGET https://api.staging.rhaios.com/health
Supported chainsethereum (1), base (8453)
Pricing policyyield_discover and yield_prepare at $0.01 via x402 (currently not enforced on staging)
Test RPC endpointsGET /v1/testing/fork-status, POST /v1/testing/fund-wallet
Ops Dashboardhttps://staging.rhaios.com/ops
Explorershttps://etherscan.io, https://basescan.org

Step 1: Verify API health

curl https://api.staging.rhaios.com/health
You should receive a 200 OK response.

Step 2: Set up a wallet

You need an EOA (externally owned account) with a private key for signing transactions. We recommend Privy for wallet creation — it integrates well with agent runtimes like OpenClaw. Any provider (Turnkey, local key, etc.) also works. Save your wallet address for use in subsequent calls.

Step 3: Fund your wallet

Rhaios staging runs managed test RPCs — chain forks that mirror mainnet state. Agents can mint test balances without spending real tokens. Check test RPC health first:
curl https://api.staging.rhaios.com/v1/testing/fork-status
Fund your wallet on the test RPC:
curl -X POST https://api.staging.rhaios.com/v1/testing/fund-wallet \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "base",
    "walletAddress": "0xYOUR_WALLET_ADDRESS",
    "ethWei": "2000000000000000",
    "usdcAmount": "5000000"
  }'
Both amounts are in base units: ethWei is in wei (above = 0.002 ETH), usdcAmount is in 6-decimal base units (above = 5 USDC). Max per call: 0.02 ETH / 50 USDC. See POST /v1/testing/fund-wallet for full parameter docs. This mints test balances on a test RPC only — no real mainnet or Base tokens are involved.
This quickstart uses test RPC execution paths. POST /v1/testing/fund-wallet balances exist only on managed chain forks and are the expected funding source for this flow. See Test RPCs for details on caps and supported tokens.

Step 4: Discover Vaults

Browse available vaults before committing:
curl -X POST https://api.staging.rhaios.com/v1/yield/discover \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "base",
    "asset": "USDC",
    "strategy": "balanced"
  }'
Expected outcome:
  • Returns a ranked list of vaults with APY, risk, TVL, and Sharpe data
  • Each vault includes a vaultId you can pass to POST /v1/yield/prepare

Step 5: Dry-Run Prepare

Pick a vault from the discovery results and prepare a deposit:
curl -X POST https://api.staging.rhaios.com/v1/yield/prepare \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "deposit",
    "chain": "base",
    "asset": "USDC",
    "amount": "1",
    "agentAddress": "0xYOUR_WALLET_ADDRESS",
    "vaultId": "VAULT_ID_FROM_DISCOVERY"
  }'
Expected outcome:
  • Response includes strategy metadata + setup/execution payload
  • If needsSetup=true, setup transaction details are returned
  • If needsSetup=false, an intentEnvelope is returned for signing
Pricing policy for POST /v1/yield/discover and POST /v1/yield/prepare is $0.01 per call via x402 when payment enforcement is enabled. Current staging deployment keeps x402 disabled. See Payments for details.

Step 6: Sign and Execute

After validating the prepare response, sign the intentEnvelope.signing payload with your agent’s key (EIP-712), then execute:
curl -X POST https://api.staging.rhaios.com/v1/yield/execute \
  -H "Content-Type: application/json" \
  -d '{
    "intentEnvelope": { ... },
    "intentSignature": "0xYOUR_SIGNATURE",
    "intentId": "0xMERKLE_ROOT"
  }'
Expected execute result:
{
  "executionModel": "erc4337-validator-intent-v1",
  "result": "executed",
  "userOpHash": "0x...",
  "txHash": "0x...",
  "chainId": 8453,
  "chain": "base",
  "receipt": {
    "status": "success"
  },
  "explorerUrl": "https://basescan.org/tx/0x..."
}

Step 7: Verify Position

Check positions:
curl "https://api.staging.rhaios.com/v1/yield/status?userAddress=0xYOUR_WALLET_ADDRESS"
Confirm:
  • Position appears under the selected chain
  • Portfolio totals are updated
Check vault history:
curl "https://api.staging.rhaios.com/v1/yield/history?vaultId=42&period=30d"
Optional UI check:
https://staging.rhaios.com/ops

Withdraw from a vault

Call POST /v1/yield/prepare with operation: "redeem" to withdraw from a position:
curl -X POST https://api.staging.rhaios.com/v1/yield/prepare \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "redeem",
    "chain": "base",
    "agentAddress": "0xYOUR_WALLET_ADDRESS",
    "vaultId": "42",
    "percentage": 100
  }'
Then sign and submit the returned intentEnvelope via POST /v1/yield/execute — the same flow as depositing. You can use percentage (0-100) or shares (exact share count), but not both.

Rebalance between vaults

Call POST /v1/yield/prepare with operation: "rebalance" to move funds from one vault to a better one:
curl -X POST https://api.staging.rhaios.com/v1/yield/prepare \
  -H "Content-Type: application/json" \
  -d '{
    "operation": "rebalance",
    "chain": "base",
    "agentAddress": "0xYOUR_WALLET_ADDRESS",
    "vaultId": "42",
    "percentage": 100
  }'
Rebalance atomically redeems from the source vault and deposits into a vault selected by strategy. Sign and execute the same way.

Troubleshooting Quick Reference

ErrorCauseFix
ethWei/usdcAmount exceeds testing capRequest over server policy limitsLower request amount or adjust server caps
needsSetup=true repeatedlySetup tx not finalizedVerify setup tx on explorer, wait for confirmation, retry
Preflight simulation failedTransaction would revert on-chainCheck wallet balance/approvals, re-run POST /v1/yield/prepare
Anvil forks not configuredSetup relay requires a test RPCOperator config issue — contact Rhaios support
AA24 signature validationStale calldata or signer mismatchRe-run POST /v1/yield/prepare, then re-sign
AA21 prefund issueInsufficient gas fundsFund wallet with more ETH on target chain
AA50 postOp revertedPaymaster/relayer path issueRetry once, then inspect relayer/paymaster config
No suitable vaults foundActive vault filters too strictUse strategy: "balanced", remove extra filters
Payment required (HTTP 402)x402 enforcement enabled on deploymentAttach X-PAYMENT header and retry (pre-prod default is not enforced)

What’s next