Trade Crypto CFDs withPrecision & Power

Access the world's largest cryptocurrency markets through CFDs. Trade on price differences without owning the underlying assets. Leverage up to 1:100 with institutional-grade execution.

$2.4B+
Daily Volume
50K+
Active Traders
100+
Crypto Pairs
0.01s
Execution Speed
Core Infrastructure

Application Architecture Evolution

CryptoCFD is a highly responsive, institutional-grade cryptocurrency leveraged trading platform. Below is a full retrospective outlining our architectural migration from an agile, single-instance architecture (v0) to a scalable, microservices-driven, low-latency execution framework (v1).

Legacy Architecture (Version 0)
Not Scalable

Our initial implementation was built as a single, centralized monolithic server. All critical components (web framework, HTTP routing, real-time matching, order books, and position margins) were kept completely in memory inside a single Node.js thread.

Legacy Monolithic Architecture (v0)
Version 0: Monolithic Flow

Major Version 0 Bottlenecks

  • State Volatility: Because matching state and ledger were inside server memory, restarting or crashing the process resulted in 100% loss of active order books and balances.
  • Unscalable Matching: Single-threaded CPU execution meant complex balance calculations and limit margin matches blocked the HTTP thread, resulting in high latency spikes under trade spikes.
  • Inefficient DB Writes: Writing every raw tick directly into a traditional PostgreSQL instance created heavy write lock bounds, causing massive CPU bottlenecks.
Distributed Architecture (Version 1)
Active Production

The active system decouples state and scaling vectors into an event-driven core. The Matching Engine is extracted into an independent microservice (Engine), communicated through ultra-high-speed Redis Streams for thread-safe asynchronous order dispatching.

Active Microservices Architecture (v1)
Version 1: Event-Driven Topology

Version 1 Architectural Upgrades

  • Decoupled Trading Engine: The Backend handles API requests and mounts user tokens, while the dedicated Engine microservice processes limits and liquidations in isolated processes with maximum safety.
  • Redis Stream Broker: Redis streams act as message brokers. The Backend streams order events onto stream:exness and polls stream:exnessReceive. This creates an asynchronous, robust thread model capable of handling thousands of requests concurrently.
  • TimescaleDB Integration: Rather than querying simple Postgres models, high-frequency candlesticks are aggregate-chunked and written directly to a TimescaleDB hypertable for optimized, sub-millisecond query indices.
  • Asynchronous Worker Queues: Non-critical paths like SMS/Email notifications, transaction journaling, and ledger snapshots are outsourced to background queue workers, eliminating API thread blocking.

Platform Infrastructure

Deep-dive into the technical foundations that power CryptoCFD's low-latency, production-grade trading experience.

01
Engine Decoupling

Moving the order-matching engine to a separate microservice ensures the Backend is entirely stateless. The API gateway can horizontally auto-scale behind standard routing loads, keeping the platform immune to HTTP floods.

02
TimescaleDB Hypertable

Market candles require specialized time-series indexes. TimescaleDB hypertables handle automatic data partitioning on temporal indexes, allowing the platform to store and query millions of candles at negligible cost.

03
State Snapshotting

For maximum safety against reboots, the Engine creates hourly encrypted snapshots of active user balances and order inventories. Upon cold restart, the Engine re-loads the latest snapshot, bringing recovery time under 500 milliseconds.

API Reference

Developer API Reference

Explore, test, and integrate with CryptoCFD backend services. Our full interactive API explorer with live endpoint testing is available on the documentation site.

Authentication
7 endpoints

Login, email verification, mobile session tokens, and PIN management.

POST /auth/loginGET /auth/verifyPOST /auth/mobile/pin
Market Data
5 endpoints

Supported assets, live prices, candlestick data, and aggregate refresh.

GET /supportedAssetsGET /candles
User Profile
1 endpoint

Authenticated balance retrieval for trading dashboard.

GET /balance
Trading Operations
6 operations

Create, open, close orders and closed order history.

POST /trade/createGET /trade/openPOST /trade/close

Ready to Start Trading?

Join thousands of traders who trust CryptoCFD for their cryptocurrency trading needs. Start with a demo account or go live in minutes.