Updated March 4, 2021
OpenDAX order routing system supports different matching engines. To configure the order routing system you will need to define the matching engine driver. Each driver has different logic and defines specific orders routing.
All drivers can be divided into two categories: Local and Upstream
Before configuring upstream you will need to create an account on a corresponding external platform, top-up your external account and create an API key. For more details check the general configuration flow.
If you are going to use an upstream driver, you will also need to define a local liquidity account that will be used as a counterparty for all upstream trades. When the user's order executed externally the system creates an order in the database. That order recorded as a counterparty to the user order. That liquidity account can have a negative balance. A negative balance shows how much of a specific currency is located on an external account.
When upstream is configured your platform will fetch order book and trades information from the external platform. All orders that were created on a market pair that connected to upstream will be automatically submitted to the external platform for execution. One market pair can have only one engine.
You need to monitor and top-up external (upstream) accounts in time. If your upstream account is lacking funds all new orders will be rejected. Each trade made by an external account is recorded in your local database with a corresponding trading fee that was paid on the external platform.
If you want to check more detailed engine configuration, check the link