Setting up a new venue - Quod-Financial/quantreplay GitHub Wiki
This page outlines the steps to set up a new venue and run its simulation.
Let the new venue be "LSE" and the listing be "AAPL".
-
To create a new venue in the database, send a POST request /api/venues. Define all parameters. Set the
idto "LSE", and a free REST port inrestPort. -
To create a new venue in the database, send a POST /api/listings. The
venueIdmust be equal to the venue’sidcreated on the previous step. In our case, "LSE".-
A listing has to match these criteria to be resolved in order messages sent by a gateway (Order session):
-
Depending on the FIX SecurityIDSource tag (22) value, the FIX SecurityID tag (48) has to match the:
-
cusipIdwhen SecurityIDSource is CUSIP (1), -
sedolIdwhen SecurityIDSource is SEDOL (2), -
isinIdwhen SecurityIDSource is ISIN number (4), -
ricIdwhen SecurityIDSource is RIC code (5), -
exchangeSymbolIdwhen SecurityIDSource is Exchange Symbol (8), -
bloombergSymbolIdwhen SecurityIDSource is Bloomberg Symbol (A);
-
-
FIX Symbol tag (55) has to match the
symbolvalue (i.e. "AAPL"); -
FIX SecurityType (167) has to match the
securityTypevalue; -
FIX SecurityExchange (207) has to match the
securityExchangevalue;
-
-
In case SecurityIDSource and SecurityID tags are not sent in the order message, only the FIX Symbol (tag 55) has to match the
symbolvalue. -
For market data sessions, the FIX Symbol (tag 55) has to match the
symbolvalue.
-
-
If a random order generation is required for a listing, add the price seeds to the database by POST /api/priceseeds.
-
Make a copy of the existing QuantReplay and QuickFIX configuration files. Store them in the same
cfgdirectory. For instance,lse_simulator.xmlandconfigLSE.txt. -
In the QuantReplay configuration file:
-
change the value of
<mktsimulator><venue>to the new venueid. I.e. "LSE". -
change the value of
<mktsimulator><config>to the path of new QuickFIX configuration file. I.e. a full path toconfigLSE.txt.
-
-
In the QuickFIX configuration file, define a session or edit the existing one. The following parameters must be set:
-
SocketAcceptPort -
SenderCompID -
TargetCompID
-
|
Warning
|
One instance processes only one venue. Hence, to simulate several venues, the same number of QuantReplay instances must be started. |
-
Let the
restPortof the venue "LSE" be9052 -
There are two QuickFIX sessions with different
SocketAcceptPort, i.e.9053and9054.
To add a new QuantReplay instance to the Docker Compose, define it as a service like:
LSE:
image: ghcr.io/quod-financial/deploy_marketsim:latest
container_name: LSE
networks:
- market-simulator-net
ports:
- "9052:9052" # Port to send REST API requests
- "9053:9053" # Port to send FIX messages in the first session
- "9054:9054" # Port to send FIX messages in the second session
volumes:
- ./:/market-simulator/quod/data/
- ./cfg/lse_simulator.xml:/market-simulator/quod/data/cfg/market_simulator.xml
environment:
- INSTANCE_ID=LSE
- PREFIX=QUOD
depends_on:
liquibase:
condition: service_completed_successfullyAnd then restart Docker Compose.
To check the status of running simulators, send the REST API request to the restPort of the already running instance:
curl -X GET "http://localhost:9050/api/venuestatus"Invoke-RestMethod -Uri "http://localhost:9050/api/venues" -Method GET | ConvertTo-Json -Depth 100