Coinbase Advanced Trade: OpenAPI 3.1, OAuth MCP gates and read-only scope boundaries
Public OpenAPI 3.1.0, OAuth 2.0/RFC 9728 discovery, static sandbox GET, and view-only protocol-boundary analysis of Coinbase Advanced Trade Spot and Coinbase MCP; full authenticated trading REA and live execution remain out of scope.
- ES256 view-only / OAuth MCP
- Preview + cursor/decimal quirks
- Spot vs derivatives/wallet fence
Investigation question
What do Coinbase's public Advanced Trade OpenAPI 3.1.0 specification, RFC 9728/8414 OAuth metadata for remote MCP, static sandbox GET endpoints, and read-only view-scope boundaries establish about pagination, decimal precision, order previews, and client allowlisting?
Observed
Cookie-free inspection of Coinbase Developer documentation, the 45-path Advanced Trade OpenAPI 3.1.0 spec (advanced-trade-spec.yaml), RFC 9728/8414 OAuth discovery at agents.coinbase.com and login.coinbase.com, 11 unauthenticated static sandbox GET probes (api-sandbox.coinbase.com/api/v3/brokerage), and a shape-only view-scope protocol check reveals five sharp structural boundaries. First, auth and scope asymmetry: CDP API keys require ECDSA ES256 per-request 2-minute JWTs (Ed25519 is unsupported), and POST /orders/preview plus POST /orders/edit_preview require only read-only view scope on CDP API keys yet require write-equivalent wallet:buys:create under OAuth 2.0. Meanwhile, remote MCP (https://agents.coinbase.com/mcp) advertises 5 read and 5 write mcp:* scopes and RFC 8414 DCR/CIMD metadata (S256 PKCE), but enforces an approved client allowlist of 10 harnesses rather than unrestricted self-service DCR. Second, OpenAPI and sandbox schema hazards: OrderPreviewRequest lists commission_rate in required while omitting it from properties (accepting omitted commission_rate on the wire); GET /accounts returns string decimals whereas /portfolios/{uuid} models balances and unrealized_pnl as JSON floats; GET /orders/historical/batch defaults order_placement_source to RETAIL_ADVANCED (omitting RETAIL_SIMPLE unless requested); and GET /orders/historical/fills returns cursor pagination with no has_next boolean, 9-digit nanosecond timestamps in sandbox fixtures, and non-unique trade_id values on adjusted fills (requiring deduplication on entry_id). Third, mixed platforms and sandbox gaps: a single portfolio's /accounts list mixes ACCOUNT_PLATFORM_CONSUMER spot accounts with ACCOUNT_PLATFORM_CFM_CONSUMER futures accounts, while static sandbox returns HTTP 404 on /portfolios/{uuid} and disjoint portfolio/order IDs across endpoints.
Inferred
Four clean-room engineering lessons apply to read-only brokerage adapters and agent controls: (1) fail closed on GET /key_permissions (verifying can_view=true, can_trade=false, can_transfer=false) and separate view-only REST cost modeling (POST /orders/preview + GET /transaction_summary) from any order-placement credential; (2) write minimal hand-authored HTTP request builders rather than strict OpenAPI-generated validators because of the OrderPreviewRequest commission_rate spec mismatch, and parse all monetary values as fixed-point decimals while deduplicating fills on entry_id; (3) paginate /orders/historical/fills until empty cursor without relying on has_next, query both RETAIL_ADVANCED and RETAIL_SIMPLE placement sources, and filter accounts explicitly on ACCOUNT_PLATFORM_CONSUMER; and (4) distinguish server-side circuit breakers (Coinbase Agent Controls max trade size, 24-hour volume, and drawdown caps) and ChatGPT-exclusive confirmation cards from true per-trade approval gates in external CLIs or custom MCP clients.
Unknown & limitations
Full authenticated trading REA, live order placement, order edits/cancellations, transfers, derivatives, equities, x402 paid data flows, and browser/CDP captures are explicitly out of scope and unverified. This entry covers only public documentation, OpenAPI 3.1.0 schemas, OAuth discovery metadata, unauthenticated api-sandbox.coinbase.com GET responses, and shape-only read-only view-scope protocol behavior; zero private account identifiers, portfolio UUIDs, balances, holdings, or execution credentials were retained or inspected.
Architecture
Coinbase separates retail Advanced Trade Spot (api.coinbase.com/api/v3/brokerage, ACCOUNT_PLATFORM_CONSUMER) from institutional Coinbase Exchange/Prime, Wallet MCP (wallet-mcp.coinbase.com onchain signing), Global Derivatives JSON-RPC (drb.coinbase.com/api/v2), and retired INTX perpetuals. Agent surfaces split across allowlisted remote MCP (agents.coinbase.com/mcp via login.coinbase.com OAuth2), local @coinbase/coinbase-cli (stdio MCP + --dry-run), ChatGPT Official Plugin confirmation cards, and server-side Agent Controls circuit breakers.
Domain & data models
OpenAPI 3.1.0 models Accounts (ACCOUNT_TYPE_CRYPTO/FIAT/VAULT/PERP_FUTURES, ACCOUNT_PLATFORM_CONSUMER vs CFM_CONSUMER, string available_balance/hold), Portfolios (DEFAULT, CONSUMER, INTX; flagging both USD and USDC as is_cash=true), Orders (10 OrderExecutionStatus states, 11 OrderType values including BRACKET/TWAP/SCALED, 5 OrderPlacementSource values defaulting to RETAIL_ADVANCED), Fills (unique entry_id vs non-unique trade_id on REVERSAL/CORRECTION/SYNTHETIC, up to 16-decimal commissions, RFC 3339 millisecond/microsecond/nanosecond timestamps), and OrderPreview (preview_id with no documented TTL or price lock).
Workflows & state machines
Read-only cost-modeling and reconciliation workflows separate cleanly from execution: (1) startup calls GET /key_permissions to enforce view-only key bounds; (2) pre-trade modeling calls POST /orders/preview (omitting missing commission_rate property) paired with GET /transaction_summary fee tiers and GET /best_bid_ask; (3) historical sync loops cursor pagination across /accounts (limit up to 250), /orders/historical/batch (explicitly querying RETAIL_ADVANCED and RETAIL_SIMPLE), and /orders/historical/fills (terminating on empty cursor because has_next is absent); and (4) authenticated trading execution workflows remain out of scope.
API & protocol surfaces
45-path OpenAPI 3.1.0 REST specification at https://api.coinbase.com/api/v3/brokerage (plus unauthenticated mock mirror at https://api-sandbox.coinbase.com/api/v3/brokerage where /portfolios/{uuid} returns 404), authenticated via ES256 2-minute CDP JWTs or OAuth2 wallet:* scopes; Remote Streamable HTTP MCP at https://agents.coinbase.com/mcp advertising 10 mcp:* scopes via RFC 9728 and RFC 8414 S256 PKCE discovery; and local @coinbase/coinbase-cli stdio MCP mode.