BETA — mainnet live (chain 482120); features are still being finished. Transparency →
Bitcoin Swap BETA Chain 482120
Developers · Reference

REST API

Every public endpoint: parameters, response fields, caching and examples.

Reference › REST API

Conventions

Base URLhttps://btcw.tech — the same API is served at https://app.btcw.tech
Authenticationno API key required
FormatJSON, UTF-8; GET only. CORS open (Access-Control-Allow-Origin: *) — callable directly from the browser
Token amountsin the quote API (/api/v2/swap/*): integer strings, base units (18 decimals) — never parse them as floats. In the stats endpoints: floats, human units (BTCw, USD)
Time/api/* and the ts, t, expiresAt fields: Unix seconds. The updated field of /api/v2/*: Unix milliseconds
Cachingper the cache-control header listed for each endpoint; polling faster than that returns no new data
Rate limit20 requests/second per IP, shared across /api/*, /api/v2/* and the explorer API — see Limits & error codes
Pricesall USD prices come from on-chain oracles (BtcwPriceFeed, PriceHub)

Prices

GET/api/pricemax-age=5

BTCw price and OracleAMM status. No parameters.

FieldTypeDescription
price_usdnumberoracle BTC/USD price × peg ratio
bid_usd / ask_usdnumberactual OracleAMM buy / sell price for BTCw (spread included)
spread_pctnumberspread per side, % (0.3)
updated_at, age_seconds, max_age_secondsnumberwhen the price was written, price age, staleness threshold (300)
stale, paused, tradableboolprice is stale; OracleAMM is paused; orders can be filled (not stale, not paused, liquidity available)
liquidityobjectbtcw, usdw held in OracleAMM; max_trade_btcw
oracleobjectround, answer_btc_usd, decimals, address, sources
contractsobjectamm, usdw, feed addresses
usdw_total_supply, blocknumberUSDw total supply; block at read time
curl -s https://btcw.tech/api/price
GET/api/tokensmax-age=5

BTCw and USDw in a compact wallet format: symbol, name, address (null for native BTCw), native, decimals, price_usd, logo. The 200 price-tracker tokens are at /api/v2/swap/assets.

GET/api/v2/poolsmax-age=5

The 201 ClpPools pools. Returns { updated, pools: [...] }.

FieldDescription
address, symbol, name, logothe pool's token (logo is a path relative to btcw.tech)
classcrypto · stock (US equities) · stable (USDw)
oracleUsd / poolUsd / devBpsoracle price, pool price, deviation (bps, positive = pool is more expensive)
depthBtcw / depthAssetpool depth on each side
tvlUsd, vol24hUsd, fees24hUsd, swaps24h, feeTvlPct24hstats, valued at the oracle price at indexing time; includes Treasury trades
priceAgeSage of the token's oracle price, seconds

Swap

GET/api/v2/swap/assetsmax-age=30

The 202 swappable assets: { chainId, updated, assets: [{ address, native, symbol, name, decimals, logoURI, priceUsd, poolDepthBtcw }] }. Native BTCw has address = 0xEeee…EEeE and native: true.

GET/api/v2/swap/quoteno-store

Quote + prebuilt transaction. Full guide and example response: Wallet swap integration.

ParameterDescription
from, torequiredtoken address or native
amountrequiredinteger, base units
senderwhen set, returns tx, approval and simulates the transaction
recipientreceiver; if different from sender, only the ClpPools route remains
slippage_bps1001–5000 → minAmountOut
routebestbest · clp · amm (BTCw ⇄ USDw) · amm-eth (ETHw ⇄ USDw) · router (multi-hop through SwapRouter in one transaction)

Status codes: 200 quote returned · 400 invalid input ({ error }) · 422 no route can fill the order (routes[].error still included) · 502 RPC read error.

Stats

GET/api/v2/statsmax-age=5

Chain-wide figures used by the Dashboard: block, validators, btcw_usd, tvl_usd (split into tvl_clp_usd / tvl_oracleamm_usd), volume_24h, swaps_24h, fees_24h_usd, total_swaps, wallets, oracle_assets_fresh (e.g. "100/100"), network, status (per-component health), treasury_addresses.

Volume includes of_which_treasury… fields — the share traded by the Treasury wallets (treasury_addresses) to keep pool prices close to the oracle.

GET/api/v2/history?hours=48max-age=5

Hourly series, hours up to 720. Each entry: t (start of hour), volClp, volAmm, volTreasury, swaps, swapsTreasury, fees (USD).

GET/api/v2/swaps?limit=50max-age=5

Latest swaps (limit up to 300) and the 10 largest swaps in 24 hours: { latest, top24h }. Each swap: venue, from, to, amountIn, amountOut, usd, fee, trader, treasury (bool), block, tx, ts.

Health

GET/api/healthmax-age=5

Price API: { ok, block, age_seconds }.

GET/api/v2/healthmax-age=5

Indexer: { ok, lastBlock, builtAgoS }. Returns 503 until indexing has finished (after a restart) — as do all other /api/v2/* endpoints.

Static files

PathContents
/developers/contracts.jsonaddresses + ABIs of all contracts, chain info, API description · CORS open
/chain.jsonnetwork info, ethereum-lists format
/swap/sdk/btcw-swap.jsSDK — can be imported directly from any domain (CORS open) · see JavaScript SDK
/logo.svg, /logo.png, /usdw.pngBTCw, USDw logos

The explorer has its own API (Blockscout): https://explorer.btcw.tech/api/v2/… — see the Blockscout docs.