Skip to main content
Case Study · CopyRail · Engineered and tested, pre-launch

Copy one account to thousands, without holding anyone's money.

CopyRail is trade-copying infrastructure for Deriv MT5. A master account's trades are replicated to any number of follower accounts in close to real time, while every follower keeps full custody of their own funds. WEBMUSE designed it from first principles: a signed wire protocol, a relay that does the same work for ten followers or fifty thousand, sealed credential intake, and a hosted terminal fleet.

Signed instructionsSub-millisecond hot pathNo custody of fundsSealed credentialsHosted MT5 fleetPartner API
00 — The value in one paragraph

Fast, correct and never holding the money.

Copying a trade sounds simple until it has to be right for thousands of accounts at once. CopyRail signs each instruction once, fans it out to every follower, and lets each follower's own terminal verify, size and place the order locally. A compromised server or network path cannot trade, because nothing it could forge would carry a valid signature. Followers never hand over funds, only a sealed login that no human ever sees.

01 — Problem

Following a trader well is harder than it looks.

Manual copying

Re-entering every trade by hand is slow, error-prone and impossible to do faithfully in real time.

Custody risk

Handing funds to someone else to manage is a much bigger trust and regulatory step than most people want to take.

Black-box vendors

A company that wants copy-trading in its own product either builds the whole mechanism itself or inherits a vendor's reliability, pricing and roadmap.

Scale

A system that is fast for ten followers can fall over at ten thousand, exactly when the strategy succeeds.

02 — How a trade is copied

One signal in, one signature, many orders out.

01

The master's terminal reports the trade

A watcher running inside the master's MT5 terminal sends the event over a persistent, encrypted connection.

02

The relay validates and decides

It parses strictly, removes duplicates, checks the kill switches and turns the signal into an intent.

03

It signs once

A single Ed25519 signature covers the instruction, so the cost does not grow with the number of followers.

04

Gateways fan out

Sharded gateways, each serving up to about 1,500 connections, write the same signed bytes to every follower socket.

05

Each follower verifies and places the order

The follower's executor checks the signature, sizes the trade locally, places the order and acknowledges it.

03 — Core functionality

What makes it safe, fast and sellable.

Secure by construction

  • Every instruction is signed, so a hacked gateway or network path cannot trade.
  • Follower credentials are sealed on entry and protected by per-record envelope encryption bound to their account; a provisioning bot logs in with no human in the loop.
  • API keys are typed and peppered, all input is parsed strictly, and money never passes through floating-point numbers.

A hot path measured in fractions of a millisecond

  • The relay's own work (parse, dedupe, kill switch, intent, sign) measured p50 0.11 ms and p99 0.39 ms.
  • The follower side (verify, decode, size) measured p50 0.16 ms and p99 0.48 ms. The broker's execution time comes on top and is not CopyRail's.
  • Fan-out costs about 14 microseconds per follower and is sharded across gateways, with a design target of every connected follower getting the trade within 50 ms at 10,000 followers.

A hosted terminal fleet

  • Each follower needs their own MT5 terminal, so CopyRail runs a fleet with a lean per-account workspace, crash recovery and canary roll-out of terminal updates.
  • That fleet runs on the WEBMUSE Freetles Cloud runtime, which hosts terminals densely on Linux and never handles credentials or places trades itself.

Two ways to use it

  • Individuals subscribe directly, connect their own master and follower accounts and keep funds in their own account throughout.
  • Companies integrate through a documented partner API to offer copy-trading under their own brand.

Built-in safety controls

  • Kill switches stop copying instantly, and idempotency keys make a repeated signal safe.
  • Positioning rules keep the product honest: no guaranteed-profit language, no custody, no referral or network-reward logic of any kind.
04 — Architecture

Pure rules at the centre, I/O at the edge.

The domain rules (signals, intents, sizing, kill switches, idempotency) are pure code with no I/O, so they can be tested exhaustively. Security, protocol, relay, provisioning, fleet, executor and network layers sit around them, and every significant decision is recorded as an architecture decision record.

domain

Signals, intents, sizing, kill switches and idempotency. Pure rules, no I/O.

security · protocol

Ed25519 frame signing, the credential vault, API keys, strict inbound parsing and canonical signed encoding.

relay · net

The hot path orchestration, master intake, follower gateways, key authentication and the internal bus.

provisioning · fleet

The login bot that takes a sealed password to an ACTIVE or FAILED account, and per-account MT5 workspaces.

executor

Verify, dedupe, size, order and acknowledge, for any MT5 broker, with a readiness gate.

api · billing · messaging

The partner and admin APIs, crypto-payment billing, and notifications including web push and Telegram.

05 — Quality and delivery

Tested against hostile conditions.

Adversarial testing

Hundreds of automated tests include real-socket runs of the whole relay, gateway and executor chain, with tampered, forged, replayed and hostile input and provisioning failures, plus benchmarks for the hot path and fan-out.

Documented decisions

Thirty-four architecture decision records, a threat model, runbooks for deployment, key rotation and multi-server operation, and a readiness register that states plainly what is and is not proven yet.

A web app and an admin console

A follower app (installable, with a photo editor and push) and a separate admin console, both built with React and Vite.

06 — Technology stack

Production stack and why each piece was chosen.

LayerTechnologyWhy
CorePython 3.12 · asyncio · websocketsA single-purpose relay and gateways that stay fast and simple under many connections.
SecurityEd25519 · envelope encryption · Argon2Sign once, verify everywhere; credentials and passwords protected at rest.
TerminalsMetaTrader 5 · MQL5 watcher · Linux + Wine fleetThe only way to trade MT5 accounts, run densely and recovered automatically.
Control planeFastAPI · PostgreSQL · RedisPartner and admin APIs, records, and a message bus for multi-server deployments.
AppsReact · Vite · TypeScript · PWAA follower app and an admin console, installable and fast.
Qualitypytest · Hypothesis · benchmarksProperty-based tests and measured latency evidence for every release.
Verified metrics

Counted from the codebase, not estimated.

0.11 ms
Relay hot path, p50
~14 µs
Fan-out cost per follower
500+
Automated tests
34
Architecture decision records
130+
Source modules
0
Funds held by the platform

Engineered, tested and benchmarked; not yet launched to the public.