Leading FX solution provider Cürex has been a valuable Solace customer since 2011, and I’ve had the pleasure of working with them for 3 years. With this blog post I’d like to introduce their use case, architecture, and how they’ve benefited from Solace’s technology and event-driven architecture (EDA) in general.
Before I dive deeper into Cürex’s use case, I’d like to explain how the FX markets generally work. Asset managers, corporations, businesses, governments, and other market participants engage in the foreign exchange market to facilitate the purchase of one currency in exchange for another. For example, a Japanese firm completing payroll for employees in America would need to convert Yen to US dollars to facilitate that transaction. Similarly, a portfolio manager looking to hedge his exposure to US dollar-based assets might exchange US dollars for Euros.
Unlike the equities markets, there are no large, centralized exchanges where currencies can be traded easily, and there is no consolidated tape – a streaming price service that provides a national (or global) best bid and offer for a currency pair across all FX trading venues. The FX market is fragmented across multiple execution venues with a variety of players offering prices that can differ based on the volume of the trade as well as the relationship between the counterparties. For example, an asset manager looking to sell Euros might get a better exchange rate from one bank compared to others based on its relationship with the bank.
FX market participants often transact on ECNs (Electric Communications Networks). ECNs in the FX market play a crucial role of bringing market participants together. ECN participants can access all the latest prices being quoted by the other ECN market participants and can transact accordingly.
The liquidity providers (market makers) on ECNs, such as global investment banks, quote bid and ask prices for the currency pairs they are willing to trade. The bid price is the price that the party is willing to pay to purchase and ask price is the price it is willing to sell at. These prices update frequently on a 24/5 basis. An ECN must maintain an order book based on continuously updating prices and volumes, manage credit functions among its market participants, stream pricing updates to all participants in real-time, match orders and provide near instantaneous post-trade reporting.
Cürex’s Implementation of EDA and Solace
Use Case
In 2011, Cürex decided to invest in a modern, reliable messaging platform. Like any other firm, they debated whether they should build their own messaging platform or simply buy it. There are pros and cons to both approaches, but it was clear to Cürex that their expertise would be better utilized building an FX ECN, versus building messaging. Cürex preferred to focus on optimizing their matching engine and related technology platforms, rather than investing time and resources into optimizing their messaging layer. After careful consideration, Cürex decided to leverage Solace’s PubSub+ brokers as their messaging backbone.
Architecture
Cürex’s applications follow microservices patterns and are mostly written in C++ or C#. Some of the analytics and monitoring services leverage python. As shown in the architecture diagram below, Cürex’s architecture consists of the following key components: matching engine, FIX gateway, market data, risk/credit, pre/post-trade Analytics, client APIs, Web UI, and Solace PubSub+ event brokers.
Cürex exposes FIX (Financial Information eXchange) APIs to its clients, which allows them to receive the latest real-time prices and place trade orders. Additionally, clients can also access prices and pre- and post-trade analytics through Cürex’s Web UI. The prices are provided by the individual market makers and are streamed over Solace PubSub+ event brokers. When a client decides to trade and places an order through Cürex’s API, the order is streamed through PubSub+ brokers as well and is routed to appropriate downstream microservices such as the matching engine.
The matching engine is arguably the most critical component of any FX ECN, or any exchange for that matter. It is responsible for consolidating and ranking bids/asks from all market participants for each tradable currency pair and matching them when a market participant places an order which is at, or better than, the prevailing best bid or offer. The Matching Engine has to make sure that the prices being quoted by the market participants are the latest prices (i.e. not stale) and needs to ensure that trade orders are processed as quickly as possible without being dropped.
Solace’s Role
This is where Solace PubSub+ brokers come into play and really show their value. The pricing data being distributed over Solace brokers needs to be streamed with low latency to avoid stale prices. Clients will not be happy if they are shown stale prices that they cannot trade on. For this use case, Cürex leverages Solace’s in-memory messaging (aka direct) which offers high throughput and low latency making it ideal for price distribution.
The matching engine is also responsible for placing and maintaining orders and it’s important that they are processed quickly, in-order, and without any drops. For high value messages, such as trade orders, Cürex uses Solace’s persistent messaging (aka guaranteed) which offers zero message loss with a high availability architecture to also ensure service uptime. This provides Cürex with peace-of-mind that it will not drop any of its customer’s trade orders.
Before Cürex places orders into its central order book, it runs checks through its Credit microservice to ensure that the client has appropriate line of credit. Once all the checks and balances are in place, the order is routed to the market maker offering best price through the FIX gateway. When the order is executed, the market maker will send a confirmation to Cürex and Cürex will communicate that back to its client.
As you can see there are a lot of microservices participating in Cürex’s architecture which need to exchange messages with each other via Solace. Cürex leverages Solace’s rich hierarchical topics to easily fanout events to its downstream services and apply dynamic filtering.
For example, here is what the topic taxonomy would look like for market data:
<asset-class>/<pool>/MD/FEED/<action>/<source>/<symbol>
And here it is for trade data:
<asset-class>/<pool>/TRD/<source>/<type>/<status>/<user>/<symbol>
Having these hierarchal topics also allow Cürex to apply fine-grained access controls using wildcards and ACL profiles.
Deployment
Cürex relies on Solace’s proven PubSub+ appliances that offer a combination of high throughput (millions of messages per second) and low latency (measured in microseconds) that is second to none. Just like many other financial markets participants, Cürex leverages Solace PubSub+ broker’s “five 9s” reliability (99.999% uptime) and zero RTO/RPO that is critical in capital markets.
To achieve fault tolerance and business continuity, Cürex relies on Solace’s built-in high-availability and disaster recovery features. Every critical infrastructure should withstand server or datacenter failures such as power loss or network failures. Cürex has deployed Solace brokers in high availability configuration to ensure that individual node failures will not impact clients or lead to message loss.
For its non-production environments (e.g. development and staging) Cürex uses Solace’s software broker instead. It helps them optimize their costs and offers the same functionality as the appliances. Cürex’s developers can develop against the software brokers and deploy to the appliances in production without any code change. In the future, Cürex has plans to move some of its components to the cloud which can be easily facilitated by deploying PubSub+ brokers in any major cloud via PubSub+ Cloud.
Learn more about Solace for FX Trading here.
Solace and Cürex
Cürex has trusted Solace PubSub+ brokers to be the backbone of its platform for more than a decade because of three key factors: reliability, performance, and ease-of-use. With Solace, Cürex has avoided spending its valuable time and resources worrying about the stability of its platform, performance, and message loss. Instead, Cürex has focused on its key business and providing innovative features and differentiation for its clients.
In parallel, Solace has continued to innovate to provide features such as managed messaging in cloud environments, which Cürex can benefit from to provide a seamless pathway to their own future cloud adoption. For example, because of their decoupled architecture on top of Solace, Cürex was able to efficiently expand its execution venue to add its peer-to-peer matching platform.
I had known about Solace PubSub+ brokers from previous experience and I knew they were performant, had all the bells and whistles that an FX ECN requires, and are easy to operate. I value that in a technology when I don’t have to spend a lot of resources in simply supporting it. Unlike other messaging technologies, it just works.”
– James Longo, Managing Director of Software Engineering, Cürex
What’s Next
Looking at the next 10 years, Cürex is excited about simplifying their Solace deployments even further by leveraging Solace Cloud which provides messaging as a service. Cürex would also like to use Distributed Tracing which is a new feature Solace has recently released that offers clients end-to-end visibility as events traverse PubSub+ broker via OpenTelemetry. Distributed tracing would allow Cürex to expand their ability to trace individual events such as trade orders as they are published, spooled by the broker, enqueued in a queue, and acknowledged by a consumer. It would also allow them to monitor latency as message are distributed across the broker to identify any bottlenecks.
About Cürex
Founded in 2009, Cürex Group is a New York City-based foreign exchange execution services and data analytics provider with a focus on providing fairness, transparency, and increased efficiencies to their clients in the foreign exchange market.
Cürex’s core platform, its FX ECN, is an execution venue for institutions that provides market participants with equal access to transact in over 200 deliverable currency pairs anonymously at real-time streaming prices that are executable. Prices are streamed to the Cürex FX ECN from both institutional liquidity providers and buy side clients and are updated at micro-second intervals. Cürex also recently launched a peer-to-peer FX matching platform which enables buy side clients to anonymously trade against other natural trading interest at the mid-point of the prevailing best bid and offer in a currency pair.
One of the key differentiators that sets Cürex’s ECN apart from its competitors is that their platform is a ‘no last look’ platform which means the platform does not allow liquidity providers to reject a transaction with a counterparty after the counterparty has sought to execute a trade. This, among other features of the ECN, makes Cürex’s ECN one of the lowest market impact trading venues available in the FX market.
Cürex also provides clients with real-time, pre-trade and post-trade analytics derived from the multi-contributor, no last look streaming price data from the ECN. Moreover, Cürex is also the exclusive provider of the benchmark data that underpins the FTSE Russell/Cürex FX Benchmark Series.