Skip to main content

Create On-chain FX

Initiate an on-chain FX transaction to convert between stablecoins or transfer stablecoins across different blockchains. This endpoint handles direct stablecoin-to-stablecoin conversion without fiat intermediaries.

Endpoint

POST /v1/onchain-fx

Request Headers

HeaderRequiredDescription
X-API-KeyYesYour API key
Content-TypeYesapplication/json
Idempotency-KeyNoUnique identifier for idempotent retries

Request

curl -X POST https://api.thiqwave.com/v1/onchain-fx \
  -H "X-API-Key: your_api_key" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: unique_request_id" \
  -d '{
    "quote_id": "quote_3333333333",
    "source_currency": "USDT",
    "source_network": "ethereum",
    "source_address": "0x123456789abcdef123456789abcdef1234567890",
    "destination_currency": "USDC",
    "destination_network": "polygon",
    "destination_address": "0xabcdef123456789abcdef123456789abcdef1234",
    "amount": "1000.00"
  }'

Request Body

FieldTypeRequiredDescription
quote_idstringYesQuote ID from a prior quote request. Locks in conversion rates.
source_currencystringYesStablecoin: USDT or USDC.
source_networkstringYesSource blockchain network: ethereum, base, polygon, tron, stellar, solana, xrpl, sui, hedera.
source_addressstringYesWallet address to debit stablecoins from.
destination_currencystringYesStablecoin: USDT or USDC.
destination_networkstringYesDestination blockchain network.
destination_addressstringYesWallet address to deliver stablecoins to.
amountstringYesAmount in human-readable format (e.g., "1000.00").

Response

{
  "fx_id": "fx_1234567890",
  "quote_id": "quote_3333333333",
  "status": "pending",
  "source_currency": "USDT",
  "source_network": "ethereum",
  "source_address": "0x123456789abcdef123456789abcdef1234567890",
  "source_amount": "1000.00",
  "destination_currency": "USDC",
  "destination_network": "polygon",
  "destination_address": "0xabcdef123456789abcdef123456789abcdef1234",
  "destination_amount": "999.50",
  "exchange_rate": "0.9995",
  "fees": {
    "platform_fee": "0.50",
    "network_fee": "0.00"
  },
  "created_at": "2026-04-09T14:30:00Z",
  "completed_at": null
}

Response Fields

FieldTypeDescription
fx_idstringUnique on-chain FX transaction identifier.
quote_idstringAssociated quote ID.
statusstringCurrent status: pending, processing, completed, failed.
source_currencystringSource stablecoin.
source_networkstringSource blockchain network.
source_addressstringSource wallet address.
source_amountstringAmount in source currency (human-readable).
destination_currencystringDestination stablecoin.
destination_networkstringDestination blockchain network.
destination_addressstringDestination wallet address.
destination_amountstringAmount in destination currency (human-readable).
exchange_ratestringConversion rate (destination per source).
feesobjectPlatform and network fees breakdown.
created_atstringISO 8601 timestamp of creation.
completed_atstring | nullISO 8601 timestamp of completion.

On-chain FX States

StatusDescription
pendingFX transaction initiated.
processingConversion and transfer in progress.
completedStablecoins converted and delivered to destination.
failedFX transaction failed. Check details for reason.

Notes

  • Ensure the quote is not expired before creating an FX transaction.
  • Source and destination addresses must be valid wallet addresses on their respective blockchains.
  • Network fees vary by source and destination blockchain.
  • Monitor FX status via the Get On-chain FX endpoint or webhooks.