- 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.Trading/Swap Requirement
Trading/Swap Requirement
Before a wallet can perform Instant Swap operations, trading must first be enabled for the wallet.Trading can be enabled:By default:If trading is disabled, Instant Swap requests for the wallet will be rejected.
- During wallet/sub-wallet creation
- During wallet updates
Enable Trading for Existing Wallets
Trading can also be enabled later for existing:- Sub-wallets
- Prime Wallets
POST/wallets/trade/activateStep 1 - Get Supported Instant Swap Currencies
Retrieve the list of assets supported for Instant Swap operations.Endpoint
GET/instant-swap/currencies
Example Response
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
| Parameter | Type | Required | Description |
|---|---|---|---|
fromCoin | string | Yes | Source asset symbol |
fromAmount | string | Yes | Amount of source asset |
toCoin | string | Yes | Destination asset symbol |
Example Request
Example Response
Step 3 - Create Instant Swap Order
Create the Instant Swap order using the quote parameters.Endpoint
POST/instant-swap
Request Body
Request Fields
| Field | Required | Description |
|---|---|---|
walletId | Yes | Wallet to debit and credit |
fromCoin | Yes | Source asset symbol |
fromAmount | Yes | Amount to swap |
toCoin | Yes | Destination asset symbol |
extId | Yes | Client-provided idempotency identifier |
instantSync | No | Controls synchronous processing behavior |
Successful Response
If the request is accepted successfully, the API returns a200 OK response with the swap details.
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
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=062e79ad9c4540929eec204aff020178)
.png?fit=max&auto=format&n=ML35RDblT1Ol-zJb&q=85&s=f6328956931c9664a2a070c2edb6e9b3)