GuidesRecipesAPI ReferenceChangelog
Guides

Cross-Chain Stablecoin Swaps

How do I swap stablecoins between chains?

Overview

Swap stablecoins from one chain to another by creating a trade between the two assets. Supported pairs:

  • USDC_SOL-USDC
  • USDC_NPL-USDC
  • USDC_STE-USDC
  • USDC_SOL-USDC_NPL
  • USDC_STE-USDC_NPL
  • USDC_STE-USDC_SOL
ℹ️

Feature enablement required

Contact support to enable this feature on your bank. Cybrid needs to set up a fee account for the counter asset of your swap pair.

Example: Swap USDC on Polygon for USDC on Ethereum

This example uses the USDC_NPL-USDC trading symbol.

Step 1: Create trading accounts

Ensure the customer has both USDC_NPL and USDC trading accounts. If not, create them via POST /api/accounts:

{
  "type": "trading",
  "asset": "USDC_NPL",
  "name": "Customer USDC_NPL Trading",
  "customer_guid": "customer_guid"
}
{
  "type": "trading",
  "asset": "USDC",
  "name": "Customer USDC Trading",
  "customer_guid": "customer_guid"
}
⚠️

Required assets and trading symbol

The USDC_NPL and USDC assets, plus the USDC_NPL-USDC trading symbol, must be enabled on your bank before creating these accounts.

Step 2: Create a swap quote

Create the quote via POST /api/quotes:

{
  "product_type": "trading",
  "customer_guid": "customer_guid",
  "symbol": "USDC_NPL-USDC",
  "side": "buy",
  "deliver_amount": 1000000
}
ℹ️

deliver_amount vs receive_amount

deliver_amount fixes what you send; fees come out of what the recipient gets. receive_amount fixes what the recipient gets; you pay fees on top. See Create and execute a trade for the canonical explanation.

Step 3: Execute the trade

Execute the trade via POST /api/trades using the quote guid from Step 2:

{
  "trade_type": "platform",
  "quote_guid": "quote_guid"
}

Poll GET /api/trades/{trade_guid} to monitor the trade state. See Create and execute a trade for the full trade lifecycle.

Fees

Trade fees are collected in the counter asset of the swap pair. For example, a USDC_SOL-USDC_NPL swap collects fees in USDC_NPL. The aggregated fee appears in the fee field on the quote response, denominated in counter-asset base units.

See Trade fees for fee math.