https://xlayer.ottoai.services
Chain: X Layer Mainnet (Chain ID: 196)
Payment: Micro-payments on X Layer via the OKX Facilitator — pay service fees in USDT0, USDG, or USDC (see GET /tokens for the full token registry).
Listed on OKX: Otto X is reachable from OKX’s Onchain OS at okx.ai/agents/2118.
Discovery:
- Landing Page — interactive endpoint explorer
- LLM Docs — machine-readable for AI agents
- Discovery Doc — x402 discovery document
- GitHub — open source
How It Differs from x402.ottoai.services
Both deployments serve the same underlying agent intelligence. Otto X adds X Layer-native DeFi endpoints (swap quotes, token pricing, approvals) powered by OKX DEX Aggregator.
OKX Onchain OS Usage
Pricing Overview
X Layer DEX Endpoints
Market Intelligence
Data & Global Intelligence
Always-warm global data reads ported to X Layer (prices mirror the Base sibling). Each is a single worker-refreshed aggregate — no query params — that fail-closes (uncharged) rather than serve a cold read.Equity Intelligence (ticker-parameterized, $0.003)
Write-through pay-per-call reads for licensed equity data (vendor-resolved tickers; no market-coverage claim) — each requires?ticker=SYMBOL (e.g. ?ticker=AAPL). The OKX exact rail verifies payment before the handler runs and cancels settlement on any ≥ 400 response, so an unknown or failed ticker is uncharged.
Composed Recipes
Multi-source intelligence in a single paid call — each recipe fans out to several upstream legs and returns one composed artifact. A recipe refuses (unpaid) if its core leg returns no usable data; best-effort legs that can’t resolve are named as unavailable rather than fabricated. Browse the live catalog atGET /api/recipes (free) or the storefront at GET /recipes.
GET /mega-report ($0.05, listed under Market Intelligence) is a composed briefing on the same pattern.
AI Tools
Trading Resources
Read-only data sourced directly from Otto X’s own libs — Zerion for portfolios, vaults.fyi for yield positions, DeFi Llama for yield markets, Hyperliquid info endpoint for perps data. Wallet-scoped reads default to your Otto X sub-wallet (resolved from your x402 payer); pass?address=0x... to query any other EVM address.
Agentic Wallet V2 — Autonomous DeFi Execution
Otto X provisions a TEE-custodied sub-wallet for each x402 payer and executes swaps, bridges, and DeFi deposits on their behalf — all signed inside OKX’s TEE, no user-side key management.Yield Watch
Allowlisted protocols:
All four protocols × every chain in the table are reachable: each of those chains is in the gas-top-up + execution registry. (Lido is ETH staking on Ethereum, not a stablecoin venue.)
principalAuth launch chains (USDC EIP-3009): Base, Arbitrum, Optimism, Ethereum, Polygon. Plus X Layer (USDT0). Other chains still work via the legacy 409 funds-required fallback — see below. On Ethereum, ops are declined during a base-fee spike (above ~25 gwei) rather than subsidizing it.
Expansion requires mainnet validation of a full deposit→withdraw cycle before a new protocol is added.
Yield Copilot — POST /yield-copilot
One call deploys your idle stablecoin capital into yield:
- What it does: reads your Otto X sub-wallet’s idle balance of the requested stablecoin, picks the lending venue — the highest current APY among the Otto-allowlisted lending protocols (Aave V3, Compound V3, Morpho) for that stablecoin on that chain, sourced from vaults.fyi (Base / Arbitrum / Optimism / Ethereum) with the DeFi Llama yields API as fallback (the
apy_sourcefield in the response says which was used) — and supplies it via the same path/auto-defi-investuses. Accepted stablecoins are those in the allowlist for that chain (USDC, USDT, USDT0, USDG, USDC.e, DAI as applicable). Omitamountto deploy the entire idle balance; supplyprincipalAuthto fund the sub-wallet in the same call —principalAuthfunding currently supports USDC on Base/Arbitrum/Optimism/Ethereum/Polygon and USDT0 on X Layer, and itsvaluemust equal the deposit amount exactly. - Scope: Base, Arbitrum, Optimism, Ethereum, X Layer. (X Layer has no public APY feed yet, so on X Layer the response reports the venue with
apy: nulland points you toGET /yield-farming-activefor the live rate. On Ethereum, the call is declined during a base-fee spike — above ~25 gwei — rather than subsidizing it.) If a stablecoin has several allowlisted venues on a chain and the APY feed is unavailable, Otto returns503 APY_DATA_UNAVAILABLErather than guessing — pick the venue yourself via/auto-defi-invest. - The response is the artifact:
before(idle amount, 0% APY) →after(venue, APY, illustrative annualized + monthly yield at the current rate) →economics($0.05 Otto fee, APY delta) →custody(your payer-bound sub-wallet, withdraw endpoints) →selection(why this venue, APY source, TVL, pool id) →tx_hashes→ anot_investment_advicedisclaimer. - What Otto provides: automation + transparency + non-custody + a $0.05 fee — not “earning power” or guaranteed returns. APYs float; deployed capital carries smart-contract, liquidity, and market risk. Otto never pools or rehypothecates user funds; withdraw the position anytime via
POST /auto-defi-withdraw, or sweep the whole sub-wallet viaPOST /auto-withdraw.
Yield Watch — POST /yield-watch (notify) / POST /yield-watch (auto) / DELETE /yield-watch / GET /yield-watch / GET /yield-watch/audit
Tier 3 of the yield ladder: instead of polling /yield-farming-active yourself, register once and let Otto watch your positions and either notify you via Telegram when there’s a better venue, or auto-rebalance under a 30-day signed delegation.
Two modes — the same endpoint, the body distinguishes:
Notify mode (no on-chain delegation, no spending limits — Otto just sends a Telegram receipt when a sustained APY gap opens, including the copy-pasteable two-call switch):
maxMoves over 30 days and maxPrincipalRaw per move, every move audited + receipted to Telegram):
YieldDelegation message over a fixed domain (OttoXYieldWatch v1 — a pure off-chain authority bound to the wallet, sub-wallet, and nonce). For the full domain, typed-data structure, and a copy-paste signTypedData recipe (plus the RevokeYieldDelegation flow), see the Otto X repo.
Server verifies the signature with viem’s recoverTypedDataAddress and binds it to the registered wallet. The delegation is atomically claimed via a single-statement CAS on next_nonce — concurrent registrations from the same wallet can’t replay each other, and a revocation always bumps the nonce so a stale signed message can’t replay after revoke. Auto-mode revocation signs RevokeYieldDelegation with the current nonce; notify mode just sends a DELETE (chat-id ownership is the auth).
Guardrails (auto mode):
- Allowlist: Aave V3 and Compound V3 only for v1. Morpho is rejected at registration (vault-address coupling lands in v1.1).
- TVL floor + APY staleness: an alt protocol must have ≥ $10M TVL and an APY data point ≤ 2h old before it can win a move.
- Hysteresis state machine: the alt must beat the current venue by
hysteresisPctBpssustained forhysteresisHoursstraight (the worker tracks per-position observations; a regression resets the window). - Throttle: at most one move per position per
throttleHourswindow (default 72h) — bounds gas + Otto-fee spend. maxMoves: a hard cap over the 30-day delegation window. After the cap, the worker refuses further moves on that wallet.maxPrincipalRaw: a per-move notional cap in raw token units (e.g."5000000"= $5 USDC at 6 decimals)."0"= no cap. Cap is bound to the LIVE position size at lock time, so a mid-window top-up over the cap is refused.- Pre-broadcast resolver guards: both the current and the best-alt market must resolve cleanly via OKX, and must point at the SAME canonical token address (no
USDC → USDC.erouting, no surprise asset substitution). Refusals at this stage never pay the audit cost. - Post-broadcast verification: every leg (withdraw + invest) is followed by
assertReceiptsConfirmed— a hard check that the broadcast tx hash actually landed on-chain. Defends against the OKX silent-drop bug pattern ({ok:true, txHash}returned but the relayer’s simulate reverted and dropped the broadcast). - Per-phase failure receipts: if any leg fails, the Telegram receipt names the specific phase (
withdraw/verification_withdraw/invest/verification_invest) and a recovery CLI tailored to where the funds are (still in the old protocol vs idle in your sub-wallet). - Synthetic ledger close-out: a successful auto-move writes
(auto_defi_withdraw, yield_copilot)rows to yourotto_x_opsledger so the next tick sees the OLD protocol closed + NEW open, and/yield-farming-historicaltreats the move as a realized round-trip for the closed deposit.
/auto-defi-withdraw + /yield-copilot calls Otto runs internally — same as a user-initiated rebalance).
Launch posture: Tier 3 launches Base USDC Aave ↔ Compound V3 first, with Morpho-on-Base and multi-chain (Arbitrum / Optimism / Ethereum / X Layer) auto support landing in v1.1 once each chain has soaked a manual deposit + withdraw cycle on mainnet.
Yield status & receipts — GET /yield-farming-active, GET /yield-farming-historical
GET /yield-farming-activelists your active yield positions and, for each Otto-allowlisted lending position (Aave V3 / Compound V3 / Morpho stablecoin lending on Base / Arbitrum / Optimism / Ethereum / X Layer), adds a rebalance picture:current_apy_pctvs.best_alternative(the highest-rated allowlisted protocol for that stable on that chain — the APY is a protocol-level figure, since OKX picks the actual deposit market; it is never “the best vault is X”),apy_delta_pts,projected_annual_uplift_usd, and arecommendationofrebalanceorholdwith a plain-Englishwhy. Arebalanceis suggested only when the gap clears both a minimum APY-delta and a minimum projected $/yr bar and you’ve held the position past a cooldown — it won’t nag you to chase rate noise. When you read your own sub-wallet, arebalancerecommendation includes the two-call switch:POST /auto-defi-withdraw {protocol, chain, token, ratio:"1"}thenPOST /yield-copilot {chain, token}(Otto re-picks the best venue at execution time, and the redeemed funds redeploy in full). The response also carries ayield_summary(total deployed, weighted-avg APY, projected annual yield, rebalances recommended).- A rebalance is informational — the new rate is not locked, switching protocols carries smart-contract/migration risk, you pay 2 × $0.05 in Otto fees (Otto absorbs the on-chain gas), and if the redeploy leg fails your funds simply sit idle in your own sub-wallet (re-call
POST /yield-copilot). Not investment advice. GET /yield-farming-historicalis the receipt: your full yield-optimeline(deposits via/auto-defi-invest&/yield-copilot+ redemptions via/auto-defi-withdraw) with the exact , # closed round-trips with a realized figure) alongside the exact total Otto fees. For current rates useGET /yield-farming-active.
Custody Model (Important)
Otto X’s Agentic Wallet is TEE-custodial, not self-custodial:- Keys are generated and held inside OKX’s Trusted Execution Environment (TEE). Otto AI holds an API credential that authorizes signing; neither Otto nor OKX staff can export the underlying key.
- Users do not control their sub-wallet directly. There is no seed phrase to back up, no MetaMask connection, no co-signer role.
- This trades away the confirm-and-withdraw control of Otto AI’s Safe-based Trade Execution Agent — where you sign funding and withdrawals while an Otto-managed key signs execution — in exchange for fully autonomous execution (no user signing, no gas management, atomic operations).
POST /auto-withdrawis the escape hatch: users can sweep any token balance to any external address at any time. No approvals, no holds.- Otto runs an hourly GC that flags inactive empty sub-wallets to prevent capacity squat.
Aligned with Agent Payments Protocol §8.4
This split — funded wallet off the per-action signing path, hot key in the TEE for autonomous execution — is exactly the architecture OKX’s Agent Payments Protocol whitepaper (§8.4 Separating signing from custody) describes for production agent commerce. Otto X has been running this design on mainnet since March 2026, ahead of the protocol’s public release. Once the APP wire-format spec is published, Otto X sub-wallets are a drop-in Buyer-Agent runtime forcharge, session, and upto intents.
One-Call Flow via EIP-3009 principalAuth (recommended)
Recent clients collapse the old two-step funds-required dance into a single HTTP call by including a signed EIP-3009 TransferWithAuthorization note in the request body. The server verifies it, pulls your USDC (or USDT0 on X Layer) directly into your sub-wallet on-chain, then executes the op — all in one response.
Client-side recipe:
-
One-time preview —
GET /sub-wallet/preview?address=0xYOUR_WALLET(free). Cachesub_wallet.evm_addressindefinitely; it’s deterministic per payer. (The unsuffixedGET /sub-walletis the paid $0.01 resolve-or-provision route and will answer a free call with a 402.) -
Sign two things — your wallet signs:
- The x402 service fee (standard paywall, $0.05 USDT0 on X Layer → Otto treasury).
- An EIP-3009
TransferWithAuthorizationnote authorizing your USDC on the target chain to flow into your sub-wallet. Modern wallets (MetaMask, Coinbase Wallet, Rabby, Phantom) can batch both into one confirmation screen.
-
POST the op — include
principalAuthin the body:
PAYMENT-SIGNATURE.
Server guarantees, verified before touching the chain:
principalAuth.fromMUST equal your x402 payer (no impersonation).principalAuth.toMUST equal your provisioned sub-wallet (no draining to attacker addresses).principalAuth.valueMUST be ≥ the op’s required amount.validBeforeMUST be in the future;nonceMUST be unseen (replay-safe via a per-signer-per-token-per-nonce DB claim + on-chainauthorizationStatecheck).
token.transferWithAuthorization(...) (operator pays gas, user funds move straight from their wallet to their sub-wallet — no intermediate custody), tops up the sub-wallet with dust native gas if needed, executes the op, and returns 200 with all tx hashes.
Legacy Flow — HTTP 409 funds_required (fallback)
Clients that can’t sign EIP-3009 notes, or that target chains we haven’t enabled yet, fall back to the two-step flow. POST /auto-* without a principalAuth and with an insufficient sub-wallet balance returns:
Free Endpoints
x402 Payment Flow (OKX)
The flow is the same as our Base deployment, but settlement happens on X Layer via OKX Facilitator instead of CDP Facilitator.Token Registry
Otto X maintains a curated registry of 16 X Layer tokens, available for free atGET /tokens.
The paid
GET /all-tokens endpoint returns the full X Layer token list from the OKX DEX Aggregator (the complete set of DEX-tradeable tokens on chain 196 — currently ~20, and it tracks OKX’s live registry).
Quick Start
The yield ladder, end to end
All three tiers are live today:- Tier 1 — one-call deploy:
POST /yield-copilotdeploys idle stablecoins into the highest-APY allowlisted lending venue in a single call. - Tier 2 — read side:
GET /yield-farming-activereturns rebalance recommendations, andGET /yield-farming-historicalis the op receipt, including exact realized yield/APY per closed round-trip. - Tier 3 — monitoring:
POST /yield-watchregisters opt-in notify-only alerts, or a 30-day signed EIP-712 delegation for autonomous Aave↔Compound rebalances with hard guardrails (TVL floor, APY staleness, hysteresis, minimum-hold, per-position throttle, signedmaxMoves/maxPrincipalRawcaps, post-broadcast verification, and per-phase failure receipts).
