How It Works
Complete flow of the cryptocurrency exchange process
Overview
The MintMove API enables seamless cryptocurrency exchanges across different blockchain networks. This guide walks through the complete order lifecycle from creation to completion.
Complete Exchange Flow
Fetch Available Currencies
First, retrieve the list of supported cryptocurrencies and networks using the /v1/currencies endpoint. This shows you which pairs are available and their limits.
Get Exchange Rate
Query the current exchange rate for your desired currency pair using/v1/rate. Choose between fixed (locked for 15 minutes) or float (real-time) rates. The response includes the rate, fees, and amount calculations.
Create Order
Create a new exchange order using /v1/order/create. Provide the source and destination currencies, networks, amount, rate type, and destination address. You'll receive a unique order ID and a deposit address where the user should send funds.
User Sends Funds
The user sends cryptocurrency to the deposit address provided in the order. You can display a QR code (generated via /v1/order/{id}/qr) to make this easier. The order status remains "NEW" until payment is detected.
System Confirms Payment
Our system monitors the blockchain and detects when payment is received. The order status changes to "PENDING" and we begin tracking blockchain confirmations. The number of required confirmations depends on the network (e.g., 12 for ERC20, 20 for TRC20).
Exchange Processing
Once confirmations are complete, the order status changes to "EXCHANGE". Our system processes the exchange, converting the deposited currency to the destination currency. For float rate orders, the final rate is calculated at this stage.
Withdrawal
After exchange, the order status becomes "WITHDRAW". Funds are sent to the destination address provided during order creation. The withdrawal transaction is broadcast to the destination blockchain.
Completion
Once the withdrawal transaction is confirmed, the order status changes to "DONE". The exchange is complete and funds are in the user's wallet. You can verify the transaction using the withdrawal transaction hash.
Order Status Flow Diagram
Alternative paths:
Emergency Situations
If an unexpected situation occurs (underpayment, overpayment, rate slippage, etc.), the order enters "EMERGENCY" status. The user must choose an action:
- •Continue - Proceed with exchange using current conditions
- •Refund - Cancel order and return funds to user
- •Recalculate - Adjust exchange based on actual amount received
Tracking Orders
You can track order status in several ways:
- •Polling - Periodically call
/v1/order/{id}to check status (recommended intervals: 10-60 seconds depending on status) - •Webhooks - Subscribe to webhooks to receive real-time status updates (recommended for production)
- •Email Notifications - Enable email notifications for important status changes
Timing Considerations
- •Order Expiration: Orders expire after 15 minutes if no payment is received. Users must send funds before the expiration time.
- •Blockchain Confirmations: Time varies by network. Bitcoin can take 10-60 minutes, while ERC20/TRC20 typically take 2-5 minutes.
- •Exchange Processing: Usually completes within 1-5 minutes after confirmations.
- •Withdrawal: Depends on destination network. Most networks confirm within 1-5 minutes.
Best Practices
- ✓Always check order status before displaying completion to users
- ✓Use webhooks instead of aggressive polling to reduce API calls
- ✓Display expiration time clearly to users so they know when to send funds
- ✓Handle emergency situations promptly to avoid delays
- ✓Verify transaction hashes on blockchain explorers for transparency