High Level View

Here, we will give a high-level view of the system and the major components involved in fulfilling the main functionalities of the Agora Backend. Let's start with a high-level component diagram showing the major components and the data flow between any two components.

Engine High-Level View

Engine High-Level View

Below, each component is described in more detail. Please note that those components colored gray and the flows indicated by dashed gray lines are external to Agora, and they are shown only to indicate the inputs and outputs of the system.

Engine Services: It consists of several micro-services working in coordination to provide the main functionalities of the exchange system. They are hosted in a Kubernetes cluster and benefit from its HA and FT features. These groups of services make up the exchange engine's off-chain side and work hand in hand with the on-chain components to deliver various trading functions.

Engine Contracts: The system's on-chain component, consisting of a group of smart contracts deployed to the Operating EVM Blockchain that acts as the backbone of the trading engine. The matching algorithm and order management logic have been implemented in Solidity and optimized to run on any EVM blockchain. For Agora, the Operating EVM Blockchain is highly optimized for high throughputs and a speedy trading experience despite EVM blockchains being famous for low input transaction rates.

Operating EVM Blockchain: Agora's unique feature is to have its matching algorithm and settlement finality residing and executed within the context of a blockchain transaction. The immediate result is the Atomic Match and Settle feature meaning the match and the settlement happen in the same block transaction that guarantees finality and atomicity. Operating EVM Blockchain uses an EOSIO blockchain as its Layer 0 (Core). EOSIO is famous for its high throughput and low gas fees, and the EVM compatibility is provided by several off-chain components acting as Layer 1. Layer 0 is hosted on several Amazon EC2 nodes and the HA and FT are provided by the Antelope framework used to create the EOSIO blockchain. Layer 1 is deployed on Kubernetes in a HA and FT manner. We have used and modified several components from the Telos project; the fastest public EVM blockchain.

FIX Adapter: A light layer exposing FIX-compatible endpoints to serve FIX-compliant clients. This component supports FIX 4 and 5 in various versions.

A3 Provider: This component provides Authentication, Authorization, and Auditing functionality to identify and authorize various users including the logins granted to brokers and administrative personnel.

Broker Manager: This component keeps track of all registered brokers having access to trading functions. Broker Manager is also the single source of truth to know the state of the broker, enable/disable its access, or modify various settings for a certain broker. Listing a broker to use the exchange engine is a complex and mostly manual process that eventually creates a new entry in Broker Manager granting proper access.

Market Data Store: Built on top of Apache Cassandra, capable of handling millions of reads and writes per second, yet being HA and FT, it keeps all data related to any single order or trade being produced in any market provided by the engine.

In the following sections, we deep dive into each component and will illustrate its various subcomponents.