GuidesRecipesAPI ReferenceChangelog
Guides

Stablecoin Swap

Swap stablecoins between chains using the Cybrid trading API.

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 specified USDC asset.

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": "string",
  "customer_guid": "<customer_guid>",
  "labels": [
    "string"
  ]
}
{
  "type": "trading",
  "asset": "USDC",
  "name": "string",
  "customer_guid": "<customer_guid>",
  "labels": [
    "string"
  ]
}
⚠️

Required trading symbols

The trading symbols USDC_NPL, USDC, and USDC_NPL-USD must be enabled on your bank configuration before creating these accounts.

Step 2: Create a swap quote

POST /api/quotes

{
  "product_type": "trading",
  "customer_guid": "customer_guid",
  "symbol": "USDC_SOL-USDC",
  "side": "buy",
  "deliver_amount": 1000000
}

Step 3: Execute the trade

POST /api/trades

{
  "trade_type": "platform",
  "quote_guid": "<quote_guid>",
  "labels": [
    "string"
  ]
}

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.

A 10 bps Cybrid trading fee applies to all swaps, in addition to any partner-configured fees.