Skip to main content
Version: 8.4.10.2

Schema: RiskCubeDetailV5 (ID: 4825)

RiskCubeDetail records are published by CoreRiskServers and are designed to be aggregated and analyzed over time.

RiskCubeDetail records are published to the SpiderRock Archive Host data pipeline at the end of each trading period.

METADATA

AttributeValue
Topic4740-risk-v5
MLink TokenClientRisk
SRSE ProductSRRisk

Note: The symbol = next to a field number indicates that it is a primary key.

BODY

#FieldTypeComment
10=accntstring(16)SR Accnt
11=secKeyOptionKey
12=secTypeenum : SecType[Call, Put, Stock, Future, Cash]
13=tradeDateDateKey
14=riskSessionenum : RiskSession
15=clientFirmstring(16)SR assigned client firm
100versionenum : RiskCubeVersion
106clearingFirmstring(8)Clearing Firm
109clearingAccntstring(16)Clearing Firm Accnt
112riskServerCodestring(6)SR RiskServer (server that published this record)
115viewGroup1string(12)Client defined view group #1 (can be fitered/aggregated)
118viewGroup2string(12)Client defined view group #2 (can be fitered/aggregated)
121viewGroup3string(12)Client defined view group #3 (can be fitered/aggregated)
124tickerTickerKeyRisk Symbol (underlier for equities; product group for future/option complexes)
127riskClassstring(8)Symbol risk class (from SymbolControl record)
130symbolTypeenum : SymbolTypeSymbol type
133betafloatbeta (usually beta to SPX; see AccountConfig.betaSource)
136betaSourceenum : BetaSource
139sectorstring(16)Client defined sector (from SymbolControl record)
142indNumintInd Num (00)
145subNumintSub Num (0000)
148grpNumintGrp Num (000000)
151nbrNumintNbr Num (00000000)
154eDaysshortdays to next earnings [-5, +30]
157dDaysshortdays to next dividend [-5, +30]
160xDeltafloatcalls = +0.5 - delta; puts = -0.5 - delta
163expCodeenum : ExpCodeTime-to-expiry code (W1, W2, M1, M2, M34, M56, M7C, Y1, Y2)
166skewCodeenum : SkewCodeSkew bucket code (Dd=Deep DownSide, Dn = DownSide, At = ATM, Up = UpSide, DU = FarUpSide)
169eDaysCodeenum : EDaysCodeDays to next earnings event (if any)
172iVolRangeenum : iVolRangeImplied ATM Vol Range
175skewDDfloatdd (deep downside) skew metric (xde < -0.30)
178skewDNfloatdn (downside) skew metric (-0.30 < xde < -0.10)
181skewATfloatat (atm) skew risk metric (-0.10 < xde < +0.10)
184skewUPfloatup (upside) skew risk metric (+0.10 < xde < +0.30)
187skewDUfloatdu (far upside) skew risk metric (+0.30 < xde)
190shOpnPosintshares (start-of-day)
193fcOpnPosintfutures contracts (start-of-day)
196cnOpnPosintoptions contracts (start-of-day)
199cnAtmEquivfloatatm equivalent contracts; (opr.cnOpnPos + opr.cnBot - opr.cnSld) * opr.ve / opr.atmVega
202shBotintshares bot
205shSldintshares sld
208shSldShrtintshares sld short
211fcBotintfuture contracts bot
214fcSldintfuture contracts sld
217cnBotintoption contracts bot
220cnSldintoption contracts sld
223cnOpenedintoption contracts opened
226cnClosedintoption contracts closed
229opnDirstring(2)open (start-of-day) direction (LN or SH)
232posDirstring(2)current (start-of-day + trades) direction (LN or SH)
235unitOpnPosinteffective opening position (shares or cn * underlierPerCn) (start-of-day)
238unitCurPosinteffective current position (shares or cn * underlierPerCn) (start-of-day + trades)
241unitQtyBotinteffective shares bot (shares or cn * underlierPerCn)
244unitQtySldinteffective shares sld (shares or cn * underlierPerCn)
247dayPnlfloatday pnl
250dayDnPnlfloatday pnl (delta neutral)
253dayTrdDeltafloatday trade delta
256dayTrdDDeltafloatday trade $delta
259dayTrdGammafloatday trade gamma
262dayTrdDGammafloatday trade $gamma
265dayTrdVegafloatday trade vega
268dayTrdWVegafloatday trade wVega (vega * vol)
271dayTrdTVegafloatday trade tVega (vega / sqrt(max(0.1, years * 4)))
274dayTrdWtVegafloatday trade wtVega (vega * vol / sqrt(max(0.1, years * 4)))
277dayTrdThetafloatday trade theta
280dayEdgeOpenedfloatday theo option edge opened (requires a theo model)
283dayEdgeClosedfloatday theo option edge closed (requires a theo model)
286dayMnyBotdoubleday money bot
289dayMnySlddoubleday money sld
292opnPnlVolMarkfloat(cur.surface - pr.surface) * cnOpnClr * upc
295opnPnlMidMarkfloat(cur.mid - pr.mid) * cnOpnClr * upc
298opnPnlClrMarkfloat(cur.mid - pr.clr) * cnOpnClr * upc
301opnMarkBrkMnyfloat(cur.surface - cur.mid) * cnOpnClr * upc
304opnTheoEdgefloatopening edge (edge at the end of prior period) (requires a theo model)
307posTheoEdgefloatcurrent edge (opening positions + trades) (requires a theo model)
310tVolMovefloatLN(tVol / tVolPr)
313tEdgeMovefloatLN(tVol / iVol) - LN(tVolPr / iVolPr)
316tEdgefloatLN(tVol / iVol)
319opnPnlDefloatopen position * mult * hedgeDe * dUPrc ( pnlSD = sum(pnlDe) [stock + futures + options] )
322opnPnlGafloatopen position * mult * 0.5 * optGamma * dUPrc * dUPrc
325opnPnlThfloatopen position * mult * optTheta * dTime
328opnPnlVefloatopen position * mult * optVega * dVol
331opnPnlVofloatopen position * mult * 0.5 * optVolga * dVol * dVol
334opnPnlVafloatopen position * mult * optVanna * dVol * dUPrc
337opnPnlSlfloatopen position * mult * vol/uPrc * slope * optVega * dUPrc
340opnPnlRatefloatopen position * mult * optRho * dRate
343opnPnlSDivfloatopen position * mult * optPhi * dSDv
346opnPnlDDivfloatopen position * mult * optPhi * dDDv
349opnPnlErrfloatunattributed pnl: SR Vol Pnl - opnPnlDe - opnPnlGa - opnPnlTh - opnPnlVe - opnPnlRat - opnPnlSDiv - opnPnlDDiv
352opnEdgeChangefloatopen position * mult * (tEdge - tEdgePr) (requires a theo model)
355posDeltafloatlive position * mult * hedgeDe
358posDDeltafloatlive position * mult * hedgeDe * UPrc
361posDBetafloatlive position * mult * hedgeDe * beta * UPrc
364posGammafloatlive position * mult * optGamma
367posDGammafloatlive position * mult * optGamma * uPrc * uPrc / 100
370posVegafloatlive position * mult * optVega
373posWVegafloatlive position * mult * optVega * iVol
376posTVegafloatlive position * mult * optVega / sqrt(max(0.1, years * 4))
379posWtVegafloatlive position * mult * optVega * iVol / sqrt(max(0.1, years * 4))
382posVolgafloatlive position * mult * optVolg
385posVannafloatlive position * mult * optVanna
388posThetafloatlive position * mult * optTheta
391posRhofloatlive position * mult * optRho
394posPhifloatlive position * mult * optPhi
397posNotionalfloatlive position * mult * uPrc
400posMktValuefloatlive position * mult * SR surface mark
403posPremOParfloatlive position * mult * premium over parity
406atmVolfloatatm volatility
409symVolfloatunderlier symbol volatility (term.21d;censored)
412srSlopefloatstrike veSlope (sr surface;options only)
415prcSVolfloatSR Surface Vol
418prcTOpxfloatSR Surface Price
421prcYOpxfloatSR Yesterday Surface Price
424prcUPrcfloatunderlier price
427prcYearsfloatyears-to-expiry
430prcRatefloatdiscount rate-to-expiry
433prcSdivfloatcontinuous stock div rate-to-expiry
436prcDdivfloatcumulative discrete dividend paid through expiry
439uPrcRatiofloatstock price multiplier
442uPrcMovefloatUnderlier price change
445iVolMovefloatImplied vol change (fixed strike ivol change from prior period)
448exDivAmtfloatestimated exDiv amount (if any)
451borrowRatefloatestimated stock borrow rate (if any)
454modelTypebyteSRPricingLib.CalcModelType
457underliersPerCnintunderliers per contract
460underlierTypeenum : UnderlierTypeunderlier type (used for option pricing)
463pointValuefloatvalue of one point
466pointCurrencyenum : Currency
469tickValuefloatvalue of one tick
472multihedgeenum : Multihedge
475multihedgeSourceTickerKeyMH Ticker Key (starts with '_') (if exists)
478multihedgePVRatiofloatpv multiplier (fraction of underlier value (uPerCn x uPrc) / SUM(uPerCn x uPrc) associated with this fragment
481spanPrcIncUpfloatdefault (exchange) span price up increment for this asset
484spanPrcIncDnfloatdefault (exchange) span price dn increment for this asset
487spanVolIncfloatdefault (exchange) span volatility increment for this asset
490prcSpanTypeenum : SpanTypeexchange prcSpan type
493volSpanTypeenum : SpanTypeexchange volSpan type
496spanPricingModelenum : SpanPricingModelExchange-defined model for SPAN option pricing calcs
499marginTypeenum : MarginTypemargin slide type: NMS_Equity = +/- 15%, NMS_Index = -8%/+6%, NMS_Medium = +/-10%
502timestampDateTime

Get Schema API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'RiskCubeDetailV5'

# Request Parameters for Get Schema Of The MsgType
params = {
#Required Parameters
"apiKey": API_KEY,
"cmd": 'getschema',
"msgType": MSG_TYPE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msg API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'RiskCubeDetailV5'

# Replace with your pkey value for getting the specific message desired
PKEY = 'ReplaceThisValueForTheQueryToWork'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned.
VIEW = 'version|clearingFirm|clearingAccnt|riskServerCode|viewGroup1|viewGroup2|viewGroup3|ticker|riskClass|symbolType|beta|betaSource|sector|indNum|subNum|grpNum|nbrNum|eDays|dDays|xDelta|expCode|skewCode|eDaysCode|iVolRange|skewDD|skewDN|skewAT|skewUP|skewDU|shOpnPos|fcOpnPos|cnOpnPos|cnAtmEquiv|shBot|shSld|shSldShrt|fcBot|fcSld|cnBot|cnSld|cnOpened|cnClosed|opnDir|posDir|unitOpnPos|unitCurPos|unitQtyBot|unitQtySld|dayPnl|dayDnPnl|dayTrdDelta|dayTrdDDelta|dayTrdGamma|dayTrdDGamma|dayTrdVega|dayTrdWVega|dayTrdTVega|dayTrdWtVega|dayTrdTheta|dayEdgeOpened|dayEdgeClosed|dayMnyBot|dayMnySld|opnPnlVolMark|opnPnlMidMark|opnPnlClrMark|opnMarkBrkMny|opnTheoEdge|posTheoEdge|tVolMove|tEdgeMove|tEdge|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlErr|opnEdgeChange|posDelta|posDDelta|posDBeta|posGamma|posDGamma|posVega|posWVega|posTVega|posWtVega|posVolga|posVanna|posTheta|posRho|posPhi|posNotional|posMktValue|posPremOPar|atmVol|symVol|srSlope|prcSVol|prcTOpx|prcYOpx|prcUPrc|prcYears|prcRate|prcSdiv|prcDdiv|uPrcRatio|uPrcMove|iVolMove|exDivAmt|borrowRate|modelType|underliersPerCn|underlierType|pointValue|pointCurrency|tickValue|multihedge|multihedgeSource|multihedgePVRatio|spanPrcIncUp|spanPrcIncDn|spanVolInc|prcSpanType|volSpanType|spanPricingModel|marginType|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:valuse" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getmsg Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsg',
"pkey": PKEY,
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msgs API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'RiskCubeDetailV5'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'version|clearingFirm|clearingAccnt|riskServerCode|viewGroup1|viewGroup2|viewGroup3|ticker|riskClass|symbolType|beta|betaSource|sector|indNum|subNum|grpNum|nbrNum|eDays|dDays|xDelta|expCode|skewCode|eDaysCode|iVolRange|skewDD|skewDN|skewAT|skewUP|skewDU|shOpnPos|fcOpnPos|cnOpnPos|cnAtmEquiv|shBot|shSld|shSldShrt|fcBot|fcSld|cnBot|cnSld|cnOpened|cnClosed|opnDir|posDir|unitOpnPos|unitCurPos|unitQtyBot|unitQtySld|dayPnl|dayDnPnl|dayTrdDelta|dayTrdDDelta|dayTrdGamma|dayTrdDGamma|dayTrdVega|dayTrdWVega|dayTrdTVega|dayTrdWtVega|dayTrdTheta|dayEdgeOpened|dayEdgeClosed|dayMnyBot|dayMnySld|opnPnlVolMark|opnPnlMidMark|opnPnlClrMark|opnMarkBrkMny|opnTheoEdge|posTheoEdge|tVolMove|tEdgeMove|tEdge|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlErr|opnEdgeChange|posDelta|posDDelta|posDBeta|posGamma|posDGamma|posVega|posWVega|posTVega|posWtVega|posVolga|posVanna|posTheta|posRho|posPhi|posNotional|posMktValue|posPremOPar|atmVol|symVol|srSlope|prcSVol|prcTOpx|prcYOpx|prcUPrc|prcYears|prcRate|prcSdiv|prcDdiv|uPrcRatio|uPrcMove|iVolMove|exDivAmt|borrowRate|modelType|underliersPerCn|underlierType|pointValue|pointCurrency|tickValue|multihedge|multihedgeSource|multihedgePVRatio|spanPrcIncUp|spanPrcIncDn|spanVolInc|prcSpanType|volSpanType|spanPricingModel|marginType|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'accnt:eq:ExampleString'

# Replace with your desired limit of how many messages you receive. The default limit is 500
LIMIT = 500

# Order clause eg. "(field1:DESC | field1:ASC | field2:DESC:ABS | field2:ASC:ABS" (default is unordered; default is faster)
ORDER = 'version:ASC'

# Request Parameters for getmsgs Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsgs',
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE,
"limit": LIMIT,
"order": ORDER
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Aggregate API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'RiskCubeDetailV5'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'version|clearingFirm|clearingAccnt|riskServerCode|viewGroup1|viewGroup2|viewGroup3|ticker|riskClass|symbolType|beta|betaSource|sector|indNum|subNum|grpNum|nbrNum|eDays|dDays|xDelta|expCode|skewCode|eDaysCode|iVolRange|skewDD|skewDN|skewAT|skewUP|skewDU|shOpnPos|fcOpnPos|cnOpnPos|cnAtmEquiv|shBot|shSld|shSldShrt|fcBot|fcSld|cnBot|cnSld|cnOpened|cnClosed|opnDir|posDir|unitOpnPos|unitCurPos|unitQtyBot|unitQtySld|dayPnl|dayDnPnl|dayTrdDelta|dayTrdDDelta|dayTrdGamma|dayTrdDGamma|dayTrdVega|dayTrdWVega|dayTrdTVega|dayTrdWtVega|dayTrdTheta|dayEdgeOpened|dayEdgeClosed|dayMnyBot|dayMnySld|opnPnlVolMark|opnPnlMidMark|opnPnlClrMark|opnMarkBrkMny|opnTheoEdge|posTheoEdge|tVolMove|tEdgeMove|tEdge|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlErr|opnEdgeChange|posDelta|posDDelta|posDBeta|posGamma|posDGamma|posVega|posWVega|posTVega|posWtVega|posVolga|posVanna|posTheta|posRho|posPhi|posNotional|posMktValue|posPremOPar|atmVol|symVol|srSlope|prcSVol|prcTOpx|prcYOpx|prcUPrc|prcYears|prcRate|prcSdiv|prcDdiv|uPrcRatio|uPrcMove|iVolMove|exDivAmt|borrowRate|modelType|underliersPerCn|underlierType|pointValue|pointCurrency|tickValue|multihedge|multihedgeSource|multihedgePVRatio|spanPrcIncUp|spanPrcIncDn|spanVolInc|prcSpanType|volSpanType|spanPricingModel|marginType|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'version|symbolType|betaSource|expCode|skewCode|eDaysCode|iVolRange|underlierType|pointCurrency|multihedge|prcSpanType|volSpanType|spanPricingModel|marginType'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getaggregate Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getaggregate',
"msgType": MSG_TYPE,
"measure": MEASURE,
"group": GROUP,
# Optional Parameters
"where": WHERE,
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Count API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'RiskCubeDetailV5'

# Replace with your desired where clause.
# a string in the form "field1:eq:value" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getCount Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getcount',
"msgType": MSG_TYPE,
# Optional Parameters
"where": WHERE,
}

response = requests.get(MLINK_PROD_URL, params=params)