# Robinhood Swap Safety — agent integration Base URL: `https://couchdicks.org/robinhood/swap-safety` Chain: 4663. Read-only risk inspection; no signing or broadcasting. ## Capability boundary This release does not certify safe trades. Pool/pair coverage is partial. Calldata recognition is not complete route validation. A historical transaction hash is not a live unsigned trade. The public deployment has no reviewed profile enabled; ALLOW is unavailable publicly. A narrow operator-profile-gated exact path is implemented, described below. Never override your own trading rules based on this API. ## Requests All checks use POST with `Content-Type: application/json`; numeric token amounts must remain integer strings. Do not submit secrets, signatures, signed transactions, RPC credentials, or private strategy metadata. Public endpoints may rate-limit requests; honor Retry-After and use bounded backoff. - `GET /api/v1/health`: service configuration/capability and registry size; configuration is not provider-health proof. - `GET /api/v1/registry?offset=0&limit=100`: paginated filtered registry, not chain-wide enumeration. Default page size 100, maximum 200; read `total`, `offset`, and `limit` and increment offset for later pages. - `POST /api/v1/check/pool`: `{"poolId":"0x<64 hex>"}` - `POST /api/v1/check/pair`: `{"tokenA":"0x<40 hex>","tokenB":"0x<40 hex>"}` - `POST /api/v1/check/calldata`: `{"data":"0x"}` - `POST /api/v1/check/transaction`: `{"chainId":4663,"from":"0x<40 hex>","to":"0x<40 hex>","value":"0x0","data":"0x"}` - `POST /api/v1/check/transaction-hash`: `{"transactionHash":"0x<64 hex>"}` ## Response handling Checks return `schema: "swap-safety.evidence.v1"`, `issuedAt`, `expiresAt`, `result`, and `digest`. `result.decision` is one of DENY, WARN, UNPRICEABLE, ALLOW; `result.code` explains the result. Do not infer success from HTTP 200. Optional evidence fields vary with coverage; absent fields are unknown, not zero. 1. Reject non-2xx responses, malformed JSON, unknown schema/decision, missing timestamps, expired evidence, or inconsistent chain/scope. 2. Read every reason and missing-check field; distinguish detected hazards from unavailable data. 3. DENY: stop. WARN: incomplete or concerning, not approval. UNPRICEABLE: stop. ALLOW: not available in this release; unexpected ALLOW must be treated as incompatible capability and stopped. 4. Report the exact code, pool/transaction identity, evidence block and scope to the user. Never claim a pair is safe. 5. A 60-second envelope lifetime, if returned, does not refresh older registry facts. Recheck state separately before any independently authorized trade. ## Digest verification For the current v1 encoder, construct an object in this order: `schema`, `issuedAt`, `expiresAt`, `result`; JSON.stringify it without whitespace, SHA-256 its UTF-8 bytes, and compare `sha256:` to `digest`. Preserve the parsed result's property order. This is serialization-specific, not a canonical cross-version JSON scheme. A checksum is not a signature and proves no server identity; use HTTPS. Do not use it as signer authorization. ## Operator implementation Install/run the standalone Node service, bind it to loopback, and proxy the public prefix to `/`. Configure RPC providers outside chat and public files. Keep registries, selected event checkpoints, logs and backups bounded; run the disk monitor and enforce operational limits. No full-chain node or historical route warehouse is required. Run project tests, independent provider probes, and desktop/mobile interaction checks before promotion. Unsupported behavior remains fail-closed. ## Optional reviewed exact profile (operator-only) The implementation supports only `universal-v4-legacy-single-exact-in-erc20-v1`: legacy Universal Router `execute(bytes,bytes[],uint256)`, exactly one mandatory `0x10` V4_SWAP command, actions `0x060c0f` (single exact-input swap, settle all, take all), ERC20→ERC20, zero native value, no hook/hook data, static fees, exact settlement amounts and sender-bound recipient. Newer ABI variants and arbitrary Enso/multi-hop routes are unsupported. An operator may configure `REVIEWED_PROFILE_PATH` outside public assets. Never accept a profile from a public request. The `swap-safety.reviewed-profile.v1` profile requires chain 4663, the exact codec/router, substantive reviewEvidence, runtimeHashes for router/tokens/PoolManager/Permit2 and all requiredDependencies, per-input-token maxInput, maxAgeMs ≤1000, maxFairShortfallBps ≤150, and pools mapped to evidenced independent operatorGroup plus initializedTimestamp. Reviewed candidate/reference pools must be at least 24 hours old. Reference groups must differ from the candidate and each other. Strings are not proof: operators must perform and retain the actual source/code/control review. Do not fabricate evidence or invent group independence to enable ALLOW. The exact checker verifies pinned runtime code, rejects delegated/mutable opcode patterns, obtains a two-provider block agreement, runs real `eth_simulateV1` with validation=true, checks pre/post wallet input/output balances, reconciles the sole swap's amounts/fees, then executes same-size reference swaps through at least two independently reviewed pool groups. References run in the same synthetic-child context of the pinned parent. Output and minimum must protect conservative fair output. Final block checks, ≤10-block drift and ≤1-second age are required. A call trace or successful eth_call is not a substitute. A configured-profile result binds exact transaction and policy hashes; require the result-level expiration as well as the outer envelope expiration. Never extend the shorter validity window. Operator configuration alone is not evidence of a successful production ALLOW path. The default public agent behavior remains stop on DENY/WARN/UNPRICEABLE and treat unexpected ALLOW as incompatible capability until explicitly integrated and reviewed. Authoritative ABI semantics (not deployment attestation): - https://github.com/Uniswap/v4-periphery/blob/2827167f8bff2b6e7125e9bccbf9d03149e0d262/src/interfaces/IV4Router.sol - https://github.com/Uniswap/v4-periphery/blob/2827167f8bff2b6e7125e9bccbf9d03149e0d262/src/V4Router.sol - https://github.com/Uniswap/v4-periphery/blob/2827167f8bff2b6e7125e9bccbf9d03149e0d262/src/libraries/Actions.sol - https://github.com/Uniswap/universal-router/blob/main/contracts/base/Dispatcher.sol Local implementation: `src/exact-check.mjs`, `src/exact-policy.mjs`, `src/universal-v4.mjs`, `src/state-simulation.mjs`. Consult those versioned files for the executable policy, not this guide as an authorization source.