FX

Estimate FX swap

Creates a swap estimation with deposit address for Circle FX stablecoin swap

post/api/v1/fx/estimate

Request

  • Base URL
    https://api-baas.wirexapp.com
  • URL
    https://api-baas.wirexapp.com/api/v1/fx/estimate
  • Auth
    • API key in header Authorization
    • or API key in header X-Chain-Id and API key in header X-User-Wallet and API key in header Authorization

Request body */*

correlation_idstring

CorrelationId is an optional client-provided identifier for tracking the request

destination_asset_addressstring required

DestinationAssetAddress is the contract address of the token to receive (e.g., EURC)

destination_asset_amountstring

DestinationAssetAmount is the desired amount of destination token (mutually exclusive with source_asset_amount)

source_asset_addressstring required

SourceAssetAddress is the contract address of the token to swap from (e.g., USDC)

source_asset_amountstring

SourceAssetAmount is the amount of source token to swap (mutually exclusive with destination_asset_amount)

Example request

{
  "correlation_id": "550e8400-e29b-41d4-a716-446655440000",
  "destination_asset_address": "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
  "destination_asset_amount": "95.25",
  "source_asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "source_asset_amount": "100.50"
}

Response

OK

deposit_addressstring required

Deprecated: still populated for backward compatibility, but consumers should read destination_address — this field carries the address where source tokens must be sent, which is now exposed as destination_address.

destination_addressstring required

DestinationAddress is the address where the client should send the source tokens. Preferred field; deposit_address mirrors the same value for backward compatibility.

destination_asset_addressstring required

DestinationAssetAddress is the contract address of the token to be received

destination_asset_amountstring required

DestinationAssetAmount is the amount of destination token to be received (in decimal format)

estimation_idstring required

EstimationId is the unique identifier for this estimation, used when executing the swap

expiration_timestring required

ExpirationTime is the RFC3339 timestamp after which this estimation expires

source_asset_addressstring required

SourceAssetAddress is the contract address of the token being swapped from

source_asset_amountstring required

SourceAssetAmount is the amount of source token to be swapped (in decimal format)

trade_ratestring required

TradeRate is the exchange rate applied to the swap

Example response

{
  "deposit_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "destination_address": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "destination_asset_address": "0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",
  "destination_asset_amount": "95.25",
  "estimation_id": "550e8400-e29b-41d4-a716-446655440000",
  "expiration_time": "2024-01-15T10:30:00Z",
  "source_asset_address": "0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",
  "source_asset_amount": "100.50",
  "trade_rate": "0.9525"
}

Changes

No recorded changes to this operation across all 2 revisions of this API.