### Get All Data Sources Response Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example HTTP 200 OK response containing a list of market simulator data sources. ```json { "dataSources": [ { "id" : 1, "enabled" : true, "name" : "XETRA-3", "venueId" : "XETRA", "connection" : "postgresql://develop:develop@172.16.238.3:5432/simhistoricaldb", "format" : "PSQL", "type" : "OrderBook", "repeat" : true, "tableName" : "historical_data", "columnMapping": [ { "dataSourceId" : 1, "columnFrom" : "ReceivedTimeStamp", "columnTo" : "ActionTime" }, { "dataSourceId" : 1, "columnFrom" : "MessageTimeStamp", "columnTo" : "2" }, ] }, { "id" : 2, "enabled" : false, "name" : "XETRA-CONT-1", "venueId" : "XETRA", "connection" : "/rodata/XETRA-trimmed.csv", "format" : "CSV", "type" : "OrderBook", "repeat" : true, "textDelimeter" : ";", "textHeaderRow" : 1, "textDataRow" : 2, "columnMapping" : [] } ] } ``` -------------------------------- ### Get All Data Sources Request Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example HTTP GET request to retrieve all market simulator data source entities. ```http GET /api/datasources HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Create Venue Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a successful response when creating a new venue. ```http HTTP/1.1 201 Created Connection: Keep-Alive Content-Length: XXX { "result":"Successfully inserted a new Venue" } ``` -------------------------------- ### Add Data Source Request Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a POST request to add a new market simulator data source entity. Includes configuration details like connection, format, and column mapping. ```json { "enabled" : false, "name" : "XETRA-NEW", "venueId" : "XETRA", "connection" : "/rodata/XETRA-new.csv", "format" : "CSV", "type" : "OrderBook", "repeat" : true, "textDelimiter" : ",", "textHeaderRow" : 0, "textDataRow" : 100, "columnMapping": [ { "columnFrom" : "ReceivedTimeStamp", "columnTo" : "ActionTime" } ] } ``` -------------------------------- ### Sync Price Seeds Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Demonstrates how to initiate a synchronization of price seeds from an external database. ```http POST /api/syncpriceseeds HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Update Venue Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a request to update an existing venue's settings. ```http POST /api/venues/NewExchange HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost Content-Length: XXX { "randomOrdersRate" : 12, "orderOnStartup" : true } ``` -------------------------------- ### Create Venue Negative Reply Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a negative response when attempting to create a venue. ```http HTTP/1.1 400 Bad Request Connection: Close Content-Length: XXX { "result":"Requested operation violates data integrity constraints" } ``` -------------------------------- ### Update Venue Positive Reply Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a successful response after updating a venue. ```http HTTP/1.1 200 OK Connection: Close Content-Length: XXX { "result" : "Requested update of the venue - NewExchange" } ``` -------------------------------- ### Run Docker Compose Command Source: https://github.com/quod-financial/quantreplay/blob/main/README.md This command starts the QuantReplay simulator and its dependencies in detached mode. ```bash docker compose up -d ``` -------------------------------- ### CSV Format Example 1: Default Delimiter and Header Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Demonstrates a generic CSV format with no text delimiter, a header on the first row, and data starting on the second row. ```csv col1,col2,col3,col4,col5,col6,col7 "2019-03-07 15:00:00.243",value1,"value 2","value "" 3",1,2,3 "2019-03-07 15:01:05.876",value4,"value 5","value "" 6",4,5,6 ``` -------------------------------- ### Get Multiple Price Seeds - Possible Response Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc A successful response containing a list of price seeds. Includes examples for common stock and FX spot instruments. ```http HTTP/1.1 200 OK Connection: Close Content-Length: XXX { "priceSeeds" : [ { "id" : 2, "symbol" : "DE0007664005", "securityType" : "CS", "priceCurrency" : "EUR", "securityId" : "DE0007664005", "securityIdSource" : "ISI", "instrumentSymbol" : "DE0007664005", "midPrice" : 140.0, "bidPrice" : 135.0, "offerPrice" : 145.0, "lastUpdate" : "2023-May-10 12:47:08.252739" }, { "id" : 3, "symbol" : "EUR/USD", "securityType" : "FXSPOT", "priceCurrency" : "USD", "securityId" : "", "securityIdSource" : "", "instrumentSymbol" : "EUR/USD", "midPrice" : 31.345, "bidPrice" : 30.435, "offerPrice" : 33.435, "lastUpdate" : "2023-May-10 12:47:08.252739" } ] } ``` -------------------------------- ### Start Order Generation Response Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeCommands/AdministrativeCommands.adoc Successful response indicating that random order generation has started for the current venue. ```http HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: XXX { "result" : "Random orders generator started successfully" } ``` -------------------------------- ### Get All General Settings Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves all current general settings for the market simulator. This is useful for understanding the current configuration state. ```http GET /api/settings HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Market Simulator General Settings Response Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a successful response when requesting all general settings. It lists key-value pairs for various configurations. ```json { "settings" : [ { "key":"DisplayName", "value":"SITE NAME" }, { "key" : "SeedPriceDatabaseConnection", "value" : "postgresql://user:password@1.2.3.4:1234/simdb" }, { "key" : "SeedPricesLastUpdated", "value" : "2023-09-07 12:34:55" } ] } ``` -------------------------------- ### JSON String Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Demonstrates how string values should be formatted in JSON requests and responses, including null values. ```json { "myStringProperty":"myStringValue", "myEmptyStringProperty":null } ``` -------------------------------- ### Get List of Instruments using PowerShell Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to retrieve a list of all listed instruments from the QuantReplay simulator using PowerShell. ```powershell Invoke-RestMethod -Uri "http://localhost:9050/api/listings" -Method GET | ConvertTo-Json -Depth 100 ``` -------------------------------- ### Possible Response for All Venues Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc An example response containing a list of multiple market simulator venues with their configurations. ```http HTTP/1.1 200 OK Connection: Close Content-Length: XXX { "venues": [ { "id": "FASTMATCH", "name": "FASTMATCH", "engineType": "Quoting", "supportTifIoc": true, "supportTifFok": true, "supportTifDay": true, "includeOwnOrders": true, "restPort": 9182, "orderOnStartup": false, "randomPartyCount": 10, "timeAndSalesEnabled": true, "timeAndSalesQuantityEnabled": true, "timeAndSalesSideEnabled": true, "timeAndSalesPartiesEnabled": true, "timezone" : "America/Los_Angeles", "cancelOnDisconnect": false, "persistenceEnabled" : false, "phases": [] }, { "id" : "LSE", "name" : "London Stock Exchange", "engineType" : 1, "supportTifIoc" : true, "supportTifFok" : true, "supportTifDay" : true, "includeOwnOrders" : true, "restPort":9184, "orderOnStartup" : false, "randomPartyCount" : 10, "timeAndSalesEnabled" : true, "timeAndSalesQuantityEnabled" : true, "timeAndSalesSideEnabled" : true, "timeAndSalesPartiesEnabled" : true, "timezone" : "America/Los_Angeles", "cancelOnDisconnect" : false, "persistenceEnabled" : true, "persistenceFilePath" : "/path/to/LSE-state.json" "phases" : [ { "phase" : "Open", "startTime" : "07:39:00", "endTime" : "07:39:00", "endTimeRange" : 0 }, { "phase" : "Closed", "startTime" : "09:27:00", "endTime" : "09:28:00", "endTimeRange" : 0 } ] } ] } ``` -------------------------------- ### Get List of Venues using PowerShell Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to retrieve a list of all configured venues from the QuantReplay simulator using PowerShell. ```powershell Invoke-RestMethod -Uri "http://localhost:9050/api/venues" -Method GET | ConvertTo-Json -Depth 100 ``` -------------------------------- ### Setup GTest Target Source: https://github.com/quod-financial/quantreplay/blob/main/project/fix/common/tests/CMakeLists.txt Applies Google Test specific configurations to the test target. ```cmake setup_gtest_target(${TEST_TARGET}) ``` -------------------------------- ### Get Multiple Listings Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves all market simulator listings entities currently configured. ```APIDOC ## GET /api/listings ### Description Request all market simulator listings entities. ### Method GET ### Endpoint /api/listings ### Request Example GET /api/listings HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ### Response #### Success Response (200) Returns a JSON array of listing objects. Each object contains the full details of a market simulator listing. #### Response Example [ { "id" : 1, "symbol" : "DE0007664005", "venueId" : "XETRA", "securityType" : "CS", "priceCurrency" : "EUR", "fxBaseCurrency" : "", "instrSymbol" : "DE0007664005", "securityExchange" : "XETR", "partyId" : "", "partyRole" : "", "cusipId" : "", "sedolId" : "", "isinId" : "DE0007664005", "ricId" : "", "exchangeSymbolId" : "", "bloombergSymbolId" : "", "qtyMinimum" : 1.0, "qtyMaximum" : 100000.0, "qtyMultiple" : 1.0, "priceTickSize" : 0.001, "enabled" : true, "randomQtyMinimum" : 1.0, "randomQtyMaximum" : 700.0, "randomAmtMinimum" : 0.0, "randomAmtMaximum" : 0.0, "randomDepthLevels" : 7, "randomOrdersSpread" : 0.01, "randomOrdersRate" : 7, "randomTickRange" : 100, "randomOrdersEnabled" : true, "randomAggQtyMinimum" : 2.0, "randomAggQtyMaximum" : 200.0, "randomAggAmtMinimum" : 1000.0, "randomAggAmtMaximum" : 3000.0 } ] ``` -------------------------------- ### Update Data Source Request Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a PUT request to update an existing market simulator data source entity. Only specified fields are updated. ```json { "enabled" : true, "venueId" : "XETRA", "repeat" : false } ``` -------------------------------- ### Update Venue Negative Reply Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a negative response when attempting to update a non-existent venue. ```http HTTP/1.1 404 Not Found Connection: Close Content-Length: XXX { "result":"No such venue" } ``` -------------------------------- ### Possible Reply for Multiple Listings Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc An example of a possible successful response when requesting multiple market simulator listings. ```http HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: XXX ``` -------------------------------- ### Get List of Instruments using curl Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to retrieve a list of all listed instruments from the QuantReplay simulator. ```shell curl -X GET "http://localhost:9050/api/listings" ``` -------------------------------- ### Get Multiple Data Sources Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves a list of all configured market simulator data sources. ```APIDOC ## GET /api/datasources ### Description Request all market simulator data sources entities. ### Method GET ### Endpoint /api/datasources ### Response #### Success Response (200) - **dataSources** (array) - A list of data source objects. - **id** (integer) - Unique identifier for the data source. - **enabled** (boolean) - Indicates if the data source is enabled. - **name** (string) - The name of the data source. - **venueId** (string) - The identifier for the venue. - **connection** (string) - The connection string or path for the data source. - **format** (string) - The format of the data source (e.g., CSV, PSQL). - **type** (string) - The type of data source (e.g., OrderBook). - **repeat** (boolean) - Indicates if the data source should repeat. - **tableName** (string, optional) - The table name for PSQL data sources. - **textDelimiter** (string, optional) - The delimiter for CSV data sources. - **textHeaderRow** (integer, optional) - The row number for the header in CSV data sources. - **textDataRow** (integer, optional) - The row number for the data in CSV data sources. - **columnMapping** (array) - An array of column mapping objects. - **dataSourceId** (integer) - The ID of the data source. - **columnFrom** (string) - The original column name. - **columnTo** (string) - The mapped column name. ### Response Example ```json { "dataSources": [ { "id" : 1, "enabled" : true, "name" : "XETRA-3", "venueId" : "XETRA", "connection" : "postgresql://develop:develop@172.16.238.3:5432/simhistoricaldb", "format" : "PSQL", "type" : "OrderBook", "repeat" : true, "tableName" : "historical_data", "columnMapping": [ { "dataSourceId" : 1, "columnFrom" : "ReceivedTimeStamp", "columnTo" : "ActionTime" }, { "dataSourceId" : 1, "columnFrom" : "MessageTimeStamp", "columnTo" : "2" } ] }, { "id" : 2, "enabled" : false, "name" : "XETRA-CONT-1", "venueId" : "XETRA", "connection" : "/rodata/XETRA-trimmed.csv", "format" : "CSV", "type" : "OrderBook", "repeat" : true, "textDelimeter" : ";", "textHeaderRow" : 1, "textDataRow" : 2, "columnMapping" : [] } ] } ``` ``` -------------------------------- ### Get List of Venues using curl Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to retrieve a list of all configured venues from the QuantReplay simulator. ```shell curl -X GET "http://localhost:9050/api/venues" ``` -------------------------------- ### Get Multiple Venues Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves all market simulator venue entities. ```APIDOC ## GET /api/venues ### Description Request all market simulator venue entities. ### Method GET ### Endpoint /api/venues ### Request Example ```http GET /api/venues HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` ### Response #### Success Response (200) - **venues** (array) - A list of venue objects. - **id** (string) - The unique identifier for the venue. - **name** (string) - The display name of the venue. - **engineType** (string) - The type of engine used by the venue. - **supportTifIoc** (boolean) - Indicates if IOC (Immediate Or Cancel) Time-In-Force is supported. - **supportTifFok** (boolean) - Indicates if FOK (Fill Or Kill) Time-In-Force is supported. - **supportTifDay** (boolean) - Indicates if Day Time-In-Force is supported. - **includeOwnOrders** (boolean) - Whether to include own orders in calculations. - **restPort** (integer) - The REST port for the venue. - **orderOnStartup** (boolean) - Whether orders are placed on startup. - **randomPartyCount** (integer) - The number of random parties. - **timeAndSalesEnabled** (boolean) - Whether Time and Sales is enabled. - **timeAndSalesQuantityEnabled** (boolean) - Whether Time and Sales quantity is enabled. - **timeAndSalesSideEnabled** (boolean) - Whether Time and Sales side is enabled. - **timeAndSalesPartiesEnabled** (boolean) - Whether Time and Sales parties is enabled. - **timezone** (string) - The timezone of the venue. - **cancelOnDisconnect** (boolean) - Whether to cancel orders on disconnect. - **persistenceEnabled** (boolean) - Whether persistence is enabled. - **persistenceFilePath** (string) - The file path for persistence. - **phases** (array) - A list of trading phases for the venue. - **phase** (string) - The name of the phase (e.g., Open, Closed). - **startTime** (string) - The start time of the phase. - **endTime** (string) - The end time of the phase. - **endTimeRange** (integer) - The time range for random end time during auction phase. #### Response Example ```json { "venues": [ { "id": "FASTMATCH", "name": "FASTMATCH", "engineType": "Quoting", "supportTifIoc": true, "supportTifFok": true, "supportTifDay": true, "includeOwnOrders": true, "restPort": 9182, "orderOnStartup": false, "randomPartyCount": 10, "timeAndSalesEnabled": true, "timeAndSalesQuantityEnabled": true, "timeAndSalesSideEnabled": true, "timeAndSalesPartiesEnabled": true, "timezone" : "America/Los_Angeles", "cancelOnDisconnect": false, "persistenceEnabled" : false, "phases": [] }, { "id" : "LSE", "name" : "London Stock Exchange", "engineType" : 1, "supportTifIoc" : true, "supportTifFok" : true, "supportTifDay" : true, "includeOwnOrders" : true, "restPort":9184, "orderOnStartup" : false, "randomPartyCount" : 10, "timeAndSalesEnabled" : true, "timeAndSalesQuantityEnabled" : true, "timeAndSalesSideEnabled" : true, "timeAndSalesPartiesEnabled" : true, "timezone" : "America/Los_Angeles", "cancelOnDisconnect" : false, "persistenceEnabled" : true, "persistenceFilePath" : "/path/to/LSE-state.json" "phases" : [ { "phase" : "Open", "startTime" : "07:39:00", "endTime" : "07:39:00", "endTimeRange" : 0 }, { "phase" : "Closed", "startTime" : "09:27:00", "endTime" : "09:28:00", "endTimeRange" : 0 } ] } ] } ``` ``` -------------------------------- ### Add Data Source - Positive Reply Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example HTTP 201 Created response indicating successful addition of a new data source. ```http HTTP/1.1 201 Created Connection: Close Content-Length: XXX { "result":"Successfully inserted a new datasource" } ``` -------------------------------- ### Add Venue Request Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example HTTP POST request to add a new market simulator venue entity. ```http POST /api/venues HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost Content-Length: XXX ``` -------------------------------- ### Get QuantReplay Status using PowerShell Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to check the current operational status of the QuantReplay simulator using PowerShell. ```powershell Invoke-RestMethod -Uri "http://localhost:9050/api/venuestatus" -Method GET | ConvertTo-Json -Depth 100 ``` -------------------------------- ### Update Data Source - Positive Reply Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example HTTP 200 OK response confirming a successful update of a data source. ```http HTTP/1.1 200 OK Connection: Close Content-Length: XXX { "result" : "Requested update of the data source with identifier - 1" } ``` -------------------------------- ### JSON Number Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Illustrates the formatting of numerical fields (integers and floats) in JSON, including the use of a period for decimal separators and null values. ```json { "myIntegerProperty":123, "myFloatProperty":123.456, "myEmptyNumberProperty":null } ``` -------------------------------- ### Successful Response for Single Venue Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a successful HTTP 200 OK response when retrieving a single venue, including its detailed configuration. ```http HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Content-Length: XXX { "id" : "LSE", "name" : "London Stock Exchange", "engineType" : "Matching", "supportTifIoc" : true, "supportTifFok" : true, "supportTifDay" : true, "includeOwnOrders" : true, "restPort":9184, "orderOnStartup" : false, "randomPartyCount" : 10, "timeAndSalesEnabled" : true, "timeAndSalesQuantityEnabled" : true, "timeAndSalesSideEnabled" : true, "timeAndSalesPartiesEnabled" : true, "timezone" : "America/Los_Angeles", "cancelOnDisconnect" : false, "persistenceEnabled" : true, "persistenceFilePath" : "/path/to/LSE-state.json" "phases" : [ { "phase" : "Open", "startTime" : "07:39:00", "endTime" : "07:39:00", "endTimeRange" : 0 }, { "phase" : "Closed", "startTime" : "09:27:00", "endTime" : "09:28:00", "endTimeRange" : 0 } ] } ``` -------------------------------- ### Start/Stop Order Generation Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeCommands/AdministrativeCommands.adoc Start or stop random order generation and historical data playback for the current or a specific market simulator venue instance. ```APIDOC ## POST /api/[genstart|genstop] ### Description Start or stop random order generation and historical data playback for the current market simulator venue instance. ### Method POST ### Endpoint /api/[genstart|genstop] ### Request Example ```http POST /api/genstart HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` ### Response #### Success Response (200) - **result** (Text) - Explanation of HTTP code received in response to request #### Response Example ```json { "result" : "Random orders generator started successfully" } ``` ## POST /api/[genstart|genstop]/{venueId} ### Description Start or stop random order generation and historical data playback for a specific market simulator venue instance. ### Method POST ### Endpoint /api/[genstart|genstop]/{venueId} ### Parameters #### Path Parameters - **venueId** (string) - Required - The ID of the venue instance. ### Request Example ```http POST /api/genstart/XETRA HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` ### Response #### Success Response (200) - **result** (Text) - Explanation of HTTP code received in response to request #### Response Example ```json { "result" : "Random orders generator started successfully" } ``` ``` -------------------------------- ### Sample Single Level Order Book Data Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Example data for a single level bid/ask order book, interpretable as CSV or database format. ```text ReceivedTimeStamp,MessageTimeStamp,Instrument,BidParty,BidQuantity,BidPrice,AskPrice,AskQuantity,AskParty "2019-03-07 15:00:00.243","2019-03-07 15:00:00.115","VOD.L",CP1,10,133.50,134.85,15,CP2 "2019-03-07 15:01:05.876","2019-03-07 15:01:05.203","VOD.L",CP1,10,133.50,135.83,15,CP2 "2019-03-07 15:01:14.667","2019-03-07 15:01:13.998","VOD.L",CP1,8,133.50,135.70,18,CP2 ``` -------------------------------- ### CSV Format Example 3: No Header Row Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Shows a generic CSV format with no text delimiter and no header row, where data starts from the first row. ```csv "2019-03-07 15:00:00.243",value1,"value 2","value "" 3",1,2,3 "2019-03-07 15:01:05.876",value4,"value 5","value "" 6",4,5,6 ``` -------------------------------- ### CSV Format Example 2: Semicolon Delimiter and Header Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Illustrates a CSV format using a semicolon as the text delimiter, with a header on the second row and data starting on the fourth row. ```csv col1,col2,col3,col4,col5,col6,col7 "2019-03-07 15:00:00.243";value1;"value 2";"value "" 3";1;2;3 "2019-03-07 15:01:05.876";value4;"value 5";"value "" 6";4;5;6 ``` -------------------------------- ### Get Multiple Venue Status Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeCommands/AdministrativeCommands.adoc Requests the status of all market simulator venue instances. It returns a list of venue statuses, each including ID, name, start time, version, and the HTTP status code of the last response. ```APIDOC ## GET /api/allvenuestatus ### Description Requests the status of all market simulator venue instances. ### Method GET ### Endpoint /api/allvenuestatus ### Response #### Success Response (200) - **venuestatus** (array) - A list of venue status objects. - **id** (string) - Venue short name - **name** (string) - Venue full name - **startTime** (string) - Time when the instance started - **version** (string) - Version of MktSimulator - **statusCode** (integer) - HTTP code received in response to venue status request #### Response Example ```json { "venuestatus": [ { "id":"FASTMATCH", "name":"FASTMATCH", "startTime":"2023-Feb-09 09:34:42.216182", "version":"develop.3.1675934598-87a7b61c(2023-02-09 11:23:18 +0200)", "statusCode":200 }, { "id":"XETRA", "name":"XETRA", "startTime":"2023-Feb-09 09:34:42.216182", "version":"develop.3.1675934598-87a7b61c(2023-02-09 11:23:18 +0200)", "statusCode":200 }, { "id":"BSE", "name":"BSE", "startTime":"2023-Aug-07 11:28:19.623110", "version":"3.1691404393_9ee00fc9(2023-08-07 13:33:13 +0300)", "statusCode":503 } ] } ``` ``` -------------------------------- ### Get Single Venue Status Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeCommands/AdministrativeCommands.adoc Requests the status of a specific market simulator venue instance. It returns details about the venue, including its ID, name, start time, version, and the HTTP status code of the last response. ```APIDOC ## GET /api/venuestatus/{venueId} ### Description Requests the status of a specific market simulator venue instance. ### Method GET ### Endpoint /api/venuestatus/{venueId} ### Parameters #### Path Parameters - **venueId** (string) - Required - The identifier of the venue to request the status for. ### Response #### Success Response (200) - **id** (string) - Venue short name - **name** (string) - Venue full name - **startTime** (string) - Time when the instance started - **version** (string) - Version of MktSimulator - **statusCode** (integer) - HTTP code received in response to venue status request #### Response Example ```json { "id" : "LSE", "name": "London Stock Exchange", "startTime":"2022-Feb-03 12:16:50", "version" : "99.116.15829062-734713bc (28/02/2020 17:40:18)", "statusCode" : 200 } ``` ``` -------------------------------- ### Create Benchmark Executable Source: https://github.com/quod-financial/quantreplay/blob/main/project/trading_system/components/idgen/benchmarks/CMakeLists.txt Adds the benchmark executable target and initializes it using target_init. ```cmake add_executable(${PROJECT_BENCHMARKS_NAME} idgen_benchmarks.cpp) target_init(${PROJECT_BENCHMARKS_NAME}) ``` -------------------------------- ### Docker Compose Configuration for QuantReplay Source: https://github.com/quod-financial/quantreplay/blob/main/README.md This YAML file defines the services for deploying QuantReplay, including the market simulator, database, and Liquibase. It sets up networks, ports, volumes, and environment variables for each service. ```yaml networks: market-simulator-net: driver: bridge services: XETRA: image: ghcr.io/quod-financial/deploy_marketsim:latest container_name: XETRA networks: - market-simulator-net ports: - "9050:9050" # Port to send REST API requests - "9051:9051" # Port to send FIX messages volumes: - ./:/market-simulator/quod/data/ environment: - INSTANCE_ID=XETRA - PREFIX=QUOD depends_on: liquibase: condition: service_completed_successfully database: image: ghcr.io/quod-financial/postgres_marketsim:latest container_name: market-simulator-database networks: - market-simulator-net ports: - 15432:5432 volumes: - ./database_files:/var/lib/postgresql/data environment: - POSTGRES_DB=simdb - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres healthcheck: test: [ "CMD-SHELL", "pg_isready --user=postgres --dbname=simdb" ] retries: 2 interval: 5s timeout: 10s liquibase: image: ghcr.io/quod-financial/liquibase:latest container_name: market-simulator-liquibase networks: - market-simulator-net depends_on: database: condition: service_healthy ``` -------------------------------- ### Get All General Settings Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves all general settings for the Market Simulator. This includes settings like the system display name, price seed database connection, and last update time for price seeds. ```APIDOC ## GET /api/settings ### Description Retrieves all general settings for the Market Simulator. ### Method GET ### Endpoint /api/settings ### Response #### Success Response (200) - **settings** (array) - An array of setting objects, each with a 'key' and 'value'. #### Response Example ```json { "settings" : [ { "key":"DisplayName", "value":"SITE NAME" }, { "key" : "SeedPriceDatabaseConnection", "value" : "postgresql://user:password@1.2.3.4:1234/simdb" }, { "key" : "SeedPricesLastUpdated", "value" : "2023-09-07 12:34:55" } ] } ``` ``` -------------------------------- ### HTTP GET Request Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/General/General.adoc Market Simulators use the GET request to retrieve information about a specified system resource. This method can return various response codes indicating the success or failure of the request. ```APIDOC ## HTTP GET ### Description Retrieves information about a specified system resource. ### Method GET ### Endpoint [Specify endpoint here] ### Parameters #### Path Parameters None explicitly defined in source. #### Query Parameters None explicitly defined in source. ### Request Example None explicitly defined in source. ### Response #### Success Response (200 OK) Request was successful and the response body contains the requested resource. #### Error Responses - **404 NOT FOUND**: The requested URI or resource identifier is unknown. - **412 PRECONDITION FAILED**: The value of the `X-API-Version` optional header mismatches with the simulator major version. - **500 SERVER ERROR**: Request could not be processed due to an internal server error. - **503 SERVICE UNAVAILABLE**: System is temporarily unable to process the request. Please wait and then try again. ``` -------------------------------- ### Start Order Generation (Current Venue) Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeCommands/AdministrativeCommands.adoc Initiates random order generation for the current market simulator venue. Requires an HTTP POST request to the /api/genstart endpoint. ```http POST /api/genstart HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Ensure Project Dependencies Source: https://github.com/quod-financial/quantreplay/blob/main/project/fix/common/CMakeLists.txt Verifies that required project dependencies like QuickFIX and simulator protocols are available. ```cmake ensure_project_dependency_exist(quickfix::quickfix) ensure_project_dependency_exist(simulator::protocol) ensure_project_dependency_exist(simulator::log) ``` -------------------------------- ### Get Multiple Listings Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Request all market simulator listings entities from the API. ```http GET /api/listings HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Insert New Venue using PowerShell Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to add a new venue to the QuantReplay simulator using PowerShell. Ensure the JSON payload is correctly formatted. ```powershell Invoke-RestMethod -Uri "http://localhost:9050/api/venues" -Method POST -Body '{"id": "NewExchange", "name": "NewExchange", "engineType": "Matching", "timeAndSalesEnabled": false, "supportTifIoc": false, "supportTifFok": false, "supportTifDay": false, "includeOwnOrders": false, "restPort": 9087, "orderOnStartup": true, "randomPartyCount": 1}' | ConvertTo-Json -Depth 100 ``` -------------------------------- ### Get Multiple Price Seeds Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves all market simulator price seed entities. ```APIDOC ## GET /api/priceseeds ### Description Request all market simulator price seed entities. ### Method GET ### Endpoint /api/priceseeds ### Response #### Success Response (200) - **priceSeeds** (array) - A list of price seed objects. - Each object contains: - **id** (integer) - The unique identifier of the price seed. - **symbol** (string) - The symbol for the listing. - **securityType** (string) - The type of security. - **priceCurrency** (string) - The currency of the price (ISO-4217 3-char code). - **securityId** (string) - The security ID for this listing. - **securityIdSource** (string) - The type of security ID. - **instrumentSymbol** (string) - The common symbol for this listing. - **midPrice** (decimal) - The last known mid price. - **bidPrice** (decimal) - The last known bid price. - **offerPrice** (decimal) - The last known offer price. - **lastUpdate** (DateTime) - The date and time of the last price refresh. #### Response Example ```json { "priceSeeds" : [ { "id" : 2, "symbol" : "DE0007664005", "securityType" : "CS", "priceCurrency" : "EUR", "securityId" : "DE0007664005", "securityIdSource" : "ISI", "instrumentSymbol" : "DE0007664005", "midPrice" : 140.0, "bidPrice" : 135.0, "offerPrice" : 145.0, "lastUpdate" : "2023-May-10 12:47:08.252739" }, { "id" : 3, "symbol" : "EUR/USD", "securityType" : "FXSPOT", "priceCurrency" : "USD", "securityId" : "", "securityIdSource" : "", "instrumentSymbol" : "EUR/USD", "midPrice" : 31.345, "bidPrice" : 30.435, "offerPrice" : 33.435, "lastUpdate" : "2023-May-10 12:47:08.252739" } ] } ``` ``` -------------------------------- ### Resume Market for Current Venue (HTTP) Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeCommands/AdministrativeCommands.adoc Use this command to resume market activity for the current venue. Ensure the request includes the necessary Accept header. ```http POST /api/resume HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Get Single Venue Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Retrieves a single market simulator venue entity by its ID. ```APIDOC ## GET /api/venues/{venueId} ### Description Request a single market simulator venue entity. ### Method GET ### Endpoint /api/venues/{venueId} ### Parameters #### Path Parameters - **venueId** (string) - Required - The ID of the venue to retrieve. ### Request Example ```http GET /api/venues/LSE HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` ### Response #### Success Response (200) - **id** (string) - The unique identifier for the venue. - **name** (string) - The display name of the venue. - **engineType** (string) - The type of engine used by the venue. - **supportTifIoc** (boolean) - Indicates if IOC (Immediate Or Cancel) Time-In-Force is supported. - **supportTifFok** (boolean) - Indicates if FOK (Fill Or Kill) Time-In-Force is supported. - **supportTifDay** (boolean) - Indicates if Day Time-In-Force is supported. - **includeOwnOrders** (boolean) - Whether to include own orders in calculations. - **restPort** (integer) - The REST port for the venue. - **orderOnStartup** (boolean) - Whether orders are placed on startup. - **randomPartyCount** (integer) - The number of random parties. - **timeAndSalesEnabled** (boolean) - Whether Time and Sales is enabled. - **timeAndSalesQuantityEnabled** (boolean) - Whether Time and Sales quantity is enabled. - **timeAndSalesSideEnabled** (boolean) - Whether Time and Sales side is enabled. - **timeAndSalesPartiesEnabled** (boolean) - Whether Time and Sales parties is enabled. - **timezone** (string) - The timezone of the venue. - **cancelOnDisconnect** (boolean) - Whether to cancel orders on disconnect. - **persistenceEnabled** (boolean) - Whether persistence is enabled. - **persistenceFilePath** (string) - The file path for persistence. - **phases** (array) - A list of trading phases for the venue. - **phase** (string) - The name of the phase (e.g., Open, Closed). - **startTime** (string) - The start time of the phase. - **endTime** (string) - The end time of the phase. - **endTimeRange** (integer) - The time range for random end time during auction phase. #### Response Example ```json { "id" : "LSE", "name" : "London Stock Exchange", "engineType" : "Matching", "supportTifIoc" : true, "supportTifFok" : true, "supportTifDay" : true, "includeOwnOrders" : true, "restPort":9184, "orderOnStartup" : false, "randomPartyCount" : 10, "timeAndSalesEnabled" : true, "timeAndSalesQuantityEnabled" : true, "timeAndSalesSideEnabled" : true, "timeAndSalesPartiesEnabled" : true, "timezone" : "America/Los_Angeles", "cancelOnDisconnect" : false, "persistenceEnabled" : true, "persistenceFilePath" : "/path/to/LSE-state.json" "phases" : [ { "phase" : "Open", "startTime" : "07:39:00", "endTime" : "07:39:00", "endTimeRange" : 0 }, { "phase" : "Closed", "startTime" : "09:27:00", "endTime" : "09:28:00", "endTimeRange" : 0 } ] } ``` #### Negative Reply Example (404) ```http HTTP/1.1 404 Not Found Connection: Close Content-Length: XXX { "result" : "No such venue" } ``` ``` -------------------------------- ### Insert New Venue using curl Source: https://github.com/quod-financial/quantreplay/blob/main/README.md Use this snippet to add a new venue to the QuantReplay simulator. Ensure the JSON payload is correctly formatted. ```shell curl -X POST -d '{"id": "NewExchange", "name": "NewExchange", "engineType": "Matching", "timeAndSalesEnabled": false, "supportTifIoc": false, "supportTifFok": false, "supportTifDay": false, "includeOwnOrders": false, "restPort": 9087, "orderOnStartup": true, "randomPartyCount": 1}' http://localhost:9050/api/venues ``` -------------------------------- ### Negative Response for Single Venue Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Example of a 404 Not Found response when a requested venue does not exist. ```http HTTP/1.1 404 Not Found Connection: Close Content-Length: XXX { "result" : "No such venue" } ``` -------------------------------- ### Request All Venues Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Demonstrates how to request all market simulator venue entities. ```http GET /api/venues HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Get Multiple Price Seeds Request Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Requests all market simulator price seed entities. ```http GET /api/priceseeds HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ``` -------------------------------- ### Delete Price Seed Example Source: https://github.com/quod-financial/quantreplay/blob/main/docs/RESTAPI/AdministrativeSettings/AdministrativeSettings.adoc Demonstrates how to delete a specific price seed entity using its ID. ```http DELETE /api/priceseeds/4 HTTP/1.1 Accept: application/json;charset=UTF-8 Host: localhost ```