Skip to main content
Version: Upcoming

Schema: SymbolRiskSummaryV5 (ID: 4865)

SymbolRiskSummary records contain live symbol level risk aggregation of StockPositionRecord and OptionPositionRecord values.

Records are published by AggRiskServers if/when positions change and about once per minute otherwise.

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=tickerTickerKeystock ticker (eg MSFT, SPY)
11=accntstring(16)SRAccnt (SR assigned;up to 16 chars)
12=tradeDateDateKey
13=riskSessionenum : RiskSession
14=clientFirmstring(16)SR assigned client firm
106sectorstring(16)SymbolControl.sector: user defined sector code
109industryintindustry code [00000000]
112betafloatbeta (usually beta to SPX; see AccountConfig.betaSource)
115betaSourceenum : BetaSource
118uPrcdoublecurrent live underlier price (can be from risk server, tool server, or srse server)
121uMarkdoublecurrent underlier price [as of risk server record publish] [freezes at 4pm EST]
124uOpnMarkdoublestart-of-day SR underlier mark (rotated from prior day record) [corp action adjusted]
127lnDDeltadoublelong net position delta value (today; SR marks )
130shDDeltadoubleshort net position delta value (today; SR marks )
133lnStkMktValueMiddoublelong stock market value (today; SR marks)
136shStkMktValueMiddoubleshort stock market value (today; SR marks)
139optMktValueMiddoubleoption position market value (SR mid marks);=sum[opCurPosM * opr.optVolMark]
142optMktValueVoldoubleoption position market value (SR vol marks);=sum[opCurPosM * opr.optMidMark]
145shOpnPosClrintstart of period position (from custodian or clearing firm)
148shOpnPosPrvintstart of period position (expected;from SpiderRock archive)
151shOpnPosintstart of period position (effective;from either SR or CLR record)
154shBotintnumber of shares bot today
157shSldintnumber of shares sld today
160shSldShrtintnumber of shares sld short today
163shMnyBotdoubleshares money bot today
166shMnySlddoubleshares money sld today
169shBotHdgintnumber of shares bot today from open pos hedging (spdrSource=HedgeTool)
172shSldHdgintnumber of shares sld today from open pos hedging (spdrSource=HedgeTool)
175shBotTrhintnumber of shares bot today from open pos hedging (spdrSource=TradeHedge)
178shSldTrhintnumber of shares sld today from open pos hedging (spdrSource=TradeHedge)
181shBotOpnintnumber of shares bot today from open pos hedging (spdrSource=OpenHedge)
184shSldOpnintnumber of shares sld today from open pos hedging (spdrSource=OpenHedge)
187shBotTrdintnumber of shares bot today from a trade hedging source (AutoHedge or Trades loop)
190shSldTrdintnumber of shares sld today from a trade hedging source (AutoHedge or Trades loop)
193maxStkDttmDateTimemost recent timestamp of a qualifying stock execution (used to ensure risk record integrity)
196stPnlMiddoubleStock Pnl (SR Marks);=(nbbo.mid - stPrvPrc) * shOpnClr
199stPnlClrdoubleStock Pnl (CLR Marks);=(nbbo.mid - stClrPrc) * shOpnClr
202stPnlDaydoubleNet Stock Day Pnl;=sum[ (nbbo.min - fillPrice) * fillQuantity * side ]
205stDivPnldoubletotal cash paid/collected since prior period for this position (stock dividend value)
208stBorrowPnldoubletotal cash paid/collected since prior period for this position (borrow pnl; usually interest on HTB names)
211opCnAbsCurPosintabs number of option contracts (position + fills);=sum[abs(opr.cnCurPos)]
214opCnAbsOpnClrintabs number of start of period option contracts (CLR view); =sum[abs(opr.cnOpnClr)]
217opCnAbsOpnPrvintabs number of start of period option contracts (SR view); =sum[abs(opr.cnOpnPrv)]
220opCnAbsOpnPosintabs number of start of period option contracts; =sum[abs(opr.cnOpnPos)]
223opCnAbsOpnBrkintabs number of option contract start of period breaks (CLR - PRV);=sum[abs(opr.cnOpnClr - opr.cnOpnPrv)]
226opShShortintequivalent shares from short option positions
229opCnPosCallintnet number of call contracts; =sum[opr.cnOpnClr + opr.cnBot - opr.cnSld] (if call)
232opCnPosPutintnet number of call contracts; =sum[opr.cnOpnClr + opr.cnBot - opr.cnSld] (if put)
235opCnAbsPairintabs number of option contracts with CP reversals removed;=sum[abs(opr.cnOpnClr + opr.cnBot - opr.cnSld) - abs(opr.cnNetPos)]
238absAtmEquivCnfloatabs atm equivalent contracts; = sum[abs(opr.cnOpnPos + opr.cnBot - opr.cnSld) * opr.ve / opr.atmVega]
241opCnBotintnumber of option contracts bot today;=sum[opr.cnBot]
244opCnSldintnumber of option contracts sld today;=sum[opr.cnSld]
247opMnyBotdoubleoption money bot
250opMnySlddoubleoption money sld
253opPremBotfloatoption premium bot today;=sum[(max(0, opr.optVolMark - opr.loBound) * opr.pointValue) * opr.cnBot]
256opPremSldfloatoption premium sld today;=sum[(max(0, opr.optVolMark - opr.loBound) * opr.pointValue) * opr.cnSld]
259maxOptDttmDateTimeDateTime of most recent SpdrOptionExecution (if any)
262opPnlVoldoubleOption Open Pnl (SR vol marks); =sum[opr.opnPnlVolMark]
265opPnlMiddoubleOption Open Pnl (SR mid marks); =sum[opr.opnPnlMidMark]
268opPnlClrdoubleOption Open Pnl (CLR marks); =sum[opr.opnPnlClrMark]
271opPnlBrkdoubleOption Mark Break Pnl (SR vol marks to CLR marks);=sum[(opr.cnOpnClr * opr.pointValue) * (opr.optVolMark - opr.optMidMark)]
274opPnlDaydoubleOption Day Pnl;=sum[opr.dayPnl]
277opDnPnlDaydoubleOption DN Day Pnl (delta neutral);=sum[opr.dnDayPnl]
280opDayVegafloatOption Day Vega;=sum[opr.ve * (opr.cnBot - opr.cnSld) * opr.pointValue]
283opDayWVegafloatOption Day Vol Weighted Vega;=sum[opr.ve * opr.iVol * (opr.cnBot - opr.cnSld) * opr.pointvalue]
286opDayTVegafloatOption Day Time-Weighted Vega;=sum[opr.ve * / sqrt(max(0.1, opr.years * 4)) * (opr.cnBot - opr.cnSld) * opr.pointValue]
289opDayWtVegafloatOption Day Vol Time-Weighted Vega;=sum[opr.ve * (opr.iVol / sqrt(max(0.1, opr.years * 4))) * (opr.cnBot - opr.cnSld) * opr.pointValue]
292opDayThetafloatOption Day Theta;=sum[opr.th * ((opr.cnBot - opr.cnSld) * opr.pointValue)]
295opDayDeltafloatOption Day Delta;=sum[opr.de * ((opr.cnBot - opr.cnSld) * opr.underliersPerCn)]
298opTrdDeltafloatOption Trade Delta (delta fixed at time of trade);=sum[opr.trdDelta]
301pairPnlfloatAggregate Dn Pair Pnl;=sum[shNetClrM * (opr.optVolMark - opr.optOpnVolMark - opr.hedgeDePr * (opr.uMark - opr.uOpnMark))]
304contHedgePnlfloatEstimated continuous hedging pnl (open positions only) [~1 minute intervals]
307contHedgePnl1floatEstimated continuous hedging pnl (open positions only) [~10 minute intervals]
310opEdgeOpenedfloatOption Edge Opened (new risk);=sum[opr.edgeOpened]
313opEdgeClosedfloatOption Edge Closed (new risk);=sum[opr.edgeClosed]
316pnlDnfloatOption Pnl Attr: delta neutral pnl: =sum[volPnl - shClrM * dUPrc * opr.dePr]
319pnlDefloatOption Pnl Attr: delta pnl;=sum[shClrM * dUPrc * opr.dePr]
322pnlSlfloatOption Pnl Attr: slope pnl;=sum[shClrM * dUPrc * opr.vePr * opr.veSlopePr]
325pnlGafloatOption Pnl Attr: gamma pnl;=sum[shClrM * 0.5 * dUPrc * dUPrc * (opr.ga + opr.gaPr)/2]
328pnlThfloatOption Pnl Attr: theta pnl;=sum[shClrM * dTime * -opr.thPr]
331pnlVefloatOption Pnl Attr: vega pnl;=sum[shClrM * 100 * dVol * opr.vePr]
334pnlVofloatOption Pnl Attr: volga pnl;=sum[shClrM * 0.5 * 100 * 100 * dVol * dVol * opr.voPr]
337pnlVafloatOption Pnl Attr: vanna pnl;=sum[shClrM * 100 * dVol * dUPrc * opr.vaPr]
340pnlErrfloatOption Pnl Attr: error (unexplained) pnl;=sum[shClrM * (volPnl - pnlDe - pnlGa - pnlTh - pnlVe)]
343pnlRatefloatOption Pnl Attr: rate pnl;=sum[shClrM * 100 * dRate * opr.rhPr]
346pnlSDivfloatOption Pnl Attr: sdiv pnl;=sum[shClrM * 100 * dSDiv * opr.phPr]
349pnlDDivfloatOption Pnl Attr: ddiv pnl;=sum[shClrM * 100 * (opr.ddiv - opr.ddivPr) / opr.uPrc * opr.phPr]
352pnlTefloatOption Pnl Attr: theo edge pnl;=sum[shClrM * ((opr.tOpx - opr.optVolMark) - (opr.tOpxPr - opr.optOpnVolMark))]
355pctIvChangefloatOption Avg IVol Change (Numerator);=sum[abs(shClrM) * opr.ve * log(opr.iVol/opr.iVolPr)]
358pctIvVegafloatOption Avg IVol Change (Denominator);=sum[abs(shClrM) * opr.ve]
361pctTvChangefloatOption Avg TVol Change (Numerator);=sum[abs(shClrM) * opr.ve * log(opr.tVol/opr.tVolPr)]
364pctTvVegafloatOption Avg TVol Change (Denominator);=sum[abs(shClrM) * opr.ve]
367stkWidthMnyfloatStock Market Width Value;=sum[0.5 * abs(shCurPos) * (spr.stkAsk - spr.stkBid)]
370optWidthMnyfloatOption Market Width Value;=sum[0.5 * abs(shCurPosM) * (opr.optAsk - opr.optBid)]
373dayDDeltafloatDay $Delta (bot or sld;all sources) today;
376deltafloatAggregate Position Delta;=sum[shCurPos] + sum[fcCurPosM] + sum[shCurPosM * opr.de] + sum[other.delta]
379ddeltafloatAggregate Position $Delta (Delta * DDMult)
382deDecayfloatAggregate Position DeltaDecay;=sum[shCurPosM * opr.deDecay] + sum[other.deDecay]
385ddDecayfloatAggregate Position DeltaDecay(DeltaDecayDDMult)[changeinDeltaDecay (DeltaDecay * DDMult) [change in delta when one trading day (1.0/252.0) is taken out of option pricing]
388gammafloatAggregate Position Gamma;=sum[shCurPosM * opr.ga] + sum[other.gamma]
391dGammafloatAggregate Position $Gamma
394thetafloatAggregate Position Theta;=sum[shCurPosM * opr.th] + sum[other.theta]
397rhofloatAggregate Position Rho;=sum[shCurPosM * opr.rh] + sum[other.rho]
400vegafloatAggregate Position Vega;=sum[shCurPosM * opr.ve] + sum[other.vega]
403tVegafloatAggregate Position Time Weight Vega;=sum[shCurPosM * opr.ve / sqrt(max(0.1, opr.years * 4))]
406wVegafloatAggregate Position Vol Weighted Vega;=sum[shCurPosM * opr.iVol * opr.ve]
409wtVegafloatAggregate Position Vol Time Weighted Vega;=sum[shCurPosM * opr.iVol * opr.ve / sqrt(max(0.1, opr.years * 4))]
412ivolVefloatAggregate Position Avg Vol Numerator (vega weighted) (avg = ivolVe / avega); =sum[abs(shCurPosM) * opr.iVol * opr.ve]
415volgafloatAggregate Position Volga;=sum[shCurPosM * opr.vo] + sum[other.volga]
418vannafloatAggregate Position Vanna;=sum[shCurPosM * opr.va] + sum[other.vanna]
421slopefloatAggregate Position VegaDelta (uPrc/Vol correlation factor);=sum[shCurPosM * opr.sl * opr.ve] + sum[other.slope]
424avegafloatAggregate Postion Abs Vega;=sum[abs(shCurPosM ) * opr.ve]
427athetafloatAggregate Postion Abs Theta;= sum[abs(shCurPosM) * opr.th]
430hedgeGammafloatAggregate Postion Hedge Gamma (either iVol or tVol based;can go binary);=sum[shCurPos * opr.hedgeGa]
433hedgeDGammafloatAggregate Postion ($) Hedge Gamma
436premOvParfloatAggregate Position Premium Over Parity;=sum[shCurPosM * max(0, opr.optVolMark - opr.loBound)]
439simpPremOvParfloatAggregate Position Premium Over Parity Simple;=sum[shCurPosM * max(0, opr.opxMidMark - max(0, ±(strike - uprc)))]
442wtVeDdfloatAggregate Dd Time Weighted Vega; =sum[wtVega] if opr.xde < -0.30
445wtVeDnfloatAggregate Dn Time Weighted Vega; =sum[wtVega] if -0.30 <= opr.xde < -0.10
448wtVeAtfloatAggregate At Time Weighted Vega; =sum[wtVega] if abs(opr.xde) <= 0.10
451wtVeUpfloatAggregate Up Time Weighted Vega; =sum[wtVega] if +0.10 < opr.xde <= +0.30
454wtVeDufloatAggregate Du Time Weighted Vega; =sum[wtVega] if +0.30 < opr.xde
457wtVeM1floatAggregate M1 Time Weighted Vega; =sum[wtVega] if days < 10
460wtVeM2floatAggregate M2 Time Weighted Vega; =sum[wtVega] if 10 < days < 25
463wtVeM3floatAggregate M3 Time Weighted Vega; =sum[wtVega] if 25 < days < 65
466wtVeM4floatAggregate M4 Time Weighted Vega; =sum[wtVega] if 65 < days < 130
469wtVeM5floatAggregate M5 Time Weighted Vega; =sum[wtVega] if 130 < days
472pinXXfloatpin strike nearest to current uPrc (zero = none) (only exists if there are near ATM option positions expiring today)
475opnDeBelowfloatAggregate Position Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc < pinXX
478opnDeAbovefloatAggregate Position Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc > pinXX
481opnDDeBelowfloatAggregate Position ($) Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc < pinXX
484opnDDeAbovefloatAggregate Position ($) Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc > pinXX
487posDeBelowfloatAggregate Position Hedge Delta (Current Position) if liveUPrc < pinXX
490posDeAbovefloatAggregate Position Hedge Delta (Current Position) if liveUPrc > pinXX
493posDDeBelowfloatAggregate Position ($) Hedge Delta (Current Position) if liveUPrc < pinXX
496posDDeAbovefloatAggregate Position ($) Hedge Delta (Current Position) if liveUPrc > pinXX
499posHedgeDeltaExfloatAggregate Position Hedge Delta (Current Position) if exDate != today
502posHedgeDDeltaExfloatAggregate Position ($) Hedge Delta (Current Position) if exDate != today
505mmhDeltafloatAggregate Delta allocated from other symbols (multi-multihedge symbols)
508mmhContractsintAggregate Contracts allocated from other symbols (multi-multihedge symbols)
511mmhSourcestext1Allocation source string (usually mmh contracts)
514tEdgefloatAggregate $ Theo Edge;=sum[shNetPosM * (opr.tOpx - opr.optVolMark)] if opr.tVol > 0.01 and opr.tOpx > 0.0 and opr.optVolMark > 0.0
517tEdgeMultfloatAggregate Abs Net Contracts (Rev/Conv contracts removed);= sum[abs(shNetPosM)]
520tEdgePrfloatPrior Day $ Theo Edge
523tEdgeMultPrfloatPrior Day Aggregate Abs Net Contracts
526numTVolErrorsshortnumber of opr.tErr != 0 or opr.tVol < 0.01
529posTEdgeWVfloatAggregate Vol Weighted Vega (wvega) where (opr.tOpx > 0 and (opr.tOpx - opr.optVolMark) >= 0)
532negTEdgeWVfloatAggregate Vol Weighted Vega (wvega) where (opr.tOpx > 0 and (opr.tOpx - opr.optVolMark) < 0)
535badTEdgeWVfloatAggregate Vol Weighted Vega (wvega) where (opr.tOpx = 0)
538posTEdgePnlfloatAggregate Dn Pair Pnl where (opr.tOpxPr > 0 and (opr.tOpxPr - opr.priorOpxVolMark) >= 0)
541negTEdgePnlfloatAggregate Dn Pair Pnl where (opr.tOpxPr > 0 and (opr.tOpxPr - opr.priorOpxVolMark) < 0)
544badTEdgePnlfloatAggregate Dn Pair Pnl where (opr.tOpxPr = 0)
547tEdge2floatAggregate $ Theo Edge;=sum[shNetPosM * (opr.tOpx - opr.optVolMark)] if opr.tVol > 0.01 and opr.tOpx > 0.0 and opr.optVolMark > 0.0
550tEdgeMult2floatAggregate Abs Net Contracts (Rev/Conv contracts removed);= sum[abs(shNetPosM)]
553tEdgePr2floatPrior Day $ Theo Edge
556tEdgeMultPr2floatPrior Day Aggregate Abs Net Contracts
559numTVolErrors2shortnumber of opr.tErr != 0 or opr.tVol < 0.01
562posTEdgeWV2floatAggregate Vol Weighted Vega (wvega) where (opr.tOpx > 0 and (opr.tOpx - opr.optVolMark) >= 0)
565negTEdgeWV2floatAggregate Vol Weighted Vega (wvega) where (opr.tOpx > 0 and (opr.tOpx - opr.optVolMark) < 0)
568badTEdgeWV2floatAggregate Vol Weighted Vega (wvega) where (opr.tOpx = 0)
571posTEdgePnl2floatAggregate Dn Pair Pnl where (opr.tOpxPr > 0 and (opr.tOpxPr - opr.priorOpxVolMark) >= 0)
574negTEdgePnl2floatAggregate Dn Pair Pnl where (opr.tOpxPr > 0 and (opr.tOpxPr - opr.priorOpxVolMark) < 0)
577badTEdgePnl2floatAggregate Dn Pair Pnl where (opr.tOpxPr = 0)
580VaRsu90floatAggregate RiskSlide: uPrc up 90%, vol unchanged (newUPrc = uPrc * Math.Exp(+0.90))
583VaRsd90floatAggregate RiskSlide: uPrc dn 90%, vol unchanged (newUPrc = uPrc * Math.Exp(-0.90))
586VaRsu50floatAggregate RiskSlide: uPrc up 50%, vol unchanged (newUPrc = uPrc * Math.Exp(+0.50))
589VaRsd50floatAggregate RiskSlide: uPrc dn 50%, vol unchanged (newUPrc = uPrc * Math.Exp(-0.50))
592VaRsu15floatAggregate RiskSlide: uPrc up 15%, vol unchanged (newUPrc = uPrc * Math.Exp(+0.15))
595VaRsd15floatAggregate RiskSlide: uPrc dn 15%, vol unchanged (newUPrc = uPrc * Math.Exp(-0.15))
598VaRsu10floatAggregate RiskSlide: uPrc up 10%, vol unchanged (newUPrc = uPrc * Math.Exp(+0.10))
601VaRsd10floatAggregate RiskSlide: uPrc dn 10%, vol unchanged (newUPrc = uPrc * Math.Exp(-0.10))
604VaRsu06floatAggregate RiskSlide: uPrc up 6%, vol unchanged (newUPrc = uPrc * Math.Exp(+0.06))
607VaRsd08floatAggregate RiskSlide: uPrc dn 8%, vol unchanged (newUPrc = uPrc * Math.Exp(-0.08))
610VaRsu05floatAggregate RiskSlide: uPrc up 5%, vol unchanged (newUPrc = uPrc * Math.Exp(+0.05))
613VaRsd05floatAggregate RiskSlide: uPrc dn 5%, vol unchanged (newUPrc = uPrc * Math.Exp(-0.05))
616VaRsu1efloatAggregate RiskSlide: uPrc up 1x implied earn move, vol ramp out
619VaRsd1efloatAggregate RiskSlide: uPrc dn 1x implied earn move, vol ramp out
622VaRsu2efloatAggregate RiskSlide: uPrc up 2x implied earn move, vol ramp out
625VaRsd2efloatAggregate RiskSlide: uPrc dn 2x implied earn move, vol ramp out
628VaRearnfloatAggregate RiskSlide: vol earn ramp out (no uPrc move)
631VaRcashfloatAggregate RiskSlide: uPrc up 30%, vol = 0.01, 6mn deal close (delta neutral)
698marginUDnVDnfloatAggregate RiskSlide: uPrc dn, vol dn
699marginUDnVUpfloatAggregate RiskSlide: uPrc dn, vol up
700marginUUpVDnfloatAggregate RiskSlide: uPrc up, vol dn
701marginUUpVUpfloatAggregate RiskSlide: uPrc up, vol up
634stkLiqRiskfloatAggregate Equity Liquidation Risk
637optLiqRiskfloatAggregate Option Liquidation Risk
640shBotC0inthypothetical shares bot (~1 minute intervals)
643shSldC0inthypothetical shares sld
646shMnyC0floathypothetical money
649shBotC1inthypothetical shares bot (~10 minute intervals)
652shSldC1inthypothetical shares sld
655shMnyC1floathypothetical money
658opHcMin25floatsum(option haircut minimum) [$25.00/cn]
661opHcMin37floatsum(option haircut minimum) [$37.50/cn]
664haircut25floatAggregate Risk Margin (JBO): [$25 minimum;-15/+15 uPrc slides]
667haircut37floatAggregate Risk Margin (PM): [$37.50 minimum;-8/+6 uPrc slides (broad based);-15/+15 uPrc slides (non-broad based)]
670numStkErrorsbytenumber of stock positions with a computation error (should be zero)
673numOptErrorsbytenumber of options positions with a computation error (should be zero)
676updateSourceenum : R5Source
679stkMarkFlagflag : MktErrFlagStock position error flag
682optMarkFlagflag : MktErrFlagOption position error flag
685riskAlert1enum : AlertCodeRisk Alert Code: Early Exercise, etc.
688riskAlert2enum : AlertCodeRisk Alert Code: Early Exercise, etc.
691riskAlert3enum : AlertCodeRisk Alert Code: Early Exercise, etc.
694riskAlert4enum : AlertCodeRisk Alert Code: Early Exercise, etc.
697timestampDateTime

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 = 'SymbolRiskSummaryV5'

# 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 = 'SymbolRiskSummaryV5'

# 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 = 'sector|industry|beta|betaSource|uPrc|uMark|uOpnMark|lnDDelta|shDDelta|lnStkMktValueMid|shStkMktValueMid|optMktValueMid|optMktValueVol|shOpnPosClr|shOpnPosPrv|shOpnPos|shBot|shSld|shSldShrt|shMnyBot|shMnySld|shBotHdg|shSldHdg|shBotTrh|shSldTrh|shBotOpn|shSldOpn|shBotTrd|shSldTrd|maxStkDttm|stPnlMid|stPnlClr|stPnlDay|stDivPnl|stBorrowPnl|opCnAbsCurPos|opCnAbsOpnClr|opCnAbsOpnPrv|opCnAbsOpnPos|opCnAbsOpnBrk|opShShort|opCnPosCall|opCnPosPut|opCnAbsPair|absAtmEquivCn|opCnBot|opCnSld|opMnyBot|opMnySld|opPremBot|opPremSld|maxOptDttm|opPnlVol|opPnlMid|opPnlClr|opPnlBrk|opPnlDay|opDnPnlDay|opDayVega|opDayWVega|opDayTVega|opDayWtVega|opDayTheta|opDayDelta|opTrdDelta|pairPnl|contHedgePnl|contHedgePnl1|opEdgeOpened|opEdgeClosed|pnlDn|pnlDe|pnlSl|pnlGa|pnlTh|pnlVe|pnlVo|pnlVa|pnlErr|pnlRate|pnlSDiv|pnlDDiv|pnlTe|pctIvChange|pctIvVega|pctTvChange|pctTvVega|stkWidthMny|optWidthMny|dayDDelta|delta|ddelta|deDecay|ddDecay|gamma|dGamma|theta|rho|vega|tVega|wVega|wtVega|ivolVe|volga|vanna|slope|avega|atheta|hedgeGamma|hedgeDGamma|premOvPar|simpPremOvPar|wtVeDd|wtVeDn|wtVeAt|wtVeUp|wtVeDu|wtVeM1|wtVeM2|wtVeM3|wtVeM4|wtVeM5|pinXX|opnDeBelow|opnDeAbove|opnDDeBelow|opnDDeAbove|posDeBelow|posDeAbove|posDDeBelow|posDDeAbove|posHedgeDeltaEx|posHedgeDDeltaEx|mmhDelta|mmhContracts|mmhSources|tEdge|tEdgeMult|tEdgePr|tEdgeMultPr|numTVolErrors|posTEdgeWV|negTEdgeWV|badTEdgeWV|posTEdgePnl|negTEdgePnl|badTEdgePnl|tEdge2|tEdgeMult2|tEdgePr2|tEdgeMultPr2|numTVolErrors2|posTEdgeWV2|negTEdgeWV2|badTEdgeWV2|posTEdgePnl2|negTEdgePnl2|badTEdgePnl2|VaRsu90|VaRsd90|VaRsu50|VaRsd50|VaRsu15|VaRsd15|VaRsu10|VaRsd10|VaRsu06|VaRsd08|VaRsu05|VaRsd05|VaRsu1e|VaRsd1e|VaRsu2e|VaRsd2e|VaRearn|VaRcash|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|stkLiqRisk|optLiqRisk|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|opHcMin25|opHcMin37|haircut25|haircut37|numStkErrors|numOptErrors|updateSource|stkMarkFlag|optMarkFlag|riskAlert1|riskAlert2|riskAlert3|riskAlert4|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 = 'SymbolRiskSummaryV5'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'sector|industry|beta|betaSource|uPrc|uMark|uOpnMark|lnDDelta|shDDelta|lnStkMktValueMid|shStkMktValueMid|optMktValueMid|optMktValueVol|shOpnPosClr|shOpnPosPrv|shOpnPos|shBot|shSld|shSldShrt|shMnyBot|shMnySld|shBotHdg|shSldHdg|shBotTrh|shSldTrh|shBotOpn|shSldOpn|shBotTrd|shSldTrd|maxStkDttm|stPnlMid|stPnlClr|stPnlDay|stDivPnl|stBorrowPnl|opCnAbsCurPos|opCnAbsOpnClr|opCnAbsOpnPrv|opCnAbsOpnPos|opCnAbsOpnBrk|opShShort|opCnPosCall|opCnPosPut|opCnAbsPair|absAtmEquivCn|opCnBot|opCnSld|opMnyBot|opMnySld|opPremBot|opPremSld|maxOptDttm|opPnlVol|opPnlMid|opPnlClr|opPnlBrk|opPnlDay|opDnPnlDay|opDayVega|opDayWVega|opDayTVega|opDayWtVega|opDayTheta|opDayDelta|opTrdDelta|pairPnl|contHedgePnl|contHedgePnl1|opEdgeOpened|opEdgeClosed|pnlDn|pnlDe|pnlSl|pnlGa|pnlTh|pnlVe|pnlVo|pnlVa|pnlErr|pnlRate|pnlSDiv|pnlDDiv|pnlTe|pctIvChange|pctIvVega|pctTvChange|pctTvVega|stkWidthMny|optWidthMny|dayDDelta|delta|ddelta|deDecay|ddDecay|gamma|dGamma|theta|rho|vega|tVega|wVega|wtVega|ivolVe|volga|vanna|slope|avega|atheta|hedgeGamma|hedgeDGamma|premOvPar|simpPremOvPar|wtVeDd|wtVeDn|wtVeAt|wtVeUp|wtVeDu|wtVeM1|wtVeM2|wtVeM3|wtVeM4|wtVeM5|pinXX|opnDeBelow|opnDeAbove|opnDDeBelow|opnDDeAbove|posDeBelow|posDeAbove|posDDeBelow|posDDeAbove|posHedgeDeltaEx|posHedgeDDeltaEx|mmhDelta|mmhContracts|mmhSources|tEdge|tEdgeMult|tEdgePr|tEdgeMultPr|numTVolErrors|posTEdgeWV|negTEdgeWV|badTEdgeWV|posTEdgePnl|negTEdgePnl|badTEdgePnl|tEdge2|tEdgeMult2|tEdgePr2|tEdgeMultPr2|numTVolErrors2|posTEdgeWV2|negTEdgeWV2|badTEdgeWV2|posTEdgePnl2|negTEdgePnl2|badTEdgePnl2|VaRsu90|VaRsd90|VaRsu50|VaRsd50|VaRsu15|VaRsd15|VaRsu10|VaRsd10|VaRsu06|VaRsd08|VaRsu05|VaRsd05|VaRsu1e|VaRsd1e|VaRsu2e|VaRsd2e|VaRearn|VaRcash|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|stkLiqRisk|optLiqRisk|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|opHcMin25|opHcMin37|haircut25|haircut37|numStkErrors|numOptErrors|updateSource|stkMarkFlag|optMarkFlag|riskAlert1|riskAlert2|riskAlert3|riskAlert4|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 = 'sector: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 = 'SymbolRiskSummaryV5'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'sector|industry|beta|betaSource|uPrc|uMark|uOpnMark|lnDDelta|shDDelta|lnStkMktValueMid|shStkMktValueMid|optMktValueMid|optMktValueVol|shOpnPosClr|shOpnPosPrv|shOpnPos|shBot|shSld|shSldShrt|shMnyBot|shMnySld|shBotHdg|shSldHdg|shBotTrh|shSldTrh|shBotOpn|shSldOpn|shBotTrd|shSldTrd|maxStkDttm|stPnlMid|stPnlClr|stPnlDay|stDivPnl|stBorrowPnl|opCnAbsCurPos|opCnAbsOpnClr|opCnAbsOpnPrv|opCnAbsOpnPos|opCnAbsOpnBrk|opShShort|opCnPosCall|opCnPosPut|opCnAbsPair|absAtmEquivCn|opCnBot|opCnSld|opMnyBot|opMnySld|opPremBot|opPremSld|maxOptDttm|opPnlVol|opPnlMid|opPnlClr|opPnlBrk|opPnlDay|opDnPnlDay|opDayVega|opDayWVega|opDayTVega|opDayWtVega|opDayTheta|opDayDelta|opTrdDelta|pairPnl|contHedgePnl|contHedgePnl1|opEdgeOpened|opEdgeClosed|pnlDn|pnlDe|pnlSl|pnlGa|pnlTh|pnlVe|pnlVo|pnlVa|pnlErr|pnlRate|pnlSDiv|pnlDDiv|pnlTe|pctIvChange|pctIvVega|pctTvChange|pctTvVega|stkWidthMny|optWidthMny|dayDDelta|delta|ddelta|deDecay|ddDecay|gamma|dGamma|theta|rho|vega|tVega|wVega|wtVega|ivolVe|volga|vanna|slope|avega|atheta|hedgeGamma|hedgeDGamma|premOvPar|simpPremOvPar|wtVeDd|wtVeDn|wtVeAt|wtVeUp|wtVeDu|wtVeM1|wtVeM2|wtVeM3|wtVeM4|wtVeM5|pinXX|opnDeBelow|opnDeAbove|opnDDeBelow|opnDDeAbove|posDeBelow|posDeAbove|posDDeBelow|posDDeAbove|posHedgeDeltaEx|posHedgeDDeltaEx|mmhDelta|mmhContracts|mmhSources|tEdge|tEdgeMult|tEdgePr|tEdgeMultPr|numTVolErrors|posTEdgeWV|negTEdgeWV|badTEdgeWV|posTEdgePnl|negTEdgePnl|badTEdgePnl|tEdge2|tEdgeMult2|tEdgePr2|tEdgeMultPr2|numTVolErrors2|posTEdgeWV2|negTEdgeWV2|badTEdgeWV2|posTEdgePnl2|negTEdgePnl2|badTEdgePnl2|VaRsu90|VaRsd90|VaRsu50|VaRsd50|VaRsu15|VaRsd15|VaRsu10|VaRsd10|VaRsu06|VaRsd08|VaRsu05|VaRsd05|VaRsu1e|VaRsd1e|VaRsu2e|VaRsd2e|VaRearn|VaRcash|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|stkLiqRisk|optLiqRisk|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|opHcMin25|opHcMin37|haircut25|haircut37|numStkErrors|numOptErrors|updateSource|stkMarkFlag|optMarkFlag|riskAlert1|riskAlert2|riskAlert3|riskAlert4|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'betaSource|updateSource|riskAlert1|riskAlert2|riskAlert3|riskAlert4'

# 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 = 'SymbolRiskSummaryV5'

# 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)