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

> ## Agent Instructions
> Soroswap Aggregator API: base URL https://api.soroswap.finance, pick the network with ?network=mainnet or ?network=testnet (omitted means mainnet).
> Auth: Authorization: Bearer sk_... on every call. Get a key at https://console.soroswap.finance/register. A missing or invalid key returns 401 with code and registerUrl (POST /send returns 403 instead); an expired JWT or a missing role returns 403. Free plan 1 request/s; see https://docs.soroswap.finance/api/plans.md.
> Flow: POST /quote (assetIn, assetOut as C... contract addresses, amount as an integer string in the smallest unit, tradeType, protocols) -> POST /quote/build with the unchanged quote and from -> the user signs the XDR -> POST /send. Build right after quoting: a Soroban XDR is valid for 180 seconds. Submit it as is, never re-simulate it.
> Partner id: every account has one (9 hex chars, permanent). Read partnerId from GET /partner, or in the console at https://console.soroswap.finance under Fees & payouts. The partner fee itself is switched on by Soroswap; see https://docs.soroswap.finance/api/fees.md.
> AI tools: docs MCP at https://docs.soroswap.finance/mcp (claude mcp add --transport http soroswap-docs https://docs.soroswap.finance/mcp), skill with npx skills add https://docs.soroswap.finance. Other clients: https://docs.soroswap.finance/api/build-with-ai.md.
> Units and Stellar pitfalls: https://docs.soroswap.finance/api/stellar-gotchas.md. Errors and retries: https://docs.soroswap.finance/api/errors.md.

# Bridge USDC and USDT

> Mainnet only. USDC over Circle CCTP V2 and USDT over USDT0 between Stellar, Solana and EVM chains: GET /bridge/routes, POST /bridge/quote, POST /bridge/build returns unsigned steps per chain, GET /bridge/status, and POST /bridge/claim/build to finish USDC into Stellar. Amounts in the chain's smallest units.

The Soroswap API moves stablecoins into and out of Stellar, so your users can arrive with funds
from another chain and leave with them. Two assets are supported:

* **USDC** over [Circle CCTP V2](https://developers.circle.com/cctp): USDC is burned on the source
  chain and Circle mints the same amount on the destination.
* **USDT** over [USDT0](https://docs.usdt0.to), the LayerZero OFT. On Stellar it arrives as the
  `USDT0` asset.

The API quotes the transfer, checks that the recipient can receive it, and builds the unsigned
transactions for the source chain. It never signs, never holds funds and never submits anything:
your user signs every step with their own wallet.

> [!NOTE]
>
> The bridge is **mainnet only**. `network=testnet` returns `400` `bridge is mainnet only`.

## The flow

1. `GET /bridge/routes` lists the chains and which source can reach which destination.
2. `POST /bridge/quote` prices a transfer and checks the recipient.
3. `POST /bridge/build` re-quotes and returns the steps to sign on the source chain.
4. The user signs and sends each step, in order.
5. `GET /bridge/status` follows the transfer until it is `complete`.
6. USDC into Stellar only: `POST /bridge/claim/build` returns the Stellar transaction that mints
   the USDC to the recipient.

Every route needs your API key, like the rest of the API. See [Quickstart](https://docs.soroswap.finance/api/quickstart.md).

## Routes

```bash theme={null}
curl "https://api.soroswap.finance/bridge/routes?network=mainnet" \
  -H "Authorization: Bearer $SOROSWAP_API_KEY"
```

The response has one entry per asset. Each chain has an `id` (the value you pass as
`sourceChain` or `destinationChain`), its `kind` (`stellar`, `evm` or `solana`), the token address,
its `decimals`, and `fastSource`, whether USDC can leave it with a Fast Transfer. `routes` lists,
for each source, the destinations it reaches. Read the chain list from this route instead of
hardcoding it: chains get added.

## Quote

```bash theme={null}
curl -X POST "https://api.soroswap.finance/bridge/quote?network=mainnet" \
  -H "Authorization: Bearer $SOROSWAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "asset": "USDC",
    "sourceChain": "base",
    "destinationChain": "stellar",
    "amount": "10000000",
    "tradeType": "EXACT_IN",
    "recipient": "G..."
  }'
```

| Field | Required | Meaning |
| - | - | - |
| `asset` | Yes | `USDC` or `USDT`. |
| `sourceChain`, `destinationChain` | Yes | Chain ids from `/bridge/routes`. |
| `amount` | Yes | Positive integer string in the token's smallest units: of the source for `EXACT_IN`, of the destination for `EXACT_OUT`. |
| `tradeType` | Yes | `EXACT_IN` (send this much) or `EXACT_OUT` (receive this much). |
| `speed` | No | USDC only. `standard` (default) or `fast`. Fast falls back to standard when the source has no Fast Transfer. |
| `sender` | No | The source-chain address that will sign. On Stellar it must be a `G...` account. |
| `recipient` | No | The destination-chain address. With it, the quote checks that the recipient can receive. |

> [!WARNING]
>
> Decimals differ by chain. Stellar tokens have **7** decimals and every other chain's USDC and USDT
> have **6**. 10 USDC is `"10000000"` on Base and `"100000000"` on Stellar.

A successful quote returns `201`:

```json theme={null}
{
  "asset": "USDC",
  "sourceChain": "base",
  "destinationChain": "stellar",
  "tradeType": "EXACT_IN",
  "speed": "standard",
  "amount": "10000000",
  "amountIn": "10000000",
  "amountOut": "100000000",
  "decimalsIn": 6,
  "decimalsOut": 7,
  "maxFee": "0",
  "fees": [
    { "type": "cctp_protocol", "amount": "0", "token": "USDC", "decimals": 6, "bps": 0 }
  ],
  "limits": { "minAmountIn": "1" },
  "recipient": { "checked": true, "ready": true },
  "claimRequired": true,
  "expiresAt": "2026-12-01T08:08:48.184Z"
}
```

* `amountIn` is what leaves the sender, in source units. `amountOut` is the **guaranteed minimum**
  the recipient gets, in destination units. For USDC that is `amountIn` minus `maxFee`, the most
  Circle can keep.
* `fees` lists what the transfer pays:
  * `cctp_protocol`: Circle's fee, in `bps`. It is `0` for a standard transfer and charged on Fast
    Transfers.
  * `cctp_forward`: Circle's Forwarding Service fee, when Circle mints on the destination for the
    user (every USDC route except into Stellar).
  * `oft_protocol`: the USDT0 fee.
  * `layerzero_messaging`: the LayerZero fee in the source chain's native token (ETH, XLM...),
    marked `paidSeparately: true`. It is not taken from the amount: the user pays it as gas.
* `recipient.ready` is `false` when the recipient can't receive yet, with a `reason`. A Stellar
  `G...` account needs a trustline to the asset. Without a `recipient`, `checked` is `false`.
* `claimRequired: true` means the transfer ends with a claim on Stellar (USDC into Stellar).
* `limits.minAmountIn` is the smallest amount that covers the fees. A smaller amount returns `400`
  `Amount too small`.
* `expiresAt` is 30 seconds out. `/bridge/build` quotes again anyway.

Show the user `amountOut` and the fees before they sign.

## Build

Send the quote back unchanged, with the addresses that will sign and receive:

```bash theme={null}
curl -X POST "https://api.soroswap.finance/bridge/build?network=mainnet" \
  -H "Authorization: Bearer $SOROSWAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "quote": { ...the quote... }, "sender": "0x...", "recipient": "G..." }'
```

The response is `{ quote, steps }`. `quote` is the fresh quote the steps were built from. If the
route now delivers less (`EXACT_IN`) or costs more (`EXACT_OUT`) than the quote you posted, the
build returns `409` `Quote stale`: quote again and show the user the new numbers.

`steps` are in order. Each one has a `kind` (`reset_approval`, `approval`, `bridge` or `claim`),
the `chain` it runs on, a human `description` and a `status`:

* `ready`: sign and send `tx` now.
* `rebuild_after_previous`: no `tx` yet. Once the previous step has landed, call `/bridge/build`
  again to get it.

Every step must land before the next one is sent.

### Signing each kind of transaction

`tx.format` tells you how to sign it.

> [tab] EVM
>
> `{ format: "evm", chainId, to, data, value }`. Send it from the sender's wallet on `chainId`,
> as is. `value` is in wei: `"0"` for USDC, the LayerZero fee for USDT.
>
> ```ts theme={null}
> const hash = await walletClient.sendTransaction({
>   to: tx.to,
>   data: tx.data,
>   value: BigInt(tx.value),
> })
> ```
>
> All EVM steps come back `ready` together: an `approval` for exactly the amount when the
> allowance is short, then the `bridge`. USDT on Ethereum may add a `reset_approval` first,
> because that token requires the allowance to go to zero before it changes. The API does not
> check balances; the wallet's own estimate does.

> [tab] Stellar
>
> `{ format: "stellar_xdr", xdr }`. The XDR is already simulated and assembled, with the sender
> as source. Sign it with the wallet and submit it to the network.
>
> USDC from Stellar can take two steps: Circle's contract pulls the USDC with an allowance, and
> a Stellar transaction holds only one contract call. When the allowance is short you get an
> `approval` (`ready`) and a `bridge` (`rebuild_after_previous`). Submit the approval, then call
> `/bridge/build` again for the burn. The approval is valid for 500 ledgers, about 40 minutes,
> and an allowance that already covers the amount skips it.
>
> A sender without a trustline to the asset gets `428` `CREATE_TRUSTLINE` with an unsigned
> trustline transaction in `actionData.xdr`, the same as on [`/quote/build`](https://docs.soroswap.finance/api/errors).

> [tab] Solana
>
> `{ format: "solana_v0", serialized, additionalSigners, recentBlockhash, lastValidBlockHeight }`.
> One v0 transaction, USDC only.
>
> It needs two signatures: the user's wallet and a throwaway key in `additionalSigners`
> (`role: "messageSentEventData"`), which only signs the creation of Circle's event account and
> controls nothing afterwards. **Sign with the wallet first**, then add the throwaway signature
> to the transaction the wallet returned, then send it. Wallets can change the transaction while
> signing, so a signature added before the wallet's would be invalid.
>
> The transaction expires at `lastValidBlockHeight`, about a minute. Build again for a fresh
> one.

## Status

Pass the hash of the `bridge` step's transaction:

```bash theme={null}
curl "https://api.soroswap.finance/bridge/status?network=mainnet&asset=USDC&sourceChain=base&txHash=0x..." \
  -H "Authorization: Bearer $SOROSWAP_API_KEY"
```

`phase` is one of:

| Phase | Meaning |
| - | - |
| `burned` | The source transaction is sent, but Circle or LayerZero hasn't picked it up yet. An unknown hash also reads `burned`. |
| `attesting` | Waiting for the source chain's finality and the attestation. |
| `forwarding` | Attested; the mint on the destination is on its way. |
| `claimable` | USDC into Stellar: ready to claim. `claim.available` says whether a claim sent now would succeed. |
| `complete` | Delivered. `destinationTxHash` carries the mint, when known. |
| `failed` | The destination reported a failure; `detail` says why. |

Poll every few seconds. How long a transfer takes depends on the source chain's finality: see
Circle's [block confirmation times](https://developers.circle.com/cctp/concepts/finality-and-block-confirmations).

## Claim (USDC into Stellar)

USDC into Stellar is minted by a Stellar transaction that someone has to submit. When the status is
`claimable`, build it:

```bash theme={null}
curl -X POST "https://api.soroswap.finance/bridge/claim/build?network=mainnet" \
  -H "Authorization: Bearer $SOROSWAP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "sourceChain": "base", "txHash": "0x...", "from": "G..." }'
```

The response is `{ steps }` with one `ready` step of kind `claim` and a `stellar_xdr` transaction.
`from` is any Stellar `G...` account. It only pays the transaction fee: the USDC always goes to the
recipient fixed at the burn. So your own account can claim for the user, and the user never needs
XLM for it.

* `425` `Not attested yet`: Circle hasn't attested the burn. Retry once the status is `claimable`.
* `409` `Already claimed`: it is done. Nothing to retry.

## Rules worth knowing

* **Recipients on Stellar.** USDC goes to a `G...` account with a USDC trustline, a `C...`
  contract or an `M...` address. USDT goes to a `G...` account with a `USDT0` trustline only. A
  recipient that can't receive returns `400` `Recipient not ready` at build.
* **Recipients on Solana.** Use the wallet address, never a token account. A wallet with no USDC
  token account yet is fine: Circle creates it and the quote's fee includes that.
* **EVM addresses** must have a valid EIP-55 checksum, or be all lowercase. A mistyped
  mixed-case address returns `400` before anything is burned.
* **Stellar amounts** have 7 decimals and CCTP has 6. A 7th decimal is rounded down before the
  burn, and `amountIn` shows the rounded value.
* **Solana senders** need a USDC token account (`400` `Sender not ready` otherwise) and enough SOL
  for the fee and Circle's event account rent. The sender can reclaim that rent from Circle later.

## Errors

| Status | When | Do |
| - | - | - |
| 400 | `bridge is mainnet only` | Send `network=mainnet`. |
| 400 | `Amount too small` | Send at least `limits.minAmountIn`. |
| 400 | `Recipient not ready` | The recipient needs a trustline or a valid wallet address; see `detail`. |
| 400 | `Sender not ready` | The Solana sender has no USDC token account. |
| 401 | No or invalid API key | See [Errors](https://docs.soroswap.finance/api/errors.md). |
| 409 | `Quote stale` | Quote again and show the new amounts. |
| 409 | `Already claimed` | The claim is done. |
| 425 | `Not attested yet` | Retry the claim once the status is `claimable`. |
| 428 | `CREATE_TRUSTLINE` | The Stellar sender signs and submits `actionData.xdr`, then build again. |
| 503 | An upstream (Circle, LayerZero, a chain RPC) is down | Retry with backoff. |

Every route and field is in the [API Reference](https://docs.soroswap.finance/api-reference/bridge/quote.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.