Skip to main content
Instant Swap allows you to convert supported assets within Wallet-as-a-Service without manually interacting with exchanges, bridges, or onchain swap protocols. Instant Swaps are processed off-chain through the OpenXSwitch liquidity and settlement infrastructure, enabling fast execution, simplified asset conversion, and reduced blockchain complexity. At the time of execution:
  • The source asset balance is debited from the wallet
  • The destination asset balance is credited to the wallet
  • Settlement and liquidity routing are handled internally by OpenXSwitch and its partner network
Trading must be enabled (canTrade=true) for the wallet before swap orders can be created.
Before a wallet can perform Instant Swap operations, trading must first be enabled for the wallet.Trading can be enabled:
  • During wallet/sub-wallet creation
  • During wallet updates
using:
{
  "canTrade": true
}

By default:
{
  "canTrade": false
}

If trading is disabled, Instant Swap requests for the wallet will be rejected.

Enable Trading for Existing Wallets

Trading can also be enabled later for existing:
  • Sub-wallets
  • Prime Wallets
using the wallet trading activation endpoint:POST/wallets/trade/activate

Step 1 - Get Supported Instant Swap Currencies

Retrieve the list of assets supported for Instant Swap operations.

Endpoint

GET/instant-swap/currencies

Example Response

{
  "success": true,
  "data": [
    {
      "coin": "ETH",
      "maxAmount": "5",
      "minAmount": "0.0005"
    }
  ],
  "totalPage": 123,
  "pageNo": 123,
  "pageLimit": 123
}

Step 2 - Get Instant Swap Quote

Request a quote for the asset conversion before creating the swap order.

Endpoint

GET/instant-swap/quote

Query Parameters

ParameterTypeRequiredDescription
fromCoinstringYesSource asset symbol
fromAmountstringYesAmount of source asset
toCoinstringYesDestination asset symbol

Example Request

GET /instant-swap/quote?fromCoin=USDT&fromAmount=100&toCoin=ETH

Example Response

{
  "success": true,
  "data": {
    "fee": "0.0",
    "fromCoin": "USDT",
    "fromAmount": "100",
    "toCoin": "ETH",
    "toAmount": "0.0234",
    "swapPrice": "0.000234"
  }
}

Step 3 - Create Instant Swap Order

Create the Instant Swap order using the quote parameters.

Endpoint

POST/instant-swap

Request Body

{
  "walletId": "wallet_abc123",
  "fromCoin": "USDT",
  "fromAmount": 100,
  "toCoin": "ETH",
  "extId": "swap_ref_001"
}

Request Fields

FieldRequiredDescription
walletIdYesWallet to debit and credit
fromCoinYesSource asset symbol
fromAmountYesAmount to swap
toCoinYesDestination asset symbol
extIdYesClient-provided idempotency identifier
instantSyncNoControls synchronous processing behavior

Successful Response

If the request is accepted successfully, the API returns a 200 OK response with the swap details.
{
  "success": true,
  "data": {
    "id": "swap_abc123",
    "extId": "ext_abc123",
    "fee": "0.0",
    "fromCoin": "USDT",
    "fromAmount": "100",
    "toCoin": "ETH",
    "toAmount": "0.0234",
    "swapPrice": "0.000234",
    "ts": "2025-04-04T12:00:00Z",
    "quoteId": "quote123",
    "walletId": "wallet_001"
  }
}

Webhook Notification

Once the swap is processed successfully:
  • A webhook event is sent to your configured workspace webhook endpoint
  • Wallet balances are updated automatically
  • The updated balance state is included in the webhook payload
Use webhook events as the source of truth for wallet balance synchronization after swap execution.