> ## Documentation Index
> Fetch the complete documentation index at: https://docs.usexfg.org/llms.txt
> Use this file to discover all available pages before exploring further.

# How swapXFG atomic swaps work

> Trustless cross-chain swaps via SwapDaemon — no escrow custodian.

**swapXFG** is Fuego’s cross-chain atomic swap stack (`SwapDaemon` / suite binaries). A swap either **completes** for both sides or **refunds** — no custodial middleman.

## Guarantee

* **Complete**: both parties receive agreed assets
* **Refund**: both recover originals after timelock

No partial “exchange keeps your funds.”

## Mechanism

Fuego uses **adaptor signatures** (and chain-specific clients) rather than only classical HTLCs on every chain. High-level flow:

1. Parties exchange adaptor / setup data
2. Each locks or prepares chain-specific spend paths
3. Completion reveals the secret material needed for the other leg
4. Timeout → refund path

State is persisted by the swap daemon so restarts resume non-terminal swaps.

## Protocol swap fee (live)

| Constant            | Value                                        |
| ------------------- | -------------------------------------------- |
| `SWAP_FEE_RATE_BPS` | **100** = **1%** of XFG swap amount per side |

Charged **twice** per completed swap: **1% on initiation + 1% on claim = 2% total** (Alice and Bob each pay 1%). Initiated from the SwapXFG TUI or the DeXFG tab in the Fuego-Wallet GUI.

### Fee split (not 100% to CDs)

| Share       | %      | Destination                   |
| ----------- | ------ | ----------------------------- |
| CD yield    | **69** | `SWAP_FEE_CD_SHARE_PCT`       |
| Bonus Vault | **11** | `SWAP_FEE_BONUS_VAULT_PCT`    |
| Treasury    | **20** | `SWAP_FEE_TREASURY_SHARE_PCT` |

Counterparty chains charge only their own network/miner fees on top.

## vs Hearth

|        | Hearth                                           | swapXFG                                |
| ------ | ------------------------------------------------ | -------------------------------------- |
| Domain | On-chain XFG↔HEAT                                | Cross-chain XFG↔BTC/ETH/…              |
| Fee    | 1% Hearth (100% → CD yield; LPs earn the spread) | **2%** atomic swap (1% + 1%, 69/11/20) |

These are the **only two protocol earnings streams**. Mint premium is 0 bps (goes nowhere); the 0.1% CD creation fee is a donation to @fuegoxfg, not protocol revenue.

## Timeouts

If a counterparty stalls, wait for timelock then refund (`refund` / RPC). Watchdog logs are warnings only — you initiate refunds.

## Related

* [Supported pairs](/features/atomic-swaps/supported-pairs)
* [Fees and timeouts](/features/atomic-swaps/fees-and-timeouts)
* [Step-by-step](/features/atomic-swaps/step-by-step-guide)
