Stablecoin Swap

How do I swap a stablecoin to anotherone?

Overview

Swapping stablecoins from one to another requires creating a trade between the two assets. Currently, these are stablecoin pairs that you can swap:

  • USDC_SOL-USDC
  • USDC_NPL-USDC
  • USDC_STE-USDC
  • USDC_SOL-USDC_NPL
  • USDC_STE-USDC_NPL
  • USDC_STE-USDC_SOL

📘

Please reach out to support to enable this feature on your bank, as we need to set up your "Fee" account for the specified USDC asset.

Use Case Examples

One example is exchanging USDC on the Polygon chain for USDC on the Ethereum chain (which are among the two most commonly used stablecoins on the Cybrid platform) by using the trading symbol USDC_NPL-USDC.

Step 1: Make sure that the customer has both USDC_NPL and USDC trading accounts, and if they don't, you can create them:

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"
  ]
}

🚧

Please note that before the step above, the trading symbols of USDC_NPL, USDC and USDC_NPL-USD need to be enabled on your bank configuration.

Step 2: Create the swap trade:

Post /api/quotes

{
  "product_type": "trading",
  "customer_guid": "customer_guid",
  "symbol": "USDC_SOL-USDC",
  "side": "buy",
  "deliver_amount": 1000000 // equivalent of 1.00 USD
}

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, for USDC_SOL-USDC_NPL swap, the fee will be collected in USDC_NPL fee account. Please note that a 10 bps Cybrid trading fee will be applied to the swaps, in addition to the fee that you would like to collect.