Skip to main content
Version: Upcoming

OptionCalculator

V8 Message Definiton

This table allows custom option pricing based on either user or SR supplied input values.

METADATA

AttributeValue
Topic5030-srse-calculators
MLink TokenInternal
ProductSRAnalytics
accessTypeSELECT,UPDATE,INSERT,DELETE
MLink EndpointMLink-Live

Table Definition

FieldTypeKeyDefault ValueComment
userNameVARCHAR(24)PRI''
okey_atenum - AssetTypePRI'None'
okey_tsenum - TickerSrcPRI'None'
okey_tkVARCHAR(12)PRI''
okey_yrSMALLINT UNSIGNEDPRI, SEC0
okey_mnTINYINT UNSIGNEDPRI, SEC0
okey_dyTINYINT UNSIGNEDPRI, SEC0
okey_xxDOUBLEPRI0
okey_cpenum - CallPutPRI'Call'
volDOUBLE0volatility
volSrcenum - FieldSrc'Default'
uPrcDOUBLE0underlying price
uPrcSrcenum - FieldSrc'Default'
yearsDOUBLE0yearstoexpiration default uses SR volatility time value
yearsSrcenum - FieldSrc'Default'
sdivDOUBLE0continuous stock dividend using for pricing
sdivSrcenum - FieldSrc'Default'
rateDOUBLE0discount rate used for pricing
rateSrcenum - FieldSrc'Default'
exTypeenum - ExerciseType'None'exercise type of the option American or European
exTypeSrcenum - FieldSrc'Default'
effStrikeDOUBLE0effective strike used for pricing default is okeyStrike
effStrikeSrcenum - FieldSrc'Default'
symRatioDOUBLE0underlying symbol ratio for nonstandard options discrete dividend will be scaled by this factor
symRatioSrcenum - FieldSrc'Default'
divStringTINYTEXT''discrete dividend string yearsToExpiry years1amt1 years2amt2 or 1 date1amt1 date2amt2
divSrcenum - FieldSrc'Default'
modelTypeenum - CalcModelType'None'Normal or LogNormal default is product specific
modelTypeSrcenum - FieldSrc'Default'
prcFrameworkenum - PricingFramework'None'None Spot Forward Future Physical default is product specific
prcFrameworkSrcenum - FieldSrc'Default'
calcPrecisionenum - CalcPrecision'Normal'numerical precision of steps if a numerical method is used more steps will be slower to calculate
incGreeksenum - YesNo'No'
priceDOUBLE0price premium
deltaFLOAT0delta
gammaFLOAT0gamma
thetaFLOAT0theta
vegaFLOAT0vega
volgaFLOAT0volga
vannaFLOAT0vanna
rhoFLOAT0rho
phiFLOAT0phi
deDecayFLOAT0delta decay
errorVARCHAR(32)''
pricerModelVARCHAR(8)''
timestampDATETIME(6)'2000-01-01'

PRIMARY KEY DEFINITION (Unique)

FieldSequence
userName1
okey_tk2
okey_yr3
okey_mn4
okey_dy5
okey_xx6
okey_cp7
okey_at8
okey_ts9

SECONDARY INDEX (ExpirationIndex) (Not Unique)

FieldSequence
okey_yr1
okey_mn2
okey_dy3

SELECT TABLE EXAMPLE QUERY

SELECT *
FROM `SRAnalytics`.`MsgOptionCalculator`
WHERE
/* Replace with a VARCHAR(24) */
`userName` = 'Example_userName'
AND
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY','RATE') */
`okey_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','SCE','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFEC','ICEFEF','CEQT','TSX','TMX') */
`okey_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`okey_tk` = 'Example_okey_tk'
AND
/* Replace with a SMALLINT UNSIGNED */
`okey_yr` = 123
AND
/* Replace with a TINYINT UNSIGNED */
`okey_mn` = 1
AND
/* Replace with a TINYINT UNSIGNED */
`okey_dy` = 1
AND
/* Replace with a DOUBLE */
`okey_xx` = 4.56
AND
/* Replace with a ENUM('Call','Put','Pair') */
`okey_cp` = 'Call';

UPDATE TABLE EXAMPLE QUERY

UPDATE `SRAnalytics`.`MsgOptionCalculator` 
SET
/* Replace with a DOUBLE */
`vol` = 4.56,
/* Replace with a ENUM('Default','User') */
`volSrc` = 'Default',
/* Replace with a DOUBLE */
`uPrc` = 4.56,
/* Replace with a ENUM('Default','User') */
`uPrcSrc` = 'Default',
/* Replace with a DOUBLE */
`years` = 4.56,
/* Replace with a ENUM('Default','User') */
`yearsSrc` = 'Default',
/* Replace with a DOUBLE */
`sdiv` = 4.56,
/* Replace with a ENUM('Default','User') */
`sdivSrc` = 'Default',
/* Replace with a DOUBLE */
`rate` = 4.56,
/* Replace with a ENUM('Default','User') */
`rateSrc` = 'Default',
/* Replace with a ENUM('None','American','European','Asian','Cliquet') */
`exType` = 'None',
/* Replace with a ENUM('Default','User') */
`exTypeSrc` = 'Default',
/* Replace with a DOUBLE */
`effStrike` = 4.56,
/* Replace with a ENUM('Default','User') */
`effStrikeSrc` = 'Default',
/* Replace with a DOUBLE */
`symRatio` = 4.56,
/* Replace with a ENUM('Default','User') */
`symRatioSrc` = 'Default',
/* Replace with a TINYTEXT */
`divString` = 'dummy tiny text',
/* Replace with a ENUM('Default','User') */
`divSrc` = 'Default',
/* Replace with a ENUM('None','LogNormal','Normal') */
`modelType` = 'None',
/* Replace with a ENUM('Default','User') */
`modelTypeSrc` = 'Default',
/* Replace with a ENUM('None','Spot','Forward','Future','Physical') */
`prcFramework` = 'None',
/* Replace with a ENUM('Default','User') */
`prcFrameworkSrc` = 'Default',
/* Replace with a ENUM('None','Low','Normal','High','Custom') */
`calcPrecision` = 'Normal',
/* Replace with a ENUM('None','Yes','No') */
`incGreeks` = 'No',
/* Replace with a DOUBLE */
`price` = 4.56,
/* Replace with a FLOAT */
`delta` = 1.23,
/* Replace with a FLOAT */
`gamma` = 1.23,
/* Replace with a FLOAT */
`theta` = 1.23,
/* Replace with a FLOAT */
`vega` = 1.23,
/* Replace with a FLOAT */
`volga` = 1.23,
/* Replace with a FLOAT */
`vanna` = 1.23,
/* Replace with a FLOAT */
`rho` = 1.23,
/* Replace with a FLOAT */
`phi` = 1.23,
/* Replace with a FLOAT */
`deDecay` = 1.23,
/* Replace with a VARCHAR(32) */
`error` = 'Example_error',
/* Replace with a VARCHAR(8) */
`pricerModel` = 'Example_pricerModel',
/* Replace with a DATETIME(6) */
`timestamp` = '2022-01-01 12:34:56.000000'
WHERE
/* Replace with a VARCHAR(24) */
`userName` = 'Example_userName'
AND
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY','RATE') */
`okey_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','SCE','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFEC','ICEFEF','CEQT','TSX','TMX') */
`okey_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`okey_tk` = 'Example_okey_tk'
AND
/* Replace with a SMALLINT UNSIGNED */
`okey_yr` = 123
AND
/* Replace with a TINYINT UNSIGNED */
`okey_mn` = 1
AND
/* Replace with a TINYINT UNSIGNED */
`okey_dy` = 1
AND
/* Replace with a DOUBLE */
`okey_xx` = 4.56
AND
/* Replace with a ENUM('Call','Put','Pair') */
`okey_cp` = 'Call';

INSERT TABLE EXAMPLE QUERY

INSERT INTO `SRAnalytics`.`MsgOptionCalculator`(
/* Replace with a VARCHAR(24) */
`userName`,
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY','RATE') */
`okey_at`,
/* 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','SCE','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFEC','ICEFEF','CEQT','TSX','TMX') */
`okey_ts`,
/* Replace with a VARCHAR(12) */
`okey_tk`,
/* Replace with a SMALLINT UNSIGNED */
`okey_yr`,
/* Replace with a TINYINT UNSIGNED */
`okey_mn`,
/* Replace with a TINYINT UNSIGNED */
`okey_dy`,
/* Replace with a DOUBLE */
`okey_xx`,
/* Replace with a ENUM('Call','Put','Pair') */
`okey_cp`,
/* Replace with a DOUBLE */
`vol`,
/* Replace with a ENUM('Default','User') */
`volSrc`,
/* Replace with a DOUBLE */
`uPrc`,
/* Replace with a ENUM('Default','User') */
`uPrcSrc`,
/* Replace with a DOUBLE */
`years`,
/* Replace with a ENUM('Default','User') */
`yearsSrc`,
/* Replace with a DOUBLE */
`sdiv`,
/* Replace with a ENUM('Default','User') */
`sdivSrc`,
/* Replace with a DOUBLE */
`rate`,
/* Replace with a ENUM('Default','User') */
`rateSrc`,
/* Replace with a ENUM('None','American','European','Asian','Cliquet') */
`exType`,
/* Replace with a ENUM('Default','User') */
`exTypeSrc`,
/* Replace with a DOUBLE */
`effStrike`,
/* Replace with a ENUM('Default','User') */
`effStrikeSrc`,
/* Replace with a DOUBLE */
`symRatio`,
/* Replace with a ENUM('Default','User') */
`symRatioSrc`,
/* Replace with a TINYTEXT */
`divString`,
/* Replace with a ENUM('Default','User') */
`divSrc`,
/* Replace with a ENUM('None','LogNormal','Normal') */
`modelType`,
/* Replace with a ENUM('Default','User') */
`modelTypeSrc`,
/* Replace with a ENUM('None','Spot','Forward','Future','Physical') */
`prcFramework`,
/* Replace with a ENUM('Default','User') */
`prcFrameworkSrc`,
/* Replace with a ENUM('None','Low','Normal','High','Custom') */
`calcPrecision`,
/* Replace with a ENUM('None','Yes','No') */
`incGreeks`,
/* Replace with a DOUBLE */
`price`,
/* Replace with a FLOAT */
`delta`,
/* Replace with a FLOAT */
`gamma`,
/* Replace with a FLOAT */
`theta`,
/* Replace with a FLOAT */
`vega`,
/* Replace with a FLOAT */
`volga`,
/* Replace with a FLOAT */
`vanna`,
/* Replace with a FLOAT */
`rho`,
/* Replace with a FLOAT */
`phi`,
/* Replace with a FLOAT */
`deDecay`,
/* Replace with a VARCHAR(32) */
`error`,
/* Replace with a VARCHAR(8) */
`pricerModel`,
/* Replace with a DATETIME(6) */
`timestamp`
)
VALUES(
'Example_userName',
'None',
'None',
'Example_okey_tk',
123,
1,
1,
4.56,
'Call',
4.56,
'Default',
4.56,
'Default',
4.56,
'Default',
4.56,
'Default',
4.56,
'Default',
'None',
'Default',
4.56,
'Default',
4.56,
'Default',
'dummy tiny text',
'Default',
'None',
'Default',
'None',
'Default',
'Normal',
'No',
4.56,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
1.23,
'Example_error',
'Example_pricerModel',
'2022-01-01 12:34:56.000000'
);

DELETE TABLE EXAMPLE QUERY

DELETE FROM `SRAnalytics`.`MsgOptionCalculator` 
WHERE
/* Replace with a VARCHAR(24) */
`userName` = 'Example_userName'
AND
/* Replace with a ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY','RATE') */
`okey_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','SCE','ANY','CXE','DXE','NXAM','NXBR','NXLS','NXML','NXOS','NXP','EUREX','CEDX','ICEFEC','ICEFEF','CEQT','TSX','TMX') */
`okey_ts` = 'None'
AND
/* Replace with a VARCHAR(12) */
`okey_tk` = 'Example_okey_tk'
AND
/* Replace with a SMALLINT UNSIGNED */
`okey_yr` = 123
AND
/* Replace with a TINYINT UNSIGNED */
`okey_mn` = 1
AND
/* Replace with a TINYINT UNSIGNED */
`okey_dy` = 1
AND
/* Replace with a DOUBLE */
`okey_xx` = 4.56
AND
/* Replace with a ENUM('Call','Put','Pair') */
`okey_cp` = 'Call';

Doc Columns Query

SELECT * FROM SRAnalytics.doccolumns WHERE TABLE_NAME='OptionCalculator' ORDER BY ordinal_position ASC;