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

Swap mechanics

THORChain-style CLP pools, oracle-priced AMMs and how pool prices are pulled back to the oracle.

Concepts › Swap mechanics

There are two execution venues. The Swap page, the quote API and the SDK query both and pick the one that gives the user more.

ClpPools — 201 THORChain-style pools

Each pool pairs one asset (USDw, a crypto price-tracker token or a stock price-tracker token) with BTCw. It uses THORChain's CLP (continuous liquidity pool) formula:

y = x · X · Y / (x + X)²

x : amount in     X : input-side depth
y : amount out    Y : output-side depth

The difference from the mid price x · Y / X is the slip fee: the larger the trade relative to pool depth, the higher the fee. The minimum fee minFeeBps is 5 bps (0.05%) — every trade pays at least this, however small. Fees stay in the pool.

OracleAMM — BTCw ⇄ USDw at the oracle price

No curve: trades fill at the BTC/USD oracle price ± spreadBps.

sell BTCw : USDw out = x · p · (1 − spread)
buy BTCw  : BTCw out = u / p · (1 − spread)
ParameterCurrentMeaning
spreadBps30 (0.3%)fixed spread in each direction
maxTradeBtcw10 BTCwmaximum per trade (in BTCw terms)
maxAgeSec300 secondsrejects trades when the oracle price is older (StalePrice)

OracleAMM only pays the sender. To pay another wallet, use the ClpPools route. OracleAMM liquidity is deposited and withdrawn by the Owner.

ETHw oracle-priced vault

Address 0xFd6d78A3b60175D37146793396A2FA7864039D54 (OracleTokenAMM). Works like OracleAMM but for ETHw ⇄ USDw, priced at the PriceHub price of ETHw ± spreadBps:

ParameterCurrentMeaning
spreadBps30 (0.3%)fixed spread in each direction
maxTradeToken300 ETHwmaximum per trade
maxAgeSec300 secondsrejects trades when the price is older (StalePrice)

The vault was seeded by the Owner with 12,280 ETHw + 33,100,000 USDw. buyToken / sellToken take a to parameter — you can pay out directly to another wallet. The Bridge page uses this vault when the user chooses to receive or send ETHw.

Route selection

For the BTCw ⇄ USDw pair, the quote queries both the CLP pool and OracleAMM and picks the larger output (route=best). You can force one venue with route=clp or route=amm. All other pairs use ClpPools only.

How pool prices are pulled back to the oracle

Price-tracker tokens have no external market, so pool prices would drift away from the oracle if nothing pulled them back. Two mechanisms do that:

Stock pools outside market hours

Outside US regular trading hours and on weekends, the oracle holds the closing price, and the Rebalancer keeps pools near that price. Stock pools remain tradable 24/7; when BTC moves, the BTCw-denominated price of stock pools drifts too and is pulled back just like crypto pools. At market open, if the opening price is far from the close, the keeper moves the pool gradually (at most 5 BTCw per trade). A price update that moves more than 10% is blocked by the oracle — that symbol stays frozen until the Owner confirms the new price (ownerSubmit).

What this means for integrators: pool prices usually sit within a few dozen bps of the oracle price. The volume of these two wallets is reported separately on the Dashboard and in /api/v2/stats (of_which_treasury).

Providing liquidity

Pool liquidity is currently provided by the Owner. These docs do not cover third-party liquidity provision.