
In a nutshell
Blockradar’s Swap API lets you exchange assets on the same chain (swap) or move assets between different chains (bridge) using a single unified endpoint.
Blockradar’s Swap API lets you exchange assets on the same chain (swap) or move assets between different chains (bridge) using a single unified endpoint.
Prerequisites
Before using the Swap API, ensure you have:1
API Key
Get your API key from the Blockradar Dashboard. Navigate to Developers to generate one.
2
Wallet Created
Create a wallet in the dashboard (see Create a Master Wallet). You’ll need the
walletId for swap operations.3
Asset IDs
Get the
assetId for your source and destination assets from Assets in the dashboard or via the Get Assets API.4
Sufficient Balance
Ensure your wallet has enough balance of the source asset to cover the swap amount plus network fees.
How It Works
Blockradar automatically determines whether your transaction is a swap or a bridge based on your asset selection:Swap
Exchange different assets on the same blockchain.Example: USDC → USDT on Base
Bridge
Move assets between different blockchains.Example: USDC on BSC → USDC on Optimism
Supported Assets & Chains
The Swap API supports major stablecoins across Blockradar-supported chains:See Integrations for the complete list of supported networks and stablecoins.
Master Wallet vs Child Address
The Swap API is available at two levels:Master Wallet
Execute swaps directly from your master wallet. Ideal for treasury operations.
Child Address
Execute swaps from individual child addresses. Perfect for user-specific operations.
Endpoints
Step 1: Get a Quote
Always fetch a quote before executing a swap to show users the expected outcome.Request Parameters
Use
amountSide: "source" when the user enters how much they want to spend. Use amountSide: "target" when the user enters how much they want to receive and you need Blockradar to resolve the required source amount.Stellar recipient routing
recipientRouting is supported only when the destination chain is Stellar. It is a generic routing contract shared by every quote and execute endpoint in this guide. Existing EVM, Solana, and Tron requests are non-breaking and unchanged: they must not send recipientRouting; requests that supply it are rejected. The same applies to Bitcoin payouts.
recipientAddress remains an optional string; do not send it as an object. Do not send a separate recipient memo field.
Stellar destination rules
- Muxed
M...recipient: omitrecipientRouting. The routing ID is embedded in the muxed address, and supplying routing data is rejected. - Base
G...recipient with a routing ID: send{ type: "memo_id", value: "123" }.valuemust be a non-empty numeric string from0through18446744073709551615. Blockradar normalizes the address toM...before requesting quote or execution. - Base
G...recipient without a routing ID: send{ type: "none" }and do not includevalue. AG...recipient withoutrecipientRoutingis rejected. The destination base account must have a Stellar USDC trustline before quote or execution. - Default Blockradar Stellar wallet: explicitly send
{ type: "none" }inrecipientRouting.
Request examples
All examples use the same body shape on each of these endpoints:POST /v1/wallets/{walletId}/swaps/quotePOST /v1/wallets/{walletId}/swaps/executePOST /v1/wallets/{walletId}/addresses/{addressId}/swaps/quotePOST /v1/wallets/{walletId}/addresses/{addressId}/swaps/execute
Non-Stellar destination — no routing field
Stellar G... without a routing ID
Stellar G... with a routing ID
Stellar M... recipient — no routing field
Default Blockradar Stellar wallet
Migrating from Stellar-only fields
Stellar as a source
You can swap or bridge from a Stellar asset in your wallet to an asset on another supported chain, for example Stellar USDC to Base USDC. Use the same quote and execute endpoints, with the Stellar wallet asset asfromAssetId.
- Mainnet only. In Test Mode, a quote returns
Swap is not supported on testnet. - Not to Solana or Tempo. A swap from Stellar to Solana or Tempo is not
supported and returns
Stellar swap route is unavailable(400).
Quote Example
Quote Response
data.recipientRouting can instead report that the routing ID is embedded in the normalized destination address:
data.recipientRouting is optional and is returned by quote responses only. Do not expect it in execute responses.
Understanding Quote Fields
Step 2: Execute the Swap
Once the user confirms the quote, execute the swap.Request Parameters
Execute Example
Execute Response
Order Types
Choose the right order type based on your use case:Webhook Events
Monitor swap completion through webhooks:Webhook Payload
Bitcoin Payouts
Send stablecoins from a mainnet wallet and have native BTC arrive at any Bitcoin address. Blockradar converts the stablecoin and delivers the BTC in one swap, so you don’t need a Bitcoin wallet, node, or private keys. A Bitcoin payout uses the same quote and execute endpoints as any other swap, from a master wallet or a child address. Instead oftoAssetId, describe the destination with toBlockchain and toAsset, and send the BTC address as recipientAddress:
Do not send
toAssetId in the same request. A Bitcoin address has no Blockradar wallet or asset ID, which is why the destination is named by chain and symbol.
Quote a Bitcoin payout
/swaps/execute, adding reference and metadata if you use them. Amounts in the quote are in BTC, with up to 8 decimal places.
How a Bitcoin payout completes
- The stablecoin leaves your wallet on the source chain.
- A routing provider delivers native BTC to
recipientAddresson the Bitcoin network. - Blockradar checks the Bitcoin transaction on two independent block explorers and confirms that at least the quoted
minAmountreached the recipient. - The swap is marked
SUCCESSand you receive theswap.successwebhook. The destination hash is the Bitcoin transaction ID, which you can show to your user or look up on any Bitcoin explorer.
PROCESSING. Blockradar does not fail a payout whose stablecoin has already left your wallet; if the Bitcoin leg is late or does not match the quote, our team is alerted and follows it up.
Bitcoin transactions confirm in blocks roughly every 10 minutes, so a Bitcoin payout takes longer than a swap between stablecoin chains. Use
estimatedArrivalTime from the quote to set your user’s expectations.Fees and small payouts
A Bitcoin payout quote returns the same fee fields as any other swap, includingimpact and impactInUSD. Routing has a fixed cost per payout, so on a small amount the fee is a large share of the payout. Show toAmount and impactInUSD to your user before they confirm.
Limitations
- Mainnet only. Bitcoin payouts are not available on testnet; testnet requests return a
400. - Payout only. Blockradar sends BTC but does not hold it: there are no Bitcoin wallets or deposit addresses, and Bitcoin does not appear in the Get Assets or blockchain lists.
- Gasless swaps and
recipientRoutingare not supported for Bitcoin destinations. - Wallets with address whitelisting turned on cannot send Bitcoin payouts. Whitelisted addresses must match the wallet’s own blockchain, so a Bitcoin address cannot be added to the list.
Bitcoin payout errors
Bitcoin payouts can also run automatically from deposits. See Bitcoin payout rules in Auto Settlements.
Complete Flow Example
Here’s a full implementation showing the quote → confirm → execute flow:Error Responses
Insufficient Balance
Insufficient Balance
Invalid Asset ID
Invalid Asset ID
Swap Route Not Available
Swap Route Not Available
Amount Too Low
Amount Too Low
Slippage Exceeded
Slippage Exceeded
Best Practices
User Experience
- Always show quotes: Display amount, fees, and estimated time before execution
- Handle slippage: Inform users about potential price variations
- Show progress: Use webhooks to update users on swap status
Security
- Validate amounts: Ensure swap amounts are within acceptable ranges
- Use references: Track swaps with unique reference IDs
- Monitor webhooks: Always verify swap completion via webhooks
Performance
- Cache asset IDs: Store asset IDs locally to avoid repeated lookups
- Use appropriate order types: Choose
FASTESTfor time-sensitive,CHEAPESTfor cost-sensitive - Implement retries: Handle transient failures with exponential backoff
API Reference
Support
- Email: support@blockradar.co
- Documentation: API Reference
- Blog: How to Swap or Bridge Assets with Blockradar
The Swap API provides a unified interface for both same-chain swaps and cross-chain bridges. Start with small test amounts on testnets before moving to production.

