Skip to main content
The Stablecoin Conversion endpoint enables you to convert between different stablecoins across various blockchain networks. This endpoint handles cross-chain conversions, currency exchanges, and network transfers seamlessly through Devdraft’s unified infrastructure.

Endpoint Details

  • Method: POST
  • URL: /api/v0/transfers/stablecoin-conversion
  • Content-Type: application/json

Authentication

This endpoint requires API key authentication using both:
  • x-client-key: Your application’s client key
  • x-client-secret: Your application’s client secret

Request Body

Parameters

Supported Networks

  • Ethereum (ethereum)
  • Solana (solana)
  • Base (base)
  • Polygon (polygon)
  • Arbitrum (arbitrum)
  • Optimism (optimism)
  • Avalanche C-Chain (avalanche_c_chain)

Supported Stablecoins

  • USDC (usdc) - Available on all networks
  • EURC (eurc) - Available on Ethereum, Solana
  • USDT (usdt) - Available on Ethereum, Polygon, Avalanche

Conversion Types

Convert USDC from Ethereum to USDC on Solana
  • Fastest conversion type
  • Minimal fees
  • No currency exchange rate risk

Response

Success Response (201 Created)

Response Fields

Conversion Process

1. Rate Quote and Validation

When you submit a conversion request:
  • System validates wallet ownership and balances
  • Retrieves current exchange rates (if needed)
  • Calculates all fees and estimated amounts
  • Reserves funds from source wallet

2. Cross-Chain Execution

For cross-chain conversions:
  • Initiates withdrawal from source network
  • Routes through Devdraft’s liquidity pools
  • Executes currency conversion (if needed)
  • Deposits to destination network

3. Completion and Settlement

Once conversion completes:
  • Funds appear in destination wallet
  • Transaction hashes are recorded
  • Conversion receipt is generated
  • State is updated to completed

Conversion States

Fee Structure

  • Source network fee: Gas/transaction fee on source blockchain
  • Destination network fee: Gas/transaction fee on destination blockchain
  • Variable by network: Ethereum fees higher than Solana
  • Same currency conversions: 0.1% - 0.3%
  • Cross-currency conversions: 0.3% - 0.8%
  • Based on liquidity: Lower fees for high-liquidity pairs
  • Standard rate: 0.8% of conversion amount
  • Calculated on source amount: Before other fees
  • Transparent pricing: No hidden fees

Exchange Rates

Exchange rates are fetched in real-time from multiple sources:
  • Major cryptocurrency exchanges
  • DeFi liquidity pools
  • Aggregated pricing feeds
  • Updated every 30 seconds

Example Requests

Error Responses

Advanced Features

  • Convert multiple amounts in a single request
  • Optimize fees across multiple conversions
  • Atomic execution for related conversions
  • Set future execution times
  • Dollar-cost averaging strategies
  • Automated recurring conversions
  • Set target exchange rates
  • Automatic execution when rates hit
  • SMS and email notifications
  • Automatic rebalancing between networks
  • Optimize for lowest fees
  • Smart routing through best liquidity pools

Use Cases

Portfolio Rebalancing

Automatically rebalance stablecoin holdings across networks

Arbitrage Opportunities

Take advantage of price differences between networks

Gas Optimization

Move funds to networks with lower transaction fees

Multi-Currency Treasury

Manage treasury across different stablecoins and networks

Cross-Border Payments

Convert currencies for international transactions

DeFi Strategy Execution

Position funds across networks for DeFi opportunities

Best Practices

1

Monitor Network Conditions

Check gas prices and network congestion before conversions
2

Consider Timing

Execute conversions during low-traffic periods for better rates
3

Use Rate Protection

Lock in favorable rates for time-sensitive conversions
4

Batch When Possible

Combine multiple conversions to reduce overall fees
5

Monitor Completion

Use webhooks to track conversion progress automatically
  • GET /api/v0/wallets - List your Devdraft wallets
  • GET /api/v0/transfers/{id} - Check conversion status
  • GET /api/v0/exchange-rates - Get current exchange rates
  • POST /api/v0/transfers/direct-wallet - Create wallet-to-wallet transfer