CREATE TABLE `SRAnalytics`.`MsgLiveExpirySurface` (
`ekey_at` ENUM('None','EQT','IDX','BND','CUR','COM','FUT','SYN','WAR','FLX','MUT','SPD','MM','MF','COIN','TOKEN','ANY') NOT NULL DEFAULT 'None',
`ekey_ts` ENUM('None','SR','NMS','CME','ICE','CFE','CBOT','NYMEX','COMEX','RUT','CIDX','ARCA','NYSE','OTC','NSDQ','MFQS','MIAX','DJI','CUSIP','ISIN','BXE','ESX','ANY','CXE','DXE','NXAM','NXBR','NXDUB','NXLS','NXLDN','NXML','NXMLT','NXOS','NXP','EUREX','CEDX','ICEFE') NOT NULL DEFAULT 'None',
`ekey_tk` VARCHAR(12) NOT NULL DEFAULT '',
`ekey_yr` SMALLINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_mn` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`ekey_dy` TINYINT UNSIGNED NOT NULL DEFAULT 0,
`surfaceType` ENUM('None','Live','PrevDay','Interp','Close','Test') NOT NULL DEFAULT 'None',
`uPrc` DOUBLE NOT NULL DEFAULT 0 COMMENT 'effective uPrc used for surface fitting',
`uPrcDriver` DOUBLE NOT NULL DEFAULT 0 COMMENT 'underlier driver (mid-market)',
`years` FLOAT NOT NULL DEFAULT 0 COMMENT 'time to expiration (in years)',
`rate` FLOAT NOT NULL DEFAULT 0 COMMENT 'average interest rate to expiration (discount rate)',
`sdiv` FLOAT NOT NULL DEFAULT 0 COMMENT 'stock dividend (borrow rate)',
`atmVol` FLOAT NOT NULL DEFAULT 0 COMMENT 'atm vol (xAxis = 0)',
`atmSlope` FLOAT NOT NULL DEFAULT 0 COMMENT 'volatility surface slope (dVol / dXAxis) @ ATM (xAxis=0)',
`fitRate` FLOAT NOT NULL DEFAULT 0,
`axisFUPrc` FLOAT NOT NULL DEFAULT 0 COMMENT 'axis FwdUPrc (fwd underlying price used to compute xAxis)',
`axisVolRT` FLOAT NOT NULL DEFAULT 0 COMMENT 'axis volatility x sqrt(years) (used to compute xAxis) [usually the minimum curve volatility]',
`skewMult` FLOAT NOT NULL DEFAULT 0 COMMENT 'sVol = skewMult * BasisSkewFn(xMult * xAxis - xShift)',
`xMult` FLOAT NOT NULL DEFAULT 0,
`xShift` FLOAT NOT NULL DEFAULT 0,
`skewC00` FLOAT NOT NULL DEFAULT 0 COMMENT 'curve coeff[0]',
`skewC01` FLOAT NOT NULL DEFAULT 0 COMMENT 'curve coeff[1]',
`skewC02` FLOAT NOT NULL DEFAULT 0,
`skewC03` FLOAT NOT NULL DEFAULT 0,
`skewC04` FLOAT NOT NULL DEFAULT 0,
`skewC05` FLOAT NOT NULL DEFAULT 0,
`skewC06` FLOAT NOT NULL DEFAULT 0,
`skewC07` FLOAT NOT NULL DEFAULT 0,
`skewC08` FLOAT NOT NULL DEFAULT 0,
`skewC09` FLOAT NOT NULL DEFAULT 0,
`skewC10` FLOAT NOT NULL DEFAULT 0,
`skewC11` FLOAT NOT NULL DEFAULT 0,
`skewC12` FLOAT NOT NULL DEFAULT 0,
`skewC13` FLOAT NOT NULL DEFAULT 0,
`skewC14` FLOAT NOT NULL DEFAULT 0,
`skewC15` FLOAT NOT NULL DEFAULT 0,
`skewC16` FLOAT NOT NULL DEFAULT 0,
`skewC17` FLOAT NOT NULL DEFAULT 0,
`skewC18` FLOAT NOT NULL DEFAULT 0,
`skewC19` FLOAT NOT NULL DEFAULT 0,
`skewC20` FLOAT NOT NULL DEFAULT 0,
`skewC21` FLOAT NOT NULL DEFAULT 0,
`skewC22` FLOAT NOT NULL DEFAULT 0,
`skewC23` FLOAT NOT NULL DEFAULT 0,
`skewC24` FLOAT NOT NULL DEFAULT 0,
`skewC25` FLOAT NOT NULL DEFAULT 0,
`skewC26` FLOAT NOT NULL DEFAULT 0,
`skewC27` FLOAT NOT NULL DEFAULT 0,
`skewC28` FLOAT NOT NULL DEFAULT 0,
`cpAdjD04` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = -4.0',
`cpAdjD03` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = -3.0',
`cpAdjD02` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = -2.0',
`cpAdjD01` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = -1.0',
`cpAdjU01` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = +1.0',
`cpAdjU02` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = +2.0',
`cpAdjU03` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = +3.0',
`cpAdjU04` FLOAT NOT NULL DEFAULT 0 COMMENT 'xAxis = +4.0',
`tradeableStatus` ENUM('None','OK','SurfaceErr','LowCCnt','LowPCnt','FitPrcErr','BidAskMiss','LowCounter','DefaultSkew','SessionMiss','BaseErr','SwitchDelay','WideMktV','WideMktP','WideUMkt','UWidthEma','CCntEma','PCntEma','VWidthEma','PWidthEma','Closed') NOT NULL DEFAULT 'None' COMMENT 'indicates whether the surface is currently tradeable or not (all server surface integrity checks pass)',
`surfaceResult` ENUM('None','OK','EOD','Init','Cache','PrevDay','NullExpIdx','NoStrikes','NoBaseCurve','BadBootAtm','NoGoodStrikes','BadAtmVol','Bootstrap','NoUPrc','NoIVols','NoModelPts','ZeroYears','NoSimpleVol','OptMktNotOpn','NoBaseSurface','UPrcOffCnt','SkewKnotCnt','Exception','AxisError','CAskFit1Err','CAskFit2Err','PAskFit1Err','PAskFit2Err','CBidFit1Err','CBidFit2Err','PBidFit1Err','PBidFit2Err','CobsSampleErr','NoPrcFit','NumStrikes','CMidFitErr','PMidFitErr','StrikeCount','VolKnotCnt','InterpError','NoAtmStrike','CobsConvexFitErr','CobsMidFitErr','ProxyError','NoOptExp','Expired','NoUnderlier','NoBaseUnderlier','InvalidUPrc','ZeroUPrc','WideUMkt','StalePrcFit','NoPrcCurves','PriceError','ConvergeFail','NoUPrcRatio','NoSDivValue') NOT NULL DEFAULT 'None',
`marketSession` ENUM('None','PreMkt','RegMkt','PostMkt','PreRegMkt','RegPostMkt','AllDay') NOT NULL DEFAULT 'None' COMMENT 'market session this surface is from',
`timestamp` DATETIME(6) NOT NULL DEFAULT '1900-01-01 00:00:00.000000',
PRIMARY KEY USING HASH (`ekey_tk`,`ekey_yr`,`ekey_mn`,`ekey_dy`,`ekey_at`,`ekey_ts`,`surfaceType`)
) ENGINE=SRSE DEFAULT CHARSET=LATIN1 COMMENT='LiveExpirySurface (surfaceType = \'Live\') records are computed and publish continuously during trading hours and represent a current best implied volatility market fit.\nSurfaceType = \'PriorDay\' records contain the `closing surface record from the prior trading period (usually from just before the last main session close).';