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 321 price-tracker tokens are at /api/v2/swap/assets.

GET/api/v2/poolsmax-age=5

The 322 ClpPools pools (BTCw hub). 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 323 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) · usdclp (UsdClpPools: USDw ⇄ token in one hop, token ⇄ token through USDw)

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.

GET/api/v2/usd-poolsmax-age=5

The 321 UsdClpPools pools (USDw hub, R-61). Same fields as /api/v2/pools, with depthUsd in place of depthBtcw, plus hub ("USDw") and contract (the UsdClpPools address). A token has one row here and one in /api/v2/pools: tell them apart by contract, not by token address.

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

Swaps on UsdClpPools, in the same shape as /api/v2/swaps (venue is "usdclp"), plus contract.

Market

GET/api/v2/market?window=1h|24hmax-age=30

One row per asset, merging its BTCw-hub and USDw-hub pools — the data behind btcw.tech/market. Sorted by price, high to low.

  • priceUsd, change1hPct, change24hPct — PriceHub oracle; change is null when no sample about 1 h / 24 h old exists.
  • depthUsd { btcwHub, usdwHub, total } and depthTokens — what both pools hold.
  • user { trades, buys, sells, volumeUsd } — trades by wallets outside the Treasury list (treasury_addresses in /api/v2/stats) in the window. A buy is BTCw or USDw in, the asset out.
  • keeper { trades, volumeUsd } — Treasury keeper wallets; never included in user.
  • reference — see below; null when the asset has no listed market or the data is older than 5 minutes.
  • totals — sums of user and keeper; totals.user.volumeUsd (24h) equals volume_24h.total_usd − of_which_treasury_usd in /api/v2/stats.
GET/api/v2/market/reference?asset=<address|symbol>max-age=30

Market data of the same asset elsewhere, with its source — one primary market per asset: Binance spot (<BASE>USDT), Binance USD-M futures, or a Hyperliquid perpetual (HIP-3 dex for stocks and ETFs). Refreshed every 30 s; values older than 5 minutes are not served. Without asset it returns every asset.

{ "symbol": "NVDAw", "class": "stock",
  "reference": { "source": "hyperliquid", "market": "xyz:NVDA", "volume24hUsd": 52276848.48, "change24hPct": 1.77,
                 "high24h": null, "low24h": null, "lastPrice": 239.45, "updatedAt": 1791262289 },
  "onchain": { "volume24hUsd": 32739799.67, "userVolume24hUsd": 0, "trades24h": 40, "userTrades24h": 0 } }

Show reference.volume24hUsd with its source (for example "Vol 24h · Hyperliquid"); it is not trading on chain 482120 — that is onchain.

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.