The Lab

Synopsis

In order for Reflector to accurately enforce risk limits, the system must have a logical method to determine the net open position (NOP) of a user at a given time. Reflector achieves this using the methods outlined below.

Overview

Reflector tracks positions in two separate places:

In the first instance, Reflector tracks the position using the actual runtime and in the second instance in an execution database. The runtime version tracks open orders in addition to executed fills, but is heavily optimized for latency. This means every possible effort to reduce memory usage is employed. At the end of the trading day, the process does not know how much to roll over.

The database, in contrast, runs at a moderate rate maintaining track of the details that relate to the identity & position of every execution. Therefore, during the rollover, a list of updates that must be applied to the reflector runtime process is computed, stored into an event log, and then executed from that log.

Calculation

Every reflector instance has an associated fill database. The database is queried for every fill that belongs to a customer or user (e.g ExampleFund Ltd) where fills are deemed eligible for entry if they are deemed valid and have not expired*. 

Note

  • Expired* as mentioned in the statement above, is taken as meaning that the accumulated positions will expire on reaching their settlement date.
  • In circumstances where the use of "Evergreen" positions are implemented, a user or customer can request that the accumulated positions never expire.

A Reflector instance can have users with either the expire at settlement definition whilst also having separate users with expiration defined as "Evergreen". However, a single user will not be able to submit orders using a combination of "Evergreen" and expire at settlement.


Reflector begins by identifying the user account, before connecting to the fill database. Reflector will then identify the relevant schema for the user before running a query for the entire set of fills (belonging to the credentials of the user that are valid and have not expired) an example of what such results may look like is displayed in the table below.


exec_idcredential_idseq_numinternalvaliditybuy_ccysell_ccybuy_amtsell_amttrade_datesettle_datevenue_namecomp_idtakerclient_idexpires_at_settlement
1232174119ftNZDEUR60114.96360002017012420170130FIX_Venue76000/109331True6792True
12342174172ftNZDEUR83491.5500002017012420170130FIX_Venue76000/109331True6792True
123452174284ftNZDEUR417382.52500002017012420170130FIX_Venue76000/109331True6792True
1234562174293ftNZDEUR83476.5500002017012420170130FIX_Venue76000/109331True6792True
12345672174294ftNZDEUR2504281500002017012420170130FIX_Venue76000/109331True6792True
123456782174737ftNZDEUR1017186.56050002017012420170130FIX_Venue76000/109331True6792True


In the example above the trades, all involve the same security pairs. Therefore, it is straightforward to determine the user's present position by creating a total of the NZD amounts and the EUR Amounts, where the user is up in NZD (upside) and down EUR (downside) as the user has orders to buy NZD and sell EUR.