Skip to main content

How to connect Ember to Ember

Use cases

  • Geographically distributed trading hubs (each Ember co-located with specific market)
  • Ember running Market Making algos connecting to Ember hosting the matching engine

There can be different kinds of Ember-to-Ember data exchange:

  • Market Data (prices or order book emitted by an algo can be transmitted via FIX gateway or TimeBase to algos running on a remote Ember instance)
  • Order Entry (one Ember acts as "trading venue" for another Ember over FIX gateway)
  • Custom signals (usually using TimeBase)

This article focuses on Order Entry connectivity.

Overview

The general idea is simple — use FIX connectivity to transmit order requests and events. Ember uses a state-of-the-art eFIX engine with one of the best latency characteristics among Java-based FIX engines.

Let's imagine we have two Ember stack running in New York and in Chicago and we want to send orders from NY to Chicago.

Order Source (NY)

Set up "Deltix ES" trading connector on the order emitter side. Here is a config example:

connectors {
...
EMBER_CME : ${template.connector.fix.es5} {
settings : {
senderCompId: EMBER_NY4 # (A) FIX Tag SenderCompId(49) from "initiator" side
targetCompId: DELTIX # (B) FIX Tag TargetCompId(56) from "initiator" side

host: ember-cme.internal.acme.com # (C) remote DNS name or IP address of FIX acceptor
port: 10001 # (D) port number for this FIX session

password: EV8aa147993e8c9c4424b696c698415dcf # (E) FIX LOGON(A) password (hash or reference to secret)

execBrokerId: "TWAP"
}
}
}

More information on Trade Connectors configuration can be found in Configuration Reference Guide here.

Also, make sure to read up this section on how to maintain configuration secrets like FIX session password.

Connector settings

ParameterDefault ValueDescription
cancelOnDisconnectUsed to enable or disable cancel of active orders in event of disconnect
usernameUsername
passwordPassword (Read up on using Secret storage or Password Hashing)
execBrokerIdExecBroker(76) defines order destination
useAccountfalseWhen enabled account will be passed to and received from FIX messages
sendCustomAttributestrueSend request custom attributes (6000 <= tag <= 8999) and deliver them back in order events.

Supported order attributes

KeyDescription
76ExecBroker(76)
6000 <= tag <= 8999Order custom attributes

Order Destination (Chicago)

Set up Ember FIX Order Entry gateway on the order destination side. Here is a config example:

First, set up the list of supported FIX client sessions:

gateways {
clientdb {
factory = "deltix.ember.service.gateway.clientdb.simple.SimpleGatewayClientDatabaseFactory" # for client database defined in this config file
settings {
ORD_ENTRY: [ # identifies gateway
{
senderCompId: EMBER_NY4 # (A) FIX Tag TargetCompId(49) from "acceptor" side
port: 10001 # (D) port number for this FIX session
gatewayName: ORD_ENTRY
gatewayType: FIX_ORDER_ENTRY
password: EV8aa147993e8c9c4424b696c698415dcf # (E) FIX LOGON(A) password (hash or reference to secret)
}
]
}
}

TRADE {
ORD_ENTRY {
settings {
host: "0.0.0.0" # server socket bind address (this is how host (C) is visible locally)
senderCompId: DELTIX # (B) FIX Tag SenderCompId(49) from "acceptor" side
}
}
}
}

More information on FIX Gateway configuration can be found in Configuration Reference Guide here.

Security

  • The client-server connection described above assumes the communication channel is secure. The FIX connection goes over a secure VPN cross-connect or relies on TLS termination (e.g. STUNNEL or HAPROXY on FIX client side and NLB with TLS on server side).
  • In addition, we recommend whitelisting the source IP of the FIX client as the only source that can connect to FIX server port (10001) in our example.

FIX Session schedule

In this example we did not define a FIX session schedule. We will rely on the FIX gateway's ability to perform an in-session sequence in/out number reset once it reaches 100000000 (configurable).

Order Routing

Order requests that reach the FIX gateway (Chicago site in our example) are routed to the destination specified by FIX tag ExecBroker(76). In our configuration example, we set up the trade connector in New York to send all orders to the "TWAP" destination in Chicago.

Alternatively, if you need more flexibility you can define order request router or request transformer to customize order request routing.

Testing

To validate the setup, go to the order source Ember side and try sending an order request to destination "EMBER_CME".