Instant Swap Event

OpenXSwitch - Webhook Instant Swap Event

This webhook is fired when an instant swap has been create and completed successfully.

  • Parent Method: instant_swap
  • Sub-Methods:
    • completed: Triggered when the internal transfer is successfully processed.

Example Payload for Instant Swap:

{
  "requestId": "ab67d4be56d4d549f59b92a17fd71b",
  "method": "instant_swap.completed",
  "params": {
    "id": "68180c09b19304fc881991c2",
    "fee": 0,
    "fromCoin": "USDT",
    "fromAmount": 2,
    "toCoin": "TRX",
    "toAmount": 7.55102795,
    "swapPrice": 3.77551398,
    "status": "success",
    "ts": "1746918883356",
    "quoteId": "1305237885725507584",
    "walletId": "6812c4977de20fb535e5bdee",
    "workspaceId": "656abf1e4b5f5e0012345678",
    "createdAt": "2025-05-04T23:58:20.494Z",
    "wallet": {
      "id": "6812b103908d2d0d49c7ff79",
      "clientUserId": null,
      "email": "email@openxswitch.com",
      "name": "openxswitch-subwallet",
      "assets":[ 
          {
            "coin": "USDT",
            "balance": 9,
            "frozen": 0,
            "updatedAt": "2025-05-04T23:58:20.494Z"
          },
          {
            "coin": "TRX",
            "balance": 26.043,
            "frozen": 0,
            "updatedAt": "2025-05-04T23:58:20.494Z"
          }
      ],
      "isSubWallet": false
    }
  }
}

Reference

FieldDescriptionType
requestIdUnique identifier for the webhook eventstring
methodName of the webhook methodstring
params.feeSwap fee charged for the transactionnumber
params.fromCoinThe coin swapped from (input coin)string
params.fromAmountThe amount of fromCoin used in the swapnumber
params.toCoinThe coin swapped to (output coin)string
params.toAmountThe amount of toCoin received from the swapnumber
params.swapPriceEffective price of the swap (toAmount / fromAmount)number
params.tsTimestamp of the swap event (likely in milliseconds since epoch)string (or number)
params.quoteIdUnique identifier for the swap quote usedstring
params.walletIdID of the wallet involved in the transactionstring
params.workspaceIdID of the associated workspace or organizationstring
params.createdAtTimestamp when the transfer was createdstring (ISO datetime)
params.wallet.idWallet ID (redundant with walletId, likely the master wallet ID)string
params.wallet.clientUserIdOptional external user identifier for the walletstring or null
params.wallet.emailEmail address associated with the walletstring
params.wallet.nameDisplay name of the walletstring
params.wallet.assetsList of assets and their balances after the swaparray of objects
params.wallet.assets[].coinCoin symbol (e.g., USDT, TRX)string
params.wallet.assets[].balanceBalance of the coin after the swapnumber
params.wallet.assets[].frozenFrozen amount of the coin (if any)number
params.wallet.assets[].updatedAtLast update time of the asset balancestring (ISO datetime)
params.wallet.isSubWalletWhether the wallet is a subwalletboolean