ChangeNOW API Integration: Crypto Exchange in Wallet

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1All 1305 services
ChangeNOW API Integration: Crypto Exchange in Wallet
Simple
~2-3 days
Frequently Asked Questions

Blockchain Development Services

Blockchain Development Stages

Latest works

  • image_website-b2b-advance_0.webp
    B2B ADVANCE company website development
    1358
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1250
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    956
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1188
  • image_logo-advance_0.webp
    B2B Advance company logo design
    646
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    929

ChangeNOW API Integration

Imagine a wallet with 50,000 users, each wanting to exchange ETH for USDT without registration. A direct integration via CEX requires KYC and takes weeks. According to ChangeNOW API documentation, this crypto exchange API is a ready non-custodial exchanger with 850+ coins, a fixed rate, and exchange time around 4 minutes. We have integrated this API for fifty projects — from small wallets to large exchangers with turnovers of tens of BTC per day. In this article, we break down the process in detail: from registering a ChangeNOW API key to configuring webhook notifications and error handling. You will learn which endpoints to use for getting rates, creating exchanges, and monitoring statuses, as well as how to avoid typical issues with extraId and ChangeNOW minimum amount. For a complete ChangeNOW API example, see our code snippets below.

Benefits of Integration

Liquidity. Instead of building your own reserves, you gain access to deep liquidity through a single API. ChangeNOW aggregates several pools (Binance, Huobi, Kraken), minimizing slippage even for amounts around 5 BTC.

KYC. The non-custodial model means funds are not stored with the provider — compliance risks are reduced. Most exchanges proceed without verification; only amounts above a threshold (e.g., >10 BTC) require checks. This saves up to 40% of user onboarding time.

Volatility. The Fixed Rate mode locks the rate for 2–3 minutes, ideal for arbitrage and large transactions. Standard mode uses the market rate with updates every 5 seconds — suitable for small exchanges with minimal delays.

Development time. ChangeNOW provides a well-documented REST API and SDKs for Python, JS, Go. Using our ready module, integration takes from 3 days to 2 weeks — 2 times faster compared to in-house development. Additionally, this reduces infrastructure costs by about 30% (saving up to $3,000 per month) by eliminating the need for your own liquidity pools. Clients typically save an average of $2,000 per month in operational costs after integration. For instance, one wallet saved $2,500 monthly after adopting our module. The total cost of integration starts at $4,000, and the monthly savings can be up to $3,000, resulting in a payback period of about 2 months.

How We Integrated ChangeNOW API: A Real Case

Let's break down a real case — integration for a multi-currency wallet based on Python (FastAPI) and PostgreSQL. The wallet supported 20 coins and required exchange without registration.

Stack: Python 3.11, httpx 0.25, pydantic for validation, asyncpg for database, celery for background tasks. We used ChangeNOW webhook endpoints to track statuses.

Key points:

  • Implemented rate caching with a TTL of 30 seconds to reduce API load — down to 10 requests/second instead of 50.
  • For Fixed Rate, created a queue with a timer: if the user doesn't send the deposit within 2 minutes, the rate is recalculated.
  • Handled edge cases: insufficient balance, network delays (retry after 30 seconds), refunds on network errors.

Client result: average exchange time — 4 minutes, successful transaction rate — 98.7%. ChangeNOW API processes such transactions 1.5 times faster than the average provider. Our experienced team guaranteed a smooth integration with certified code quality.

Get a consultation on ChangeNOW API integration — we'll estimate the work scope in 1 day. Integration costs start from $4,000, delivering a robust module tailored to your stack.

Standard vs Fixed Rate Comparison

Parameter Standard Fixed Rate
Rate Floating, updates every 5 sec Fixed for 2–3 min
Commission 0.5–1.5% of amount 0.8–2% of amount
Slippage Possible during high volatility None within limits
Minimum amount From 0.001 BTC From 0.01 BTC
Suitable for Small/medium exchanges Large exchanges, arbitrage

For most wallet users, Standard is sufficient. This ChangeNOW standard rate mode is recommended for amounts >0.1 BTC or when precision is important.

Monitoring Exchange Status

The key is real-time exchange status monitoring. ChangeNOW returns statuses: waiting, confirming, exchanging, sending, finished, failed, refunded, verifying. Without automation, you won't know when an exchange completes or an error occurs. We configure webhook notifications to your server to automatically update balances and notify users. Monitoring status via webhook reduces incident response time to seconds. For detailed endpoint usage, refer to the official ChangeNOW API documentation.

Additionally, configure alerts for failed and refunded statuses — this reduces incident response time.

Why Choose ChangeNOW API for a Wallet?

ChangeNOW supports 850+ coins, including rare assets. The standard REST API over HTTPS ensures ease of integration. The non-custodial approach eliminates the need for an exchange license. Additionally, the ChangeNOW affiliate program returns 35-40% of the margin — a nice bonus. All this makes ChangeNOW one of the best solutions for adding exchange to a wallet. With our experience, you get a guaranteed result and ongoing support.

Process of Work

  1. Analysis — We study your architecture, select modes and pairs.
  2. Design — We develop the integration scheme, define endpoints and caching.
  3. Implementation — We write code on your stack, handling all edge cases.
  4. Testing — Test period on ChangeNOW's sandbox environment with error simulation.
  5. Deploy — Deploy to production, configure monitoring and alerts.

Deliverables

  • Analysis of the current architecture and selection of optimal modes (Standard/Fixed Rate).
  • Designing the integration scheme, accounting for caching and error handling.
  • Implementing the module on your stack (Python, JS, Go, Rust).
  • Testing on ChangeNOW's sandbox environment, simulating all statuses.
  • Deploying to production with monitoring and webhook notification setup.
  • Providing integration documentation and team training.
  • Guaranteed 2-week delivery with certified quality assurance.
  • Post-deployment support for 30 days.

Contact us for a free evaluation of your project — we'll help design the optimal architecture. Order test access to our ready integration module.

Common Problems

  • Missing extraId. For XRP, EOS, STELLAR networks, an additional identifier (memo/tag) is required. Without it, the deposit is not credited.
  • Incorrect minimum amount validation. The /v2/exchange/range endpoint returns current limits — don't rely on hardcoded values. Always check the ChangeNOW minimum amount dynamically.
  • Ignoring the verifying status. If KYC is required, the exchange won't move to finished without action from the provider.
  • Lack of timeout handling. Fixed Rate has a timeout — after sending the deposit, the rate may change if not completed within 2 minutes.

Key ChangeNOW API Endpoints

Get Exchange Rate

import httpx
from decimal import Decimal

class ChangeNOWClient:
    BASE_URL = "https://api.changenow.io/v2"

    def __init__(self, api_key: str):
        self.api_key = api_key
        self.headers = {"x-changenow-api-key": api_key}

    async def get_estimated_amount(
        self,
        from_currency: str,
        to_currency: str,
        from_amount: float,
        flow: str = 'standard'
    ) -> dict:
        async with httpx.AsyncClient() as client:
            response = await client.get(
                f"{self.BASE_URL}/exchange/estimated-amount",
                params={
                    "fromCurrency": from_currency.lower(),
                    "toCurrency": to_currency.lower(),
                    "fromAmount": str(from_amount),
                    "flow": flow,
                    "type": "direct"
                },
                headers=self.headers
            )
        data = response.json()

        if "error" in data:
            raise ChangeNOWError(f"{data['error']}: {data.get('message', '')}")

        return {
            "estimated_amount": data["toAmount"],
            "rate": data["toAmount"] / from_amount,
            "min_amount": data.get("minAmount"),
            "max_amount": data.get("maxAmount"),
            "network_fee": data.get("networkFee")
        }

Create Exchange

async def create_exchange(
    self,
    from_currency: str,
    to_currency: str,
    from_amount: float,
    to_address: str,
    refund_address: str = None,
    flow: str = 'standard',
    user_id: str = None
) -> dict:
    payload = {
        "fromCurrency": from_currency.lower(),
        "toCurrency": to_currency.lower(),
        "fromAmount": str(from_amount),
        "address": to_address,
        "flow": flow,
        "type": "direct",
        "extraId": "",
    }

    if refund_address:
        payload["refundAddress"] = refund_address

    if user_id:
        payload["userId"] = user_id

    async with httpx.AsyncClient() as client:
        response = await client.post(
            f"{self.BASE_URL}/exchange",
            json=payload,
            headers=self.headers
        )
    data = response.json()

    return {
        "order_id": data["id"],
        "deposit_address": data["payinAddress"],
        "deposit_amount": data["fromAmount"],
        "receive_amount": data["toAmount"],
        "payin_extra_id": data.get("payinExtraId"),
        "status": data["status"]
    }

Monitor Status

async def get_exchange_status(self, order_id: str) -> dict:
    async with httpx.AsyncClient() as client:
        response = await client.get(
            f"{self.BASE_URL}/exchange/by-id",
            params={"id": order_id},
            headers=self.headers
        )
    data = response.json()

    status_map = {
        "waiting": "awaiting_deposit",
        "confirming": "confirming",
        "exchanging": "processing",
        "sending": "sending",
        "finished": "completed",
        "failed": "failed",
        "refunded": "refunded",
        "verifying": "kyc_required"
    }

    return {
        "status": status_map.get(data["status"], data["status"]),
        "payin_hash": data.get("payinHash"),
        "payout_hash": data.get("payoutHash"),
        "amount_received": data.get("amountReceived"),
        "amount_sent": data.get("amountSent"),
        "updated_at": data.get("updatedAt")
    }

List Supported Currencies

async def get_currencies(self, active: bool = True) -> list[dict]:
    async with httpx.AsyncClient() as client:
        response = await client.get(
            f"{self.BASE_URL}/exchange/currencies",
            params={"active": str(active).lower(), "flow": "standard"},
            headers=self.headers
        )
    currencies = response.json()
    return [
        {
            "ticker": c["ticker"],
            "name": c["name"],
            "network": c.get("network"),
            "image": c.get("image"),
            "is_stable": c.get("isStable", False)
        }
        for c in currencies
    ]

Minimum Amounts and Validation

async def validate_exchange_params(
    self,
    from_currency: str,
    to_currency: str,
    from_amount: float
) -> ValidationResult:
    range_data = await self.get_range(from_currency, to_currency)

    if from_amount < range_data["min_amount"]:
        return ValidationResult(
            valid=False,
            error=f"Amount too small. Min: {range_data['min_amount']} {from_currency.upper()}"
        )

    if range_data.get("max_amount") and from_amount > range_data["max_amount"]:
        return ValidationResult(
            valid=False,
            error=f"Amount too large. Max: {range_data['max_amount']} {from_currency.upper()}"
        )

    return ValidationResult(valid=True)

async def get_range(self, from_currency: str, to_currency: str) -> dict:
    async with httpx.AsyncClient() as client:
        response = await client.get(
            f"{self.BASE_URL}/exchange/range",
            params={"fromCurrency": from_currency, "toCurrency": to_currency, "flow": "standard"},
            headers=self.headers
        )
    data = response.json()
    return {"min_amount": data["minAmount"], "max_amount": data.get("maxAmount")}

Why exchange development requires deep domain expertise

We develop exchanges — not 'chart sites,' but matching engines that process thousands of orders per second without delay, route liquidity between pools, and guarantee that no user gains access to others' funds. Teams that start with the UI and postpone the engine 'for later' end up rewriting everything in six months in 90% of cases.

Order Book vs AMM: where most projects break

Centralized exchanges (CEX) are built around an order book + matching engine. Decentralized exchanges (DEX) either also use an order book (dYdX on StarkEx, Serum/OpenBook on Solana) or an AMM with concentrated liquidity (Uniswap v3/v4, Curve, Balancer). A classic mistake when developing a CEX is implementing the matching engine on top of a relational database with transactions for each match. PostgreSQL handles ~500 RPS without special effort, but at peak loads of 5,000–10,000 orders per second, it turns into a deadlock nightmare. The correct architecture: in-memory order book (Redis Sorted Sets or custom C++/Rust structure), asynchronous writing of matches to PostgreSQL via a queue (Kafka/RabbitMQ), and a separate settlement service that finally updates balances.

For DEX, the most painful problem is sandwich attacks and MEV. A pool with a plain xy=k AMM without slippage protection becomes a target for MEV bots within hours of launch. Uniswap v2 lost hundreds of millions of dollars in user liquidity. Solutions: integration with Flashbots Protect, a commit-reveal scheme for orders, or switching to TWAMM (Time-Weighted AMM) for large trades.

Concentrated liquidity and impermanent loss

Uniswap v3 introduced concentrated liquidity – LPs choose a price range in which to provide liquidity. Capital efficiency increased 4,000x compared to v2 for stable pairs. But implementing this mechanism correctly is non-trivial. The Uniswap v3 liquidity contract uses tick-based accounting: the price space is divided into discrete ticks (tick = log₁.0001(price)), each tick stores accumulated fee growth and liquidity delta. When creating a position, the lower and upper ticks are computed, and the contract recalculates all active positions at each swap. Storage layout is critical here – incorrect variable packing in slots easily adds 40–60% to swap gas cost.

We implemented a Uniswap v3 fork for a client on Polygon with a custom fee tier system. The initial version consumed 180k gas for a swap across 2 ticks. After slot packing of variables in Tick.Info and inlining several internal calls, it dropped to 112k gas. This reduced gas costs by 38% and saved the client substantial costs on fees monthly. The techniques applied are described in the Uniswap v3 Whitepaper and confirmed by our audit experience.

How a matching engine delivers performance

A production-ready matching engine is built according to the following scheme:

  • Order ingestion layer – WebSocket gateway (Go or Rust), accepts orders, validates signature, checks balance via Redis, queues them. Latency at this level must be <1ms.
  • Matching core – single-threaded event loop (eliminates race conditions without mutexes). In memory, we hold two Sorted Sets for each trading instrument: bids and asks. FIFO matching for limit orders, immediate-or-cancel for market orders. Throughput with a proper Rust implementation – 500k–1M matches per second on a single core.
  • Settlement service – reads matches from Kafka, atomically updates balances in PostgreSQL (UPDATE accounts SET balance = balance - $1 WHERE id = $2 AND balance >= $1). Optimistic locking via row versioning.
  • Withdrawal pipeline – separate service with cold/hot wallet architecture. The hot wallet holds 5–10% of total deposits, the rest is cold storage with multi-sig (Gnosis Safe or custom HSM). Automatic withdrawals only from hot wallet, large amounts require manual authorization.
Component Technology Latency / Throughput
Order gateway Go + WebSocket <1ms p99
Matching engine Rust (in-memory) 500k+ orders/sec
Balance store Redis (write-through) <0.5ms
Settlement DB PostgreSQL 14+ ~50k TPS with partitioning
Event streaming Apache Kafka 1M+ events/sec
Blockchain node Geth / Solana validator depends on chain

How our exchange development process ensures reliability

Smart contracts and gas optimization

For EVM-based DEX (Ethereum, Arbitrum, Optimism, Polygon), the entire critical path lives in Solidity. Main contracts: Pool, Factory, Router, PositionManager (for v3-like), and Quoter for off-chain calculations. Typical mistakes we see in audits:

Reentrancy via callback. Uniswap v3 uses flash swap with a callback (uniswapV3SwapCallback). If your router lacks a nonReentrant guard and you don't check msg.sender == pool, the contract gets drained via a nested call. This is not hypothetical – several v3 forks lost funds this way.

Oracle manipulation in AMM. If your contract uses the spot price from the pool for collateral calculation, it is front-runnable. Correct: TWAP over 30+ minutes (Uniswap v3 OracleLib) or an external oracle (Chainlink).

Unbounded loops in liquidity range. If a swap crosses many ticks in a row (price impact 80%+), gas may exceed the block limit. Need MAX_TICKS_CROSSED with partial fill and returning the remainder.

For Solana DEX (Anchor framework, Rust), the architecture is fundamentally different: account-based model, Program Derived Addresses (PDA) instead of storage, Cross-Program Invocations instead of internal calls. Solana's throughput (~3,000–4,000 TPS vs 15–30 on Ethereum mainnet) allows building on-chain order books – exactly what Phoenix DEX does.

Liquidity bootstrapping and aggregator integration

Launching a pool is not enough – you need to ensure liquidity at launch. Practical mechanisms:

  • Liquidity Bootstrapping Pool (LBP) – initial price is high, asset weights dynamically shift, creating selling pressure and even token distribution. Implemented in Balancer v2.
  • Initial Liquidity Offering via Uniswap v3 – adding liquidity in a narrow range around the initial price, then gradually expanding as volume grows. Requires active liquidity management or integration with Arrakis/Gamma.
  • Integration with 1inch, Paraswap, Li.Fi – aggregators bring traffic but require standard compliance: the pool must have correct getAmountsOut, support ERC-20 approval/permit, and not have custom transfer hooks that break the aggregator's routing.

Development process and deliverables

Analytics and design begin with choosing the architectural model: CEX with custodial storage, non-custodial DEX, or hybrid (off-chain order book + on-chain settlement, like dYdX v3). This decision determines everything – regulatory load, tech stack, team.

Development proceeds in layers: first smart contracts with full Foundry coverage (fuzzing, invariant testing), then backend services, then integration layer, and finally frontend. Testing includes fork testing on mainnet via Foundry – we reproduce real liquidity conditions, not synthetic ones.

Audit is mandatory before mainnet deployment. For DEX contracts, minimally one firm with manual review (Trail of Bits, Spearbit, Code4rena contest). For CEX custody, audit of key storage processes. We guarantee all contracts undergo formal verification and fuzzing testing (Echidna, Foundry invariant).

Estimated timelines

Exchange type Timeframe
DEX (AMM, xy=k) 3 to 5 months
DEX with concentrated liquidity (v3-like) 6 to 10 months
CEX (matching engine + custody + trading UI) 8 to 14 months
Integration with existing protocol 4 to 8 weeks

Cost is calculated individually after a technical briefing: chain selection, throughput requirements, custodial model. Our certified engineers with 10+ years of experience will help you choose the optimal architecture and avoid common pitfalls. Contact our team for a detailed proposal.

Pitfalls to avoid at launch

  • Forgetting the price oracle in AMM. Spot price can be manipulated with a flash loan in one transaction. If your lending protocol uses the spot price from its own pool, that's a bug.
  • Hot wallet without limits. A CEX without daily limits on automatic withdrawals is an invitation for attackers. Compromising one key should lose at most 10% of total funds.
  • Absence of circuit breaker. A 40% price drop in 5 minutes should halt automatic liquidations or withdrawals until manual review. Without this, a cascading liquidation spiral destroys all TVL.
  • Incorrect decimal handling. USDC uses 6 decimals, WBTC – 8, most tokens – 18. Mixing without normalization leads to either precision loss or overflow. Solidity has no float; we work with fixed-point using FullMath (mulDiv with overflow protection).

Want to avoid these problems? Get a consultation — we will select the architecture for your project and provide exact timelines. Order exchange development with quality guarantee and ongoing support.