Skip to main content
Version: 8.4.10.4

Schema: FutureRiskSummaryV5 (ID: 4785)

FutureRiskSummary records contain live future level risk aggregation of OptionPositionRecord and FuturePositionRecord details.

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

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

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

# 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 = 'ticker|uPrc|uMark|uOpnMark|beta|betaSource|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|opnDelta|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|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|updateSource|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 = 'FutureRiskSummaryV5'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'ticker|uPrc|uMark|uOpnMark|beta|betaSource|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|opnDelta|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|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|updateSource|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 = 'ticker: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 = 'FutureRiskSummaryV5'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'ticker|uPrc|uMark|uOpnMark|beta|betaSource|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|opnDelta|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|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|updateSource|futMarkFlag|optMarkFlag|timestamp'

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

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

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