RiskAggGroupStateV5
RiskAggGroupState records are published by AggRiskServer immediately if/when a position update occurs. These records are consumed by execution engines and influence child order position markup.
METADATA
Attribute | Value |
---|---|
Topic | 4740-risk-v5 |
MLink Token | ClientRisk |
Product | SRRisk |
accessType | SELECT |
Table Definition
Field | Type | Key | Default Value | Comment |
---|---|---|---|---|
secKey_at | enum - AssetType | PRI | 'None' | |
secKey_ts | enum - TickerSrc | PRI | 'None' | |
secKey_tk | VARCHAR(12) | PRI | '' | |
secKey_yr | SMALLINT UNSIGNED | PRI | 0 | |
secKey_mn | TINYINT UNSIGNED | PRI | 0 | |
secKey_dy | TINYINT UNSIGNED | PRI | 0 | |
secKey_xx | DOUBLE | PRI | 0 | |
secKey_cp | enum - CallPut | PRI | 'Call' | |
secType | enum - SpdrKeyType | PRI | 'None' | |
clientFirm | VARCHAR(16) | PRI | '' | |
aggGroup | VARCHAR(16) | PRI | '' | |
tradeDate | DATE | PRI | '1900-01-01' | |
aggGroupType | enum - AggGroupType | 'None' | ||
openPosition | INT | 0 | startofday position usually from clearing firm | |
botQuantity | INT | 0 | quantity bot today all parent executions | |
sldQuantity | INT | 0 | quantity sld today all parent executions | |
sldShortQty | INT | 0 | quantity sld short today all parent executions | |
externOpnPos | INT | 0 | startofday position extern reports | |
externBotQuan | INT | 0 | quantity bot today extern reports | |
externSldQuan | INT | 0 | quantity sld today extern reports | |
source | VARCHAR(16) | '' | source server | |
timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' |
PRIMARY KEY DEFINITION (Unique)
Field | Sequence |
---|---|
secKey_tk | 1 |
secKey_yr | 2 |
secKey_mn | 3 |
secKey_dy | 4 |
secKey_xx | 5 |
secKey_cp | 6 |
secKey_at | 7 |
secKey_ts | 8 |
secType | 9 |
clientFirm | 10 |
aggGroup | 11 |
tradeDate | 12 |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRRisk`.`MsgRiskAggGroupStateV5` (
`secKey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`secKey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`secKey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`secKey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`secKey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`secKey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`secKey_xx` DOUBLE NOT NULL DEFAULT 0,
`secKey_cp` ENUM('Call','Put','Pair') NOT NULL DEFAULT 'Call',
`secType` ENUM('None','Stock','Future','Option','MLeg') NOT NULL DEFAULT 'None',
`clientFirm` VARCHAR(16) NOT NULL DEFAULT '',
`aggGroup` VARCHAR(16) NOT NULL DEFAULT '',
`tradeDate` DATE NOT NULL DEFAULT '1900-01-01',
`aggGroupType` ENUM('None','Source','Target') NOT NULL DEFAULT 'None',
`openPosition` INT NOT NULL DEFAULT 0 COMMENT 'start-of-day position (usually from clearing firm)',
`botQuantity` INT NOT NULL DEFAULT 0 COMMENT 'quantity bot today (all parent executions)',
`sldQuantity` INT NOT NULL DEFAULT 0 COMMENT 'quantity sld today (all parent executions)',
`sldShortQty` INT NOT NULL DEFAULT 0 COMMENT 'quantity sld short today (all parent executions)',
`externOpnPos` INT NOT NULL DEFAULT 0 COMMENT 'start-of-day position (extern reports)',
`externBotQuan` INT NOT NULL DEFAULT 0 COMMENT 'quantity bot today (extern reports)',
`externSldQuan` INT NOT NULL DEFAULT 0 COMMENT 'quantity sld today (extern reports)',
`source` VARCHAR(16) NOT NULL DEFAULT '' COMMENT 'source server',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`secKey_tk`,`secKey_yr`,`secKey_mn`,`secKey_dy`,`secKey_xx`,`secKey_cp`,`secKey_at`,`secKey_ts`,`secType`,`clientFirm`,`aggGroup`,`tradeDate`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='RiskAggGroupState records are published by AggRiskServer immediately if/when a position update occurs. These records are consumed by execution engines and influence child order position markup.';
SELECT TABLE EXAMPLE QUERY
SELECT
`secKey_at`,
`secKey_ts`,
`secKey_tk`,
`secKey_yr`,
`secKey_mn`,
`secKey_dy`,
`secKey_xx`,
`secKey_cp`,
`secType`,
`clientFirm`,
`aggGroup`,
`tradeDate`,
`aggGroupType`,
`openPosition`,
`botQuantity`,
`sldQuantity`,
`sldShortQty`,
`externOpnPos`,
`externBotQuan`,
`externSldQuan`,
`source`,
`timestamp`
FROM `SRRisk`.`MsgRiskAggGroupStateV5`
WHERE
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') */
`secKey_at` = 'None'
AND
/* Replace with a ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','EUX','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFE') */
`secKey_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`secKey_tk` = 'Example_secKey_tk'
AND
/* Replace with a SMALLINT UNSIGNED */
`secKey_yr` = 123
AND
/* Replace with a TINYINT UNSIGNED */
`secKey_mn` = 1
AND
/* Replace with a TINYINT UNSIGNED */
`secKey_dy` = 1
AND
/* Replace with a DOUBLE */
`secKey_xx` = 4.56
AND
/* Replace with a ENUM('Call','Put','Pair') */
`secKey_cp` = 'Call'
AND
/* Replace with a ENUM('None','Stock','Future','Option','MLeg') */
`secType` = 'None'
AND
/* Replace with a VARCHAR(16) */
`clientFirm` = 'Example_clientFirm'
AND
/* Replace with a VARCHAR(16) */
`aggGroup` = 'Example_aggGroup'
AND
/* Replace with a DATE */
`tradeDate` = '2022-01-01';
Doc Columns Query
SELECT * FROM SRRisk.doccolumns WHERE TABLE_NAME='RiskAggGroupStateV5' ORDER BY ordinal_position ASC;