SpreadDefinition
METADATA
| Attribute | Value |
|---|---|
| Topic | 4335-product-definition |
| MLink Token | SpreadDefinition |
| Product | SRSpread |
| accessType | SELECT |
Table Definition
| Field | Type | Key | Default Value | Comment |
|---|---|---|---|---|
| SRspreadID | BIGINT | PRI | 0 | SR legs list hash |
| ticker_at | enum - AssetType | 'None' | underlier or product group tickerKey | |
| ticker_ts | enum - TickerSrc | 'None' | underlier or product group tickerKey | |
| ticker_tk | VARCHAR(12) | '' | underlier or product group tickerKey | |
| spreadClass | enum - SpreadClass | 'None' | option spread type | |
| securityDesc | TINYTEXT | '' | ||
| timestamp | DATETIME(6) | '1900-01-01 00:00:00.000000' | ||
| ExchSprIDsList | JSON | 'JSON_ARRAY()' | ||
| LegsList | JSON | 'JSON_ARRAY()' |
PRIMARY KEY DEFINITION (Unique)
| Field | Sequence |
|---|---|
| SRspreadID | 1 |
JSON Block (ExchSprIDsList)
| Field | Type | Comment |
|---|---|---|
| exchSprID | enum - exchSprID | unique exchange spread id |
JSON Block (LegsList)
| Field | Type | Comment |
|---|---|---|
| legSecKey | enum - legSecKey | |
| legSecType | enum - SpdrKeyType | |
| legSide | enum - BuySell | |
| legRatio | enum - legRatio | leg ratio 1 2 etc |
| refDelta | enum - refDelta | |
| refPrc | enum - refPrc |
CREATE TABLE EXAMPLE QUERY
CREATE TABLE `SRSpread`.`MsgSpreadDefinition` (
`SRspreadID` BIGINT NOT NULL DEFAULT 0 COMMENT 'SR legs list hash',
`ticker_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None' COMMENT 'underlier (or product group) tickerKey',
`ticker_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' COMMENT 'underlier (or product group) tickerKey',
`ticker_tk` VARCHAR(12) NOT NULL DEFAULT '' COMMENT 'underlier (or product group) tickerKey',
`spreadClass` ENUM('None','Stk','Fut','Call','Put','Synth','RevCon','Box','JRoll','Roll','Straddle','Strangle','CSpread','PSpread','VStrip','VSpread','HStrip','HSpread','BFly','RiskRev','Mixed','VarSwap','Pair','ExpPair','VolPair') NOT NULL DEFAULT 'None' COMMENT 'option spread type',
`securityDesc` TINYTEXT NOT NULL DEFAULT '',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
`ExchSprIDsList` JSON NOT NULL DEFAULT JSON_ARRAY() CHECK(JSON_VALID(ExchSprIDsList)),
`LegsList` JSON NOT NULL DEFAULT JSON_ARRAY() CHECK(JSON_VALID(LegsList)),
PRIMARY KEY USING HASH (`SRspreadID`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='';
SELECT TABLE EXAMPLE QUERY
SELECT
`SRspreadID`,
`ticker_at`,
`ticker_ts`,
`ticker_tk`,
`spreadClass`,
`securityDesc`,
`timestamp`,
`ExchSprIDsList`,
`LegsList`
FROM `SRSpread`.`MsgSpreadDefinition`
WHERE
/* Replace with a BIGINT */
`SRspreadID` = 1234567890;
Doc Columns Query
SELECT * FROM SRSpread.doccolumns WHERE TABLE_NAME='SpreadDefinition' ORDER BY ordinal_position ASC;