DMA Algorithms
When the Ember Order Management System (OMS) processes order flow, it analyzes the effect of each order. For example, it keeps track of system positions by counting each trade report (fill). Let's consider what happens when dealing with algo order flow:
- The system receives Algo Order A with a quantity 100.
- The algorithm that handles orders of type A sends a child order B to the exchange. For simplicity, let’s assume the child order quantity is also 100.
- The exchange completely fills order B (fill quantity is 100).
- The algorithm reports the complete fill of order A (fill quantity is 100).
Notice that during the execution of this algo order, the system observes two fills with a cumulative quantity 200. However, the true position on the exchange is only 100. This behavior is even more pronounced when algorithms are deployed in chains, such as when a TWAP algorithms sends orders to a SMART algorithm, which in turn sends them to the exchange.
To address this problem, the OMS employs a Direct Market Access (DMA) criteria. Only orders coming to or fills originating from DMA destinations are counted for position keeping. All trading connectors are DMA by default, as they are the destinations to reach markets.
By default, algorithms are considered non-DMA destinations. However, you can make a specific algorithm a DMA destination by adding the @DMA
annotation to the AlgorithmFactory. Good examples of DMA algorithms include a simulator of a real market or matching engine, which act as final destinations.