# THORChain Swap API Quickstart

Fetch a live cross-chain swap quote from THORChain Swap (https://swap.thorchain.org) in one request — no account, no API key, no registration.

## 1. Call the MCP server

The public MCP server at https://swap.thorchain.org/mcp speaks JSON-RPC 2.0 over HTTP POST. Every tool is read-only.

```bash
curl -s https://swap.thorchain.org/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "get_swap_quote",
      "arguments": {
        "from_asset": "BTC.BTC",
        "to_asset": "ETH.ETH",
        "amount": "100000000"
      }
    }
  }'
```

## 2. Read the quote

- `expected_amount_out` — estimated output after fees, in 1e8 base units.
- `fees` — itemised inbound gas, outbound, liquidity, and any affiliate fee.
- `slippage_bps` — price impact in basis points.
- `recommended_min_amount_in` — below this, fees dominate the swap.
- `memo` and `inbound_address` — only present when you pass a `destination` address, and only valid until `expiry`.

## 3. Hand the user a prefilled swap link

```
https://swap.thorchain.org/sell-BTC-buy-ETH
https://swap.thorchain.org/sell-BTC.BTC-buy-ETH.USDC
```

The user completes and signs the swap themselves, in their own wallet or through the wallet-free memoless flow. THORChain Swap holds no keys and submits nothing on a user's behalf.

## Conventions

- Assets use `CHAIN.SYMBOL` notation: `BTC.BTC`, `ETH.ETH`, `ETH.USDC-0XA0B86991C6218B36C1D19D4A2E9EB0CE3606EB48`.
- Amounts are strings in 1e8 base units regardless of the asset's native decimals: `"100000000"` = 1 BTC = 1 ETH = 1 RUNE.
- Quotes are indicative and expire; re-fetch before showing one to a user.

## Next steps

- [MCP server reference](https://swap.thorchain.org/developers/mcp) — every tool and its parameters
- [REST API reference](https://swap.thorchain.org/developers/api) — the support endpoints and error format
- [Authentication](https://swap.thorchain.org/developers/auth) — anonymous access and optional client registration
- [SDKs](https://swap.thorchain.org/developers/sdks) — TypeScript, Python, and Go clients
- [Developer portal](https://swap.thorchain.org/developers) — the full index
