Skip to main content
Version: Upcoming

Schema: ProductRiskSummaryV5 (ID: 4815)

ProductRiskSummary records contain live risk aggregation of FutureRiskSummaryV5 records.

Records are published 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=tickerTickerKey
11=accntstring(16)
12=tradeDateDateKey
13=riskSessionenum : RiskSession
14=clientFirmstring(16)SR assigned client firm
106lnDDeltadoublelong net position delta value (today; SR marks )
109shDDeltadoubleshort net position delta value (today; SR marks )
112futMktValueMiddoublefuture position market value (today; SR mid marks)
115optMktValueMiddoubleoption position market value (SR mid marks); =sum[opCurPosM * opr.optVolMark]
118optMktValueVoldoubleoption position market value (SR vol marks); =sum[opCurPosM * opr.optMidMark]
121fcAbsCurPosintabs number of future contracts (position + fills);=sum[abs(fpr.cnCurPos)]
124fcAbsOpnClrintabs number of start of period future contracts (CLR view);=sum[abs(fpr.cnOpnClr)]
127fcAbsOpnPrvintabs number of start of period future contracts (SR view);=sum[abs(fpr.cnOpnPrv)]
130fcAbsOpnPosintabs number of start of period future contracts (effective);=sum[abs(fpr.cnOpnPos)]
133fcAbsOpnBrkintabs number of future contract start of period breaks (CLR - PRV);=sum[abs(fpr.cnOpnClr - fpr.cnOpnPrv)]
136fcNetCurPosintnet future contract position;=sum[fpr.cnOpnClr + fpr.cnBot - fpr.cnSld]
139fcBotintnumber of futures contracts bot today;=sum(frr.cnBot)
142fcSldintnumber of futures contracts sld today;=sum(frr.cnSld)
145fcBotHdgintnumber of contracts bot today from hedging (spdrSource=HedgeTool)
148fcSldHdgintnumber of contracts sld today from hedging (spdrSource=HedgeTool)
151fcBotTrhintnumber of contracts bot today from hedging (spdrSource=TradeHedge)
154fcSldTrhintnumber of contracts sld today from hedging (spdrSource=TradeHedge)
157fcBotOpnintnumber of contracts bot today from hedging (spdrSource=OpenHedge)
160fcSldOpnintnumber of contracts sld today from hedging (spdrSource=OpenHedge)
163fcBotTrdintnumber of contracts bot today from a trade hedging source (AutoHedge or Trades loop)
166fcSldTrdintnumber of contracts sld today from a trade hedging source (AutoHedge or Trades loop)
169fcMnyBotdoublefutures money bot today
172fcMnySlddoublefutures money sld today
175maxFutDttmDateTimeDateTime of most recent SpdrFuturenExecution (if any)
178fcPnlMidfloatFutures Open Pnl (SR marks); =sum[fpr.cnOpnClr * fpr.unitsPerCn * (fpr.futMark - fpr.futOpnMidMark]
181fcPnlClrfloatFutures Open Pnl (CLR marks); =sum[fpr.cnOpnClr * fpr.unitsPerCn * (fpr.futMark - fpr.futOpnClrMark]
184fcPnlDayfloatFutures Day Pnl;=sum(fpr.dayPnl)
187opCnAbsCurPosintabs number of option contracts (position + fills);=sum[abs(opr.cnCurPos)]
190opCnAbsOpnClrintabs number of start of period option contracts (CLR view); =sum[abs(opr.cnOpnClr)]
193opCnAbsOpnPrvintabs number of start of period option contracts (SR view); =sum[abs(opr.cnOpnPrv)]
196opCnAbsOpnPosintabs number of start of period option contracts; =sum[abs(opr.cnOpnPos)]
199opCnAbsOpnBrkintabs number of option contract start of period breaks (CLR - PRV);=sum[abs(opr.cnOpnClr - opr.cnOpnPrv)]
202opCnPosCallintnet number of call contracts;=sum[opr.cnOpnClr + opr.cnBot - opr.cnSld] (if call)
205opCnPosPutintnet number of call contracts;=sum[opr.cnOpnClr + opr.cnBot - opr.cnSld] (if put)
208opCnAbsPairintabs number of option contracts with CP reversals removed; =sum[abs(opr.cnOpnClr + opr.cnBot - opr.cnSld) - abs(opr.cnNetPos)]
211opCnAbsAtmEquivfloatabs atm equivalent contracts; = sum[abs(opr.cnOpnPos + opr.cnBot - opr.cnSld) * opr.ve / opr.atmVega]
214opCnBotintnumber of option contracts bot today;=sum[opr.cnBot]
217opCnSldintnumber of option contracts sld today;=sum[opr.cnSld]
220opMnyBotdoubleoption money bot
223opMnySlddoubleoption money sld
226opPremBotfloatoption premium bot today;=sum[(max(0, opr.optVolMark - opr.loBound) * opr.pointValue) * opr.cnBot]
229opPremSldfloatoption premium sld today;=sum[(max(0, opr.optVolMark - opr.loBound) * opr.pointValue) * opr.cnSld]
232maxOptDttmDateTimeDateTime of most recent SpdrOptionExecution (if any)
235opPnlVoldoubleOption Open Pnl (SR vol marks); =sum[opr.opnPnlVolMark]
238opPnlMiddoubleOption Open Pnl (SR mid marks); =sum[opr.opnPnlMidMark]
241opPnlClrdoubleOption Open Pnl (CLR marks); =sum[opr.opnPnlClrMark]
244opPnlBrkfloatOption Mark Break (catch-up) Pnl (SR vol marks to CLR marks);=sum[(opr.cnOpnClr * opr.pointValue) * (opr.optVolMark - opr.optClrMark)]
247opPnlDayfloatOption Day Pnl;=sum[opr.dayPnl]
250opDnPnlDayfloatOption DN Day Pnl (delta neutral);=sum[opr.dnDayPnl]
253opDayVegafloatoption vega traded today
256opDayWVegafloatoption (vol weighted) vega traded today
259opDayTVegafloatoption (time weighted) vega traded today
262opDayWtVegafloatoption (vol time weighted) vega traded today
265opDayThetafloatOption Day Theta;=sum[opr.th * ((opr.cnBot - opr.cnSld) * opr.pointValue)]
268opDayDeltafloatOption Day Delta;=sum[opr.de * ((opr.cnBot - opr.cnSld) * opr.underliersPerCn)]
271opTrdDeltafloatOption Trade Delta (delta fixed at time of trade);=sum[opr.trdDelta]
274contHedgePnlfloatEstimated continuous hedging pnl (open positions only) [~1 minute intervals]
277contHedgePnl1floatEstimated continuous hedging pnl (open positions only) [~10 minute intervals]
280opEdgeOpenedfloatOption Edge Opened (new risk);=sum[opr.edgeOpened]
283opEdgeClosedfloatOption Edge Closed (new risk);=sum[opr.edgeClosed]
286pnlDnfloatOption Pnl Attr: delta neutral pnl: =sum[volPnl - shClrM * dUPrc * opr.dePr]
289pnlDefloatOption Pnl Attr: delta pnl;=sum[shClrM * dUPrc * opr.dePr]
292pnlSlfloatOption Pnl Attr: slope pnl;=sum[shClrM * dUPrc * opr.vePr * opr.slPr]
295pnlGafloatOption Pnl Attr: gamma pnl;=sum[shClrM * 0.5 * dUPrc * dUPrc * (opr.ga + opr.gaPr)/2]
298pnlThfloatOption Pnl Attr: theta pnl;=sum[shClrM * dTime * -opr.thPr]
301pnlVefloatOption Pnl Attr: vega pnl;=sum[shClrM * 100 * dVol * opr.vePr]
304pnlVofloatOption Pnl Attr: volga pnl;=sum[shClrM * 0.5 * 100 * 100 * dVol * dVol * opr.voPr]
307pnlVafloatOption Pnl Attr: vanna pnl;=sum[shClrM * 100 * dVol * dUPrc * opr.vaPr]
310pnlErrfloatOption Pnl Attr: error (unexplained) pnl;=sum[shClrM * (volPnl - pnlDe - pnlGa - pnlTh - pnlVe)]
313pnlRatefloatOption Pnl Attr: rate pnl;=sum[shClrM * 100 * dRate * opr.rhPr]
316pnlSDivfloatOption Pnl Attr: sdiv pnl;=sum[shClrM * 100 * dSDiv * opr.phPr]
319pnlDDivfloatOption Pnl Attr: ddiv pnl;=sum[shClrM * 100 * (opr.ddiv - opr.ddivPr) / opr.uPrc * opr.phPr]
322pnlTefloatOption Pnl Attr: theo edge pnl;=sum[shClrM * ((opr.tOpx - opr.optVolMark) - (opr.tOpxPr - opr.optOpnVolMark))]
325pctIvChangefloatOption Avg IVol Change (Numerator);=sum[abs(shClrM) * opr.ve * log(opr.iVol/opr.iVolPr)]
328pctIvVegafloatOption Avg IVol Change (Denominator);=sum[abs(shClrM) * opr.ve]
331pctTvChangefloatOption Avg TVol Change (Numerator);=sum[abs(shClrM) * opr.ve * log(opr.tVol/opr.tVolPr)]
334pctTvVegafloatOption Avg TVol Change (Denominator);=sum[abs(shClrM) * opr.ve]
337futWidthMnyfloatFuture Market Width Value;=sum[0.5 * abs(fcCurPosM) * (fpr.futAsk - fpr.futBid)]
340optWidthMnyfloatOption Market Width Value;=sum[0.5 * abs(shCurPosM) * (opr.optAsk - opr.optBid)]
343dayDDeltafloatDay $Delta (bot or sld;all sources) today;
346deltafloatAggregate Position Delta;=sum[shCurPos] + sum[fcCurPosM] + sum[shCurPosM * opr.de] + sum[other.delta]
349ddeltafloatAggregate Position $Delta (Delta * DDMult)
352deDecayfloatAggregate Position DeltaDecay;=sum[shCurPosM * opr.deDecay] + sum[other.deDecay]
355ddDecayfloatAggregate Position DeltaDecay(DeltaDecayDDMult)[changeinDeltaDecay (DeltaDecay * DDMult) [change in delta when one trading day (1.0/252.0) is taken out of option pricing]
358gammafloatAggregate Position Gamma;=sum[shCurPosM * opr.ga] + sum[other.gamma]
361dGammafloatAggregate Position $Gamma
364thetafloatAggregate Position Theta;=sum[shCurPosM * opr.th] + sum[other.theta]
367rhofloatAggregate Position Rho;=sum[shCurPosM * opr.rh] + sum[other.rho]
370vegafloatAggregate Position Vega;=sum[shCurPosM * opr.ve] + sum[other.vega]
373tVegafloatAggregate Position Time Weight Vega;=sum[shCurPosM * opr.ve / sqrt(max(0.1, opr.years * 4))]
376wVegafloatAggregate Position Vol Weighted Vega;=sum[shCurPosM * opr.iVol * opr.ve]
379wtVegafloatAggregate Position Vol Time Weighted Vega;=sum[shCurPosM * opr.iVol * opr.ve / sqrt(max(0.1, opr.years * 4))]
382ivolVefloatAggregate Position Avg Vol Numerator (vega weighted) (avg = ivolVe / avega);=sum[abs(shCurPosM) * opr.iVol * opr.ve]
385volgafloatAggregate Position Volga;=sum[shCurPosM * opr.vo] + sum[other.volga]
388vannafloatAggregate Position Vanna;=sum[shCurPosM * opr.va] + sum[other.vanna]
391slopefloatAggregate Position VegaDelta (uPrc/Vol correlation factor);=sum[shCurPosM * opr.sl * opr.ve] + sum[other.slope]
394avegafloatAggregate Postion Abs Vega;=sum[abs(shCurPosM ) * opr.ve]
397athetafloatAggregate Postion Abs Theta;= sum[abs(shCurPosM) * opr.th]
400hedgeGammafloatAggregate Postion Hedge Gamma (either iVol or tVol based;can go binary);=sum[shCurPos * opr.hedgeGa]
403hedgeDGammafloatAggregate Postion Hedge $Gamma
406premOvParfloatAggregate Position Premium Over Parity;=sum[shCurPosM * max(0, opr.optVolMark - opr.loBound)]
409wtVeDdfloatAggregate Dd Time Weighted Vega;=sum[wtVega] if opr.xde < -0.30
412wtVeDnfloatAggregate Dn Time Weighted Vega;=sum[wtVega] if -0.30 <= opr.xde < -0.10
415wtVeAtfloatAggregate At Time Weighted Vega;=sum[wtVega] if abs(opr.xde) <= 0.10
418wtVeUpfloatAggregate Up Time Weighted Vega;=sum[wtVega] if +0.10 < opr.xde <= +0.30
421wtVeDufloatAggregate Du Time Weighted Vega;=sum[wtVega] if +0.30 < opr.xde
424wtVeM1floatAggregate M1 Time Weighted Vega; =sum[wtVega] if days < 10
427wtVeM2floatAggregate M2 Time Weighted Vega; =sum[wtVega] if 10 < days < 25
430wtVeM3floatAggregate M3 Time Weighted Vega; =sum[wtVega] if 25 < days < 65
433wtVeM4floatAggregate M4 Time Weighted Vega; =sum[wtVega] if 65 < days < 130
436wtVeM5floatAggregate M5 Time Weighted Vega; =sum[wtVega] if 130 < days
439opnDeltafloatAggregate Position Open Delta (Open Positions + Open Hedge Trades Only)
442opnDDeltafloatAggregate Position ($) Open Delta (Open Positions + Open Hedge Trades Only)
445posDeltafloatAggregate Position Hedge Delta (Current Position)
448posDDeltafloatAggregate Position Hedge Delta (Current Position)
581pinXXfloatPin Strike nearest to current uPrc (zero = none) (only exists near expirations)
582opnDeBelowfloatAggregate Position Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc < pinXX
583opnDeAbovefloatAggregate Position Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc > pinXX
584opnDDeBelowfloatAggregate Position ($) Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc < pinXX
585opnDDeAbovefloatAggregate Position ($) Open Delta (Open Positions + Open Hedge Trades Only) if liveUPrc > pinXX
586posDeBelowfloatAggregate Position Hedge Delta (Current Position) if liveUPrc < pinXX
587posDeAbovefloatAggregate Position Hedge Delta (Current Position) if liveUPrc > pinXX
588posDDeBelowfloatAggregate Position Hedge Delta (Current Position) if liveUPrc < pinXX
589posDDeAbovefloatAggregate Position Hedge Delta (Current Position) if liveUPrc > pinXX
451posHedgeDeltaExfloatAggregate Position Hedge Delta (Current Position) if exDate != today
454posHedgeDDeltaExfloatAggregate Position ($) Hedge Delta (Current Position) if exDate != today
457tEdgefloatAggregate $ Theo Edge;=sum[shNetPosM * (opr.tOpx - opr.optVolMark)] if opr.tVol > 0.01 and opr.tOpx > 0.0 and opr.optVolMark > 0.0
460tEdgeMultfloatAggregate Abs Net Contracts (Rev/Conv contracts removed);= sum[abs(shNetPosM)]
463tEdgePrfloatPrior Day $ Theo Edge
466tEdgeMultPrfloatPrior Day Aggregate Abs Net Contracts
469numTVolErrorsshortnumber of opr.tErr != 0 or opr.tVol < 0.01
472pairPnlfloatAggregate Dn Pair Pnl;=sum[shNetClrM * (opr.optVolMark - opr.optOpnVolMark - opr.hedgeDePr * (opr.uMark - opr.uOpnMark))]
475posTEdgeWVfloatAggregate Vol Weighted Vega (wvega) where (opr.tOpx > 0 and (opr.tOpx - opr.optVolMark) >= 0)
478negTEdgeWVfloatAggregate Vol Weighted Vega (wvega) where (opr.tOpx > 0 and (opr.tOpx - opr.optVolMark) < 0)
481badTEdgeWVfloatAggregate Vol Weighted Vega (wvega) where (opr.tOpx = 0)
484posTEdgePnlfloatAggregate Dn Pair Pnl where (opr.tOpxPr > 0 and (opr.tOpxPr - opr.priorOpxVolMark) >= 0)
487negTEdgePnlfloatAggregate Dn Pair Pnl where (opr.tOpxPr > 0 and (opr.tOpxPr - opr.priorOpxVolMark) < 0)
490badTEdgePnlfloatAggregate Dn Pair Pnl where (opr.tOpxPr = 0)
493span01floatspan1: uPrc=unch, vol=up
496span02floatspan2: uPrc=unch, vol=down
499span03floatspan3: uPrc=+33.33%, vol=up
502span04floatspan4: uPrc=+33.33%, vol=dn
505span05floatspan5: uPrc=-33.33%, vol=up
508span06floatspan6: uPrc=-33.33%, vol=down
511span07floatspan7: uPrc=+66.67%, vol=up
514span08floatspan8: uPrc=+66.67%, vol=down
517span09floatspan9: uPrc=-66.67%, vol=up
520span10floatspan10: uPrc=-66.67%, vol=down
523span11floatspan11: uPrc=+100%, vol=up
526span12floatspan12: uPrc=+100%, vol=down
529span13floatspan13: uPrc=-100%, vol=up
532span14floatspan14: uPrc=-100%, vol=down
535span15floatspan15: uPrc=+300%; price slide * 0.33
538span16floatspan16: uPrc=-300%, price slide * 0.33
541futLiqRiskfloatAggregate Future Liquidation Risk
544optLiqRiskfloatAggregate Option Liquidation Risk
547fcBotC0inthypothetical future contracts bot (~ 1 minute intervals)
550fcSldC0inthypothetical future contracts sld
553fcMnyC0floathypothetical money
556fcBotC1inthypothetical future contracts bot (~ 10 minute intervals)
559fcSldC1inthypothetical future contracts sld
562fcMnyC1floathypothetical money
565futMarginfloatAggregate Future Risk Margin
568numFutErrorsbytenumber of futures positions with a computation error (should be zero)
571numOptErrorsbytenumber of options positions with a computation error (should be zero)
574futMarkFlagflag : MktErrFlagFuture position error flag
577optMarkFlagflag : MktErrFlagOption position error flag
580timestampDateTime

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

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

# 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 = 'lnDDelta|shDDelta|futMktValueMid|optMktValueMid|optMktValueVol|fcAbsCurPos|fcAbsOpnClr|fcAbsOpnPrv|fcAbsOpnPos|fcAbsOpnBrk|fcNetCurPos|fcBot|fcSld|fcBotHdg|fcSldHdg|fcBotTrh|fcSldTrh|fcBotOpn|fcSldOpn|fcBotTrd|fcSldTrd|fcMnyBot|fcMnySld|maxFutDttm|fcPnlMid|fcPnlClr|fcPnlDay|opCnAbsCurPos|opCnAbsOpnClr|opCnAbsOpnPrv|opCnAbsOpnPos|opCnAbsOpnBrk|opCnPosCall|opCnPosPut|opCnAbsPair|opCnAbsAtmEquiv|opCnBot|opCnSld|opMnyBot|opMnySld|opPremBot|opPremSld|maxOptDttm|opPnlVol|opPnlMid|opPnlClr|opPnlBrk|opPnlDay|opDnPnlDay|opDayVega|opDayWVega|opDayTVega|opDayWtVega|opDayTheta|opDayDelta|opTrdDelta|contHedgePnl|contHedgePnl1|opEdgeOpened|opEdgeClosed|pnlDn|pnlDe|pnlSl|pnlGa|pnlTh|pnlVe|pnlVo|pnlVa|pnlErr|pnlRate|pnlSDiv|pnlDDiv|pnlTe|pctIvChange|pctIvVega|pctTvChange|pctTvVega|futWidthMny|optWidthMny|dayDDelta|delta|ddelta|deDecay|ddDecay|gamma|dGamma|theta|rho|vega|tVega|wVega|wtVega|ivolVe|volga|vanna|slope|avega|atheta|hedgeGamma|hedgeDGamma|premOvPar|wtVeDd|wtVeDn|wtVeAt|wtVeUp|wtVeDu|wtVeM1|wtVeM2|wtVeM3|wtVeM4|wtVeM5|opnDelta|opnDDelta|posDelta|posDDelta|pinXX|opnDeBelow|opnDeAbove|opnDDeBelow|opnDDeAbove|posDeBelow|posDeAbove|posDDeBelow|posDDeAbove|posHedgeDeltaEx|posHedgeDDeltaEx|tEdge|tEdgeMult|tEdgePr|tEdgeMultPr|numTVolErrors|pairPnl|posTEdgeWV|negTEdgeWV|badTEdgeWV|posTEdgePnl|negTEdgePnl|badTEdgePnl|span01|span02|span03|span04|span05|span06|span07|span08|span09|span10|span11|span12|span13|span14|span15|span16|futLiqRisk|optLiqRisk|fcBotC0|fcSldC0|fcMnyC0|fcBotC1|fcSldC1|fcMnyC1|futMargin|numFutErrors|numOptErrors|futMarkFlag|optMarkFlag|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 = 'ProductRiskSummaryV5'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'lnDDelta|shDDelta|futMktValueMid|optMktValueMid|optMktValueVol|fcAbsCurPos|fcAbsOpnClr|fcAbsOpnPrv|fcAbsOpnPos|fcAbsOpnBrk|fcNetCurPos|fcBot|fcSld|fcBotHdg|fcSldHdg|fcBotTrh|fcSldTrh|fcBotOpn|fcSldOpn|fcBotTrd|fcSldTrd|fcMnyBot|fcMnySld|maxFutDttm|fcPnlMid|fcPnlClr|fcPnlDay|opCnAbsCurPos|opCnAbsOpnClr|opCnAbsOpnPrv|opCnAbsOpnPos|opCnAbsOpnBrk|opCnPosCall|opCnPosPut|opCnAbsPair|opCnAbsAtmEquiv|opCnBot|opCnSld|opMnyBot|opMnySld|opPremBot|opPremSld|maxOptDttm|opPnlVol|opPnlMid|opPnlClr|opPnlBrk|opPnlDay|opDnPnlDay|opDayVega|opDayWVega|opDayTVega|opDayWtVega|opDayTheta|opDayDelta|opTrdDelta|contHedgePnl|contHedgePnl1|opEdgeOpened|opEdgeClosed|pnlDn|pnlDe|pnlSl|pnlGa|pnlTh|pnlVe|pnlVo|pnlVa|pnlErr|pnlRate|pnlSDiv|pnlDDiv|pnlTe|pctIvChange|pctIvVega|pctTvChange|pctTvVega|futWidthMny|optWidthMny|dayDDelta|delta|ddelta|deDecay|ddDecay|gamma|dGamma|theta|rho|vega|tVega|wVega|wtVega|ivolVe|volga|vanna|slope|avega|atheta|hedgeGamma|hedgeDGamma|premOvPar|wtVeDd|wtVeDn|wtVeAt|wtVeUp|wtVeDu|wtVeM1|wtVeM2|wtVeM3|wtVeM4|wtVeM5|opnDelta|opnDDelta|posDelta|posDDelta|pinXX|opnDeBelow|opnDeAbove|opnDDeBelow|opnDDeAbove|posDeBelow|posDeAbove|posDDeBelow|posDDeAbove|posHedgeDeltaEx|posHedgeDDeltaEx|tEdge|tEdgeMult|tEdgePr|tEdgeMultPr|numTVolErrors|pairPnl|posTEdgeWV|negTEdgeWV|badTEdgeWV|posTEdgePnl|negTEdgePnl|badTEdgePnl|span01|span02|span03|span04|span05|span06|span07|span08|span09|span10|span11|span12|span13|span14|span15|span16|futLiqRisk|optLiqRisk|fcBotC0|fcSldC0|fcMnyC0|fcBotC1|fcSldC1|fcMnyC1|futMargin|numFutErrors|numOptErrors|futMarkFlag|optMarkFlag|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 = 'lnDDelta: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 = 'ProductRiskSummaryV5'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'lnDDelta|shDDelta|futMktValueMid|optMktValueMid|optMktValueVol|fcAbsCurPos|fcAbsOpnClr|fcAbsOpnPrv|fcAbsOpnPos|fcAbsOpnBrk|fcNetCurPos|fcBot|fcSld|fcBotHdg|fcSldHdg|fcBotTrh|fcSldTrh|fcBotOpn|fcSldOpn|fcBotTrd|fcSldTrd|fcMnyBot|fcMnySld|maxFutDttm|fcPnlMid|fcPnlClr|fcPnlDay|opCnAbsCurPos|opCnAbsOpnClr|opCnAbsOpnPrv|opCnAbsOpnPos|opCnAbsOpnBrk|opCnPosCall|opCnPosPut|opCnAbsPair|opCnAbsAtmEquiv|opCnBot|opCnSld|opMnyBot|opMnySld|opPremBot|opPremSld|maxOptDttm|opPnlVol|opPnlMid|opPnlClr|opPnlBrk|opPnlDay|opDnPnlDay|opDayVega|opDayWVega|opDayTVega|opDayWtVega|opDayTheta|opDayDelta|opTrdDelta|contHedgePnl|contHedgePnl1|opEdgeOpened|opEdgeClosed|pnlDn|pnlDe|pnlSl|pnlGa|pnlTh|pnlVe|pnlVo|pnlVa|pnlErr|pnlRate|pnlSDiv|pnlDDiv|pnlTe|pctIvChange|pctIvVega|pctTvChange|pctTvVega|futWidthMny|optWidthMny|dayDDelta|delta|ddelta|deDecay|ddDecay|gamma|dGamma|theta|rho|vega|tVega|wVega|wtVega|ivolVe|volga|vanna|slope|avega|atheta|hedgeGamma|hedgeDGamma|premOvPar|wtVeDd|wtVeDn|wtVeAt|wtVeUp|wtVeDu|wtVeM1|wtVeM2|wtVeM3|wtVeM4|wtVeM5|opnDelta|opnDDelta|posDelta|posDDelta|pinXX|opnDeBelow|opnDeAbove|opnDDeBelow|opnDDeAbove|posDeBelow|posDeAbove|posDDeBelow|posDDeAbove|posHedgeDeltaEx|posHedgeDDeltaEx|tEdge|tEdgeMult|tEdgePr|tEdgeMultPr|numTVolErrors|pairPnl|posTEdgeWV|negTEdgeWV|badTEdgeWV|posTEdgePnl|negTEdgePnl|badTEdgePnl|span01|span02|span03|span04|span05|span06|span07|span08|span09|span10|span11|span12|span13|span14|span15|span16|futLiqRisk|optLiqRisk|fcBotC0|fcSldC0|fcMnyC0|fcBotC1|fcSldC1|fcMnyC1|futMargin|numFutErrors|numOptErrors|futMarkFlag|optMarkFlag|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = ''

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

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