Until May 2026, every MT5 order PipSync sent went through MetaAPI — a third-party SaaS that runs hosted MT5 terminals and exposes a REST API in front of them. It is a genuinely good product. We removed it anyway.
What you trade for the convenience
MetaAPI saves you weeks of operational work. Spinning up MT5 terminals on Wine, keeping them logged in across credential rotations, handling broker-side disconnects, writing a service that survives Windows update cycles — none of that is fun. In exchange you accept four trade-offs:
- Per-account pricing that scales linearly with your user count.
- An extra network hop between your code and the broker, in a datacentre you don't choose.
- A vendor lock-in: the service understands your account credentials at all times.
- Limited audit-trail control. The provider's logs are the source of truth for what happened.
For a side project routing one or two accounts, the trade-offs are obviously worth it. For a platform that wants to publish SOC-2-grade audit evidence and price flat-rate, they stack up.
What we replaced it with
Three components, all self-hosted on the existing infrastructure:
- MT5 Instance Manager — a Rust service on the MT5 host that spawns and supervises one MT5 terminal per broker account, each in its own Wine prefix with its own VNC port behind a firewall.
- MT5 File API — a small HTTP server that talks to a MetaTrader Expert Advisor over an on-disk message queue, returning position state and accepting order commands.
- Trade Gateway — a Rust/Axum service that fronts the file API and exposes a uniform REST contract to the rest of PipSync, identical to what MetaAPI exposed.
The contract identical part is the trick that made the migration feasible. Web pages, dashboards, and bots see the same JSON shape after the switch as before; the only difference is the URL they POST to.
What we got back
Three things, measurable. Vendor cost dropped to fixed VM cost. Latency improved because the hop is now intra-datacentre instead of inter-datacentre. Audit evidence is queryable in our own database with our own retention policy. None of those individually justifies a migration; together, they do.