Token Swap

Create a swap request to exchange one cryptocurrency for another within the same chain or across chains.

post/v2/wallets/swaps

Request

  • Base URL
    https://production.hifibridge.com
  • URL
    https://production.hifibridge.com/v2/wallets/swaps
  • Auth
    HTTP bearer

Request body

requestIdstring uuid required

Unique identifier for the swap request (recommend using uuid v4)

limitPricestring

Optional positive limit price, expressed as destination-currency units per one source-currency unit. Supported only for direct USDT/USDC swaps in either direction and limited to four decimal places. Omit to use market pricing.

cancelAfterSecondsinteger

Optional number of seconds after creating the swap when execution should be cancelled if it has not already started. Supported only for direct USDT/USDC swaps in either direction. Omit to disable automatic cancellation.

Example request

{
  "requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
  "limitPrice": "0.9990",
  "cancelAfterSeconds": 3600,
  "source": {
    "userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
    "chain": "POLYGON",
    "currency": "usdt",
    "amount": "10000"
  },
  "destination": {
    "userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
    "externalWalletId": "64fc4e9d-4839-4384-b4a0-0376af2c9b2e",
    "walletAddress": "0xE9cfBf1D690565579D823264170eE357f80e9A34",
    "chain": "POLYGON",
    "currency": "usdc",
    "amount": "10000"
  }
}

Response

Success

transferTypestring

Example response

{
  "transferType": "WALLET.SWAP",
  "transferDetails": {
    "id": "dc923cc1-d74b-58f6-9fe4-9e9c6eb8dc37",
    "requestId": "1ab3e6e0-4839-4dbe-89c3-b06d9645ae86",
    "status": "COMPLETED",
    "createdAt": "2025-08-20T03:55:29.437108+00:00",
    "updatedAt": "2025-08-20T04:08:10.837+00:00",
    "source": {
      "currency": "usdc",
      "amount": 10,
      "userId": "05179f69-1988-4b46-a847-dd4eea0984d6"
    },
    "destination": {
      "currency": "usdt",
      "userId": "05179f69-1988-4b46-a847-dd4eea0984d6",
      "chain": "POLYGON",
      "walletAddress": "0xe5727a4B1d93A26D6A7Adfaae145EFa41ED7f204"
    },
    "cancellable": true,
    "autoCancelAt": "2026-07-13T02:00:00.000Z",
    "quoteInformation": {
      "sendGross": {
        "amount": "10",
        "currency": "usdc"
      },
      "sendNet": {
        "amount": "10",
        "currency": "usdc"
      },
      "receiveGross": {
        "amount": "10",
        "currency": "usdc"
      },
      "receiveNet": {
        "amount": "10",
        "currency": "usdc"
      },
      "rate": "1",
      "limitPrice": "0.9990",
      "expiresAt": "2025-08-20T03:55:59.539+00:00"
    }
  }
}

Changes

    • warning

      added the new CANCELLED enum value to the / response property for the response status

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property / to the response with the status

    • info

      added the optional property // to the response with the status