Coinbase Exchange sandbox venue
The engine's Venue trait over the Coinbase Exchange sandbox REST API, with test funds only.
Sandbox only
The client can reach one host: the Coinbase Exchange sandbox, over HTTPS with no redirects. Production is not built. Sandbox balances are test funds with no value.
Status
Built and tested against a scripted server built from real sandbox responses (public endpoints, captured 2026-11-11) and the published API reference for private responses. Public calls (server time, top of book) have run against the sandbox. No order has been sent: that needs a sandbox API key and an approval for each order.
Signing
Each private request carries the key id, the passphrase, a timestamp and a signature: base64 of HMAC-SHA256 over timestamp, method, request path and body, keyed with the decoded secret. The signature is checked against an independent HMAC implementation. The key file has three lines, lives outside any repository and is never printed; no error message contains key material.
Orders
- Limit orders, GTC or IOC. Market orders, including released stop-market orders, are sent as IOC limits capped 1% through the last quote; with no quote they are rejected.
- Every order carries a fresh random client order id. If the submit outcome is unknown (timeout, server error), the venue looks the order up by that id instead of sending it again. An order never found after 10 polls is reported rejected, with a log line saying to check open orders.
- A refusal from the venue (for example insufficient funds) is reported as a rejection with the venue's message.
Fills
- Fills come only from the venue's fill list for the order. Each trade id is reported once, even if it is seen in several polls.
- An order is finished only when the venue says it is done and every filled unit has been reported. If the fill list lags behind the order status, the venue waits for the next poll.
- Fees are quoted to 16 decimals; they are rounded up to the engine's commission precision.
- Coinbase forgets a canceled or expired order that had no fills; the venue reports that as canceled.
No lost state
A failed request leaves every order and every cancel request as it was, and is retried on the next poll. A cancel is sent again until the venue shows the order done.
Restart
reconcile_report reads the product's open orders. Each becomes an engine order for its remaining size, named CB-<venue id>, and fills made before the restart are not reported again. Adoption is all or nothing. See Reconciliation after restart.
Command line
fth-coinbase time fth-coinbase book <product> fth-coinbase accounts <keyfile> fth-coinbase open <keyfile> <product> fth-coinbase order <keyfile> <buy|sell> product=<p> size=<n> limit=<price> [--yes] fth-coinbase cancel <keyfile> product=<p> id=<venue order id> [--yes]
The one rule
order and cancel sign and send only with --yes. Without it they print the exact request and exit 2 before any network call; a test runs them with the network cut off.
Official reference
Coinbase publishes the Exchange REST API reference and the sandbox address in its developer documentation. This page describes the engine's adapter; it does not restate Coinbase's documentation.