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
Attribute | Value |
---|---|
Topic | 4740-risk-v5 |
MLink Token | ClientRisk |
SRSE Product | SRRisk |
Note: The symbol
=
next to a field number indicates that it is a primary key.
BODY
# | Field | Type | Comment |
---|---|---|---|
10= | accnt | string(16) | SR Accnt |
11= | secKey | OptionKey | |
12= | secType | enum : SecType | [Call, Put, Stock, Future, Cash] |
13= | tradeDate | DateKey | |
14= | riskSession | enum : RiskSession | |
15= | clientFirm | string(16) | SR assigned client firm |
100 | version | enum : RiskCubeVersion | |
106 | clearingFirm | string(8) | Clearing Firm |
109 | clearingAccnt | string(16) | Clearing Firm Accnt |
112 | riskServerCode | string(6) | SR RiskServer (server that published this record) |
115 | viewGroup1 | string(12) | Client defined view group #1 (can be fitered/aggregated) |
118 | viewGroup2 | string(12) | Client defined view group #2 (can be fitered/aggregated) |
121 | viewGroup3 | string(12) | Client defined view group #3 (can be fitered/aggregated) |
124 | ticker | TickerKey | Risk Symbol (underlier for equities; product group for future/option complexes) |
127 | riskClass | string(8) | Symbol risk class (from SymbolControl record) |
130 | symbolType | enum : SymbolType | Symbol type |
133 | beta | float | beta (usually beta to SPX; see AccountConfig.betaSource) |
136 | betaSource | enum : BetaSource | |
139 | sector | string(16) | Client defined sector (from SymbolControl record) |
142 | indNum | int | Ind Num (00) |
145 | subNum | int | Sub Num (0000) |
148 | grpNum | int | Grp Num (000000) |
151 | nbrNum | int | Nbr Num (00000000) |
154 | eDays | short | days to next earnings [-5, +30] |
157 | dDays | short | days to next dividend [-5, +30] |
160 | xDelta | float | calls = +0.5 - delta; puts = -0.5 - delta |
163 | expCode | enum : ExpCode | Time-to-expiry code (W1, W2, M1, M2, M34, M56, M7C, Y1, Y2) |
166 | skewCode | enum : SkewCode | Skew bucket code (Dd=Deep DownSide, Dn = DownSide, At = ATM, Up = UpSide, DU = FarUpSide) |
169 | eDaysCode | enum : EDaysCode | Days to next earnings event (if any) |
172 | iVolRange | enum : iVolRange | Implied ATM Vol Range |
175 | skewDD | float | dd (deep downside) skew metric (xde < -0.30) |
178 | skewDN | float | dn (downside) skew metric (-0.30 < xde < -0.10) |
181 | skewAT | float | at (atm) skew risk metric (-0.10 < xde < +0.10) |
184 | skewUP | float | up (upside) skew risk metric (+0.10 < xde < +0.30) |
187 | skewDU | float | du (far upside) skew risk metric (+0.30 < xde) |
190 | shOpnPos | int | shares (start-of-day) |
193 | fcOpnPos | int | futures contracts (start-of-day) |
196 | cnOpnPos | int | options contracts (start-of-day) |
199 | cnAtmEquiv | float | atm equivalent contracts; (opr.cnOpnPos + opr.cnBot - opr.cnSld) * opr.ve / opr.atmVega |
202 | shBot | int | shares bot |
205 | shSld | int | shares sld |
208 | shSldShrt | int | shares sld short |
211 | fcBot | int | future contracts bot |
214 | fcSld | int | future contracts sld |
217 | cnBot | int | option contracts bot |
220 | cnSld | int | option contracts sld |
223 | cnOpened | int | option contracts opened |
226 | cnClosed | int | option contracts closed |
229 | opnDir | string(2) | open (start-of-day) direction (LN or SH) |
232 | posDir | string(2) | current (start-of-day + trades) direction (LN or SH) |
235 | unitOpnPos | int | effective opening position (shares or cn * underlierPerCn) (start-of-day) |
238 | unitCurPos | int | effective current position (shares or cn * underlierPerCn) (start-of-day + trades) |
241 | unitQtyBot | int | effective shares bot (shares or cn * underlierPerCn) |
244 | unitQtySld | int | effective shares sld (shares or cn * underlierPerCn) |
247 | dayPnl | float | day pnl |
250 | dayDnPnl | float | day pnl (delta neutral) |
253 | dayTrdDelta | float | day trade delta |
256 | dayTrdDDelta | float | day trade $delta |
259 | dayTrdGamma | float | day trade gamma |
262 | dayTrdDGamma | float | day trade $gamma |
265 | dayTrdVega | float | day trade vega |
268 | dayTrdWVega | float | day trade wVega (vega * vol) |
271 | dayTrdTVega | float | day trade tVega (vega / sqrt(max(0.1, years * 4))) |
274 | dayTrdWtVega | float | day trade wtVega (vega * vol / sqrt(max(0.1, years * 4))) |
277 | dayTrdTheta | float | day trade theta |
280 | dayEdgeOpened | float | day theo option edge opened (requires a theo model) |
283 | dayEdgeClosed | float | day theo option edge closed (requires a theo model) |
286 | dayMnyBot | double | day money bot |
289 | dayMnySld | double | day money sld |
292 | opnPnlVolMark | float | (cur.surface - pr.surface) * cnOpnClr * upc |
295 | opnPnlMidMark | float | (cur.mid - pr.mid) * cnOpnClr * upc |
298 | opnPnlClrMark | float | (cur.mid - pr.clr) * cnOpnClr * upc |
301 | opnMarkBrkMny | float | (cur.surface - cur.mid) * cnOpnClr * upc |
304 | opnTheoEdge | float | opening edge (edge at the end of prior period) (requires a theo model) |
307 | posTheoEdge | float | current edge (opening positions + trades) (requires a theo model) |
310 | tVolMove | float | LN(tVol / tVolPr) |
313 | tEdgeMove | float | LN(tVol / iVol) - LN(tVolPr / iVolPr) |
316 | tEdge | float | LN(tVol / iVol) |
319 | opnPnlDe | float | open position * mult * hedgeDe * dUPrc ( pnlSD = sum(pnlDe) [stock + futures + options] ) |
322 | opnPnlGa | float | open position * mult * 0.5 * optGamma * dUPrc * dUPrc |
325 | opnPnlTh | float | open position * mult * optTheta * dTime |
328 | opnPnlVe | float | open position * mult * optVega * dVol |
331 | opnPnlVo | float | open position * mult * 0.5 * optVolga * dVol * dVol |
334 | opnPnlVa | float | open position * mult * optVanna * dVol * dUPrc |
337 | opnPnlSl | float | open position * mult * vol/uPrc * slope * optVega * dUPrc |
340 | opnPnlRate | float | open position * mult * optRho * dRate |
343 | opnPnlSDiv | float | open position * mult * optPhi * dSDv |
346 | opnPnlDDiv | float | open position * mult * optPhi * dDDv |
349 | opnPnlErr | float | unattributed pnl: SR Vol Pnl - opnPnlDe - opnPnlGa - opnPnlTh - opnPnlVe - opnPnlRat - opnPnlSDiv - opnPnlDDiv |
352 | opnEdgeChange | float | open position * mult * (tEdge - tEdgePr) (requires a theo model) |
355 | posDelta | float | live position * mult * hedgeDe |
358 | posDDelta | float | live position * mult * hedgeDe * UPrc |
361 | posDBeta | float | live position * mult * hedgeDe * beta * UPrc |
364 | posGamma | float | live position * mult * optGamma |
367 | posDGamma | float | live position * mult * optGamma * uPrc * uPrc / 100 |
370 | posVega | float | live position * mult * optVega |
373 | posWVega | float | live position * mult * optVega * iVol |
376 | posTVega | float | live position * mult * optVega / sqrt(max(0.1, years * 4)) |
379 | posWtVega | float | live position * mult * optVega * iVol / sqrt(max(0.1, years * 4)) |
382 | posVolga | float | live position * mult * optVolg |
385 | posVanna | float | live position * mult * optVanna |
388 | posTheta | float | live position * mult * optTheta |
391 | posRho | float | live position * mult * optRho |
394 | posPhi | float | live position * mult * optPhi |
397 | posNotional | float | live position * mult * uPrc |
400 | posMktValue | float | live position * mult * SR surface mark |
403 | posPremOPar | float | live position * mult * premium over parity |
406 | atmVol | float | atm volatility |
409 | symVol | float | underlier symbol volatility (term.21d;censored) |
412 | srSlope | float | strike veSlope (sr surface;options only) |
415 | prcSVol | float | SR Surface Vol |
418 | prcTOpx | float | SR Surface Price |
421 | prcYOpx | float | SR Yesterday Surface Price |
424 | prcUPrc | float | underlier price |
427 | prcYears | float | years-to-expiry |
430 | prcRate | float | discount rate-to-expiry |
433 | prcSdiv | float | continuous stock div rate-to-expiry |
436 | prcDdiv | float | cumulative discrete dividend paid through expiry |
439 | uPrcRatio | float | stock price multiplier |
442 | uPrcMove | float | Underlier price change |
445 | iVolMove | float | Implied vol change (fixed strike ivol change from prior period) |
448 | exDivAmt | float | estimated exDiv amount (if any) |
451 | borrowRate | float | estimated stock borrow rate (if any) |
454 | modelType | byte | SRPricingLib.CalcModelType |
457 | underliersPerCn | int | underliers per contract |
460 | underlierType | enum : UnderlierType | underlier type (used for option pricing) |
463 | pointValue | float | value of one point |
466 | pointCurrency | enum : Currency | |
469 | tickValue | float | value of one tick |
472 | multihedge | enum : Multihedge | |
475 | multihedgeSource | TickerKey | MH Ticker Key (starts with '_') (if exists) |
478 | multihedgePVRatio | float | pv multiplier (fraction of underlier value (uPerCn x uPrc) / SUM(uPerCn x uPrc) associated with this fragment |
481 | spanPrcIncUp | float | default (exchange) span price up increment for this asset |
484 | spanPrcIncDn | float | default (exchange) span price dn increment for this asset |
487 | spanVolInc | float | default (exchange) span volatility increment for this asset |
490 | prcSpanType | enum : SpanType | exchange prcSpan type |
493 | volSpanType | enum : SpanType | exchange volSpan type |
496 | spanPricingModel | enum : SpanPricingModel | Exchange-defined model for SPAN option pricing calcs |
499 | marginType | enum : MarginType | margin slide type: NMS_Equity = +/- 15%, NMS_Index = -8%/+6%, NMS_Medium = +/-10% |
502 | timestamp | DateTime |
Get Schema API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getschema' \
--data-urlencode 'msgType=RiskCubeDetailV5'
Get Msg API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getmsg' \
--data-urlencode 'pkey=ReplaceThisValueForTheQueryToWork' \
--data-urlencode 'msgType=RiskCubeDetailV5' \
--data-urlencode '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' \
--data-urlencode 'where=accnt:eq:ExampleString'
Get Msgs API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getmsgs' \
--data-urlencode 'msgType=RiskCubeDetailV5' \
--data-urlencode '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' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=version:ASC'
Get Aggregate API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getaggregate' \
--data-urlencode 'msgType=RiskCubeDetailV5' \
--data-urlencode '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' \
--data-urlencode 'group=version|symbolType|betaSource|expCode|skewCode|eDaysCode|iVolRange|underlierType|pointCurrency|multihedge|prcSpanType|volSpanType|spanPricingModel|marginType' \
--data-urlencode 'where=accnt:eq:ExampleString'
Get Count API Call
- Python
- cUrl
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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getcount' \
--data-urlencode 'msgType=RiskCubeDetailV5' \
--data-urlencode 'where=accnt:eq:ExampleString'