Low-Latency Crypto Trading Architecture and Messaging Choices
Summary
The document outlines design choices for a low-latency cryptocurrency trading system: busy-spinning, pinning producer and consumer threads to CPU cores, and using lock-free ring buffers to reduce scheduling and communication overhead. The author is considering ZeroMQ’s publish/subscribe pattern and asks whether it is appropriate for latency-sensitive applications, as well as what alternatives might be better.
The response offers a claim that software-only systems can achieve very low tick-to-trade latency and says an architecture could be shared, but it provides no design details, benchmarks, or comparison of messaging options. As a result, this is primarily a discussion prompt rather than a worked architecture or demonstrated performance study. It identifies relevant engineering tradeoffs, but does not establish whether ZeroMQ is suitable or explain how the proposed components perform under specific workloads.
Key ideas
- CPU affinity can keep trading threads on fixed cores and reduce migration between CPUs.
- Busy-spinning is proposed as a way to avoid waiting for scheduled work.
- Lock-free ring buffers are used for communication between producers and consumers.
- The author asks whether ZeroMQ publish/subscribe fits a latency-sensitive trading system.
- The response claims software-only systems can attain very low tick-to-trade latency but supplies no supporting measurements.
Tags
Full text
# crypto HFT architecture # crypto HFT architecture This architecture is designed to minimize latency with the help of busy-spinning and CPU affinity locks(meaning each producer/consumer thread running in only one core), preventing a thread from wandering between CPUs and losing time on context switching. On a side note : I am using lock-free ringbuffers. I am going to use ZMQ for PUB/SUB architecture. I really don't know if this is a very bad choice for a low latency application which is what i am going to design. Could anyone please point me why its bad ? and what are the alternatives here ? ## Answer by Ariel Silahian (score -3) https://quant.stackexchange.com/a/71799 I can show you here what we did, and how we architected several production-ready low latency trading (achieving under 2 microsec tick-to-trade) Note: we did all this using software-based only systems (no FPGAs)
Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.