Schema: OptionPositionRecordV5 (ID: 4805)
OptionPositionRecords are live risk records that contain start-of-day positions and all subsequent executions, including executions reported as done away.
These records are published by a CoreRiskServer and represent the position and risk markup detail for a single option series.
New records are published immediately when a position changes and about once per minute if no position has changed.
Note that all records for a single underlier are published simultaneously and records for the same chain should have consistent marks.
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= | okey | OptionKey | ends with '$n' if an MH allocation fraction (n = 1-N) [MMH segment number] |
11= | accnt | string(16) | |
12= | tradeDate | DateKey | |
13= | riskSession | enum : RiskSession | |
14= | clientFirm | string(16) | SR assigned client firm |
103 | riskServerCode | string(6) | |
106 | aggGroup | string(16) | SR assigned agg group |
109 | fkey | ExpiryKey | underlying future (if written on a future) |
112 | ticker | TickerKey | underlying ticker |
115 | exType | enum : ExerciseType | |
118 | multihedge | enum : Multihedge | |
121 | multihedgeSource | TickerKey | MH Ticker Key (starts with '_') (if exists) |
124 | multihedgePVRatio | float | pv multiplier (fraction of underlier value (uPerCn x uPrc) / SUM(uPerCn x uPrc) associated with this fragment |
127 | optionType | enum : OptionType | |
130 | cashOnEx | float | cash on settlement (multihedge) |
133 | strikeRatio | float | strike ratio |
136 | uPrcRatio | float | stock price multiplier |
139 | underliersPerCn | int | underliers per contract |
142 | underlierType | enum : UnderlierType | type of underlier (affects $greek calculations) |
145 | tickValue | float | $NLV value of a single tick change in display premium (pointValue = tickValue / tickSize) |
148 | pointValue | float | $NLV value of a single point change in display premium (pointValue = tickValue / tickSize) |
151 | pointCurrency | enum : Currency | |
154 | priceFormat | enum : PriceFormat | option price display format code |
157 | uPriceFormat | enum : PriceFormat | underlier price display format code |
160 | uPrc | double | current underlier price (any market session) (persists if market closed/halted) |
163 | uBid | double | current underlier bid (any market session) (zero if market closed/halted) |
166 | uAsk | double | current underlier ask (any market session) (zero if market closed/halted) |
169 | uMark | double | current underlier mark (usually mid market) (freezes at SR CloseMarkTime) |
172 | uMarkSource | enum : UMarkSource | |
175 | optBid | float | current option market bid (any market session) (zero if market closed/halted) |
178 | optAsk | float | current option market ask (any market session) (zero if market closed/halted) |
181 | optMidMark | double | current option mark (mid market) (freezes at SR CloseMarkTime) |
184 | optVolMark | double | current option mark (volatility surface) (freezes at SR CloseMarkTime) |
187 | uOpnMark | double | start-of-day SR underlier mark (rotated from prior day record) [corp action adjusted] |
190 | optOpnVolMark | double | start-of-day SR vol mark [corp action adjusted] |
193 | optOpnMidMark | double | start-of-day SR mid mark [corp action adjusted] |
196 | optOpnClrMark | double | start-of-day clearing mark [should be corp action adjusted] |
199 | optOpnPosPrv | int | start-of-day SR contract position (rotated from prior day record) [corp action adjusted] |
202 | optOpnPosClr | int | start-of-day CKR contract position (supplied by client/clearing firm via clearing position load) [should be corp action adjusted] |
205 | optOpnPos | int | start of period contract position (effective; can be from either CLR or SR) |
208 | optOpnPosSrc | enum : PositionSource | start of period position source |
211 | cnBot | int | number of contracts bot today |
214 | cnSld | int | number of contracts sld today |
217 | cnOpened | int | number of contracts opened today |
220 | cnClosed | int | number of contracts closed today |
223 | edgeOpened | float | edge from opening trades (model #1) |
226 | edgeClosed | float | edge from closing trades (model #1) |
229 | trdDelta | float | deltas from trades (fixed at the time of trade) |
232 | trdGamma | float | gamma from trades (fixed at the time of trade) |
235 | trdDeltaMny | float | deltas x uPrc from trades (fixed at the time of trade) |
238 | optMnyBot | double | sum of settle cash for all buy executions |
241 | optMnySld | double | sum of settle cash for all sell executions |
244 | dayPnl | float | |
247 | dnDayPnl | float | |
250 | opnPnlMidMark | float | |
253 | opnPnlVolMark | float | |
256 | opnPnlClrMark | float | |
259 | cnNetOpnPos | int | opening position (cnOpnPos) net of reversals/conversions |
262 | cnNetCurPos | int | current position (cnOpnPos + cnBot - cnSld) net of reversals/conversions |
265 | cnAtmEquiv | float | current position (atm equivalent contracts: (cnNetPos * ve / atmVega) |
268 | beta | float | beta (usually beta to SPX; see AccountConfig.betaSource) |
271 | betaSource | enum : BetaSource | |
274 | divDays | short | days to the next dividend (0 = exDate is today, -1 = exDate is yesterday) |
277 | hedgeDeltaRule | enum : HedgeDeltaRule | HedgeDelta Source (IVol = use SR implied surface (sticky strike), IvS = use SR surface (sticky delta), TVol = use user supplied theo surface (sticky strike), TvS = use user supplied theo surface and atm veSlope (sticky delta)) [AccountConfig.hedgeDelta] |
280 | binaryDays | float | hedgeDelta = -1.0,-0.5,0,+0.5,+1.0 if less than binary days to expiration;usually [0.0 - 2.0] |
283 | days | short | days to expiration |
286 | years | float | years to expiration |
289 | rate | float | global rate to expiration (pricing) |
292 | sdiv | float | continuous stock div (pricing) |
295 | ddiv | float | present value of discrete dividends (pricing) |
298 | dadj | float | dadj frational dividend value; 1.0 except for some multihedge roots |
301 | atmVol | float | live surface atm volatility |
304 | atmVega | float | live surface atm vega |
307 | iVol | float | surface volatility |
310 | iVolSrc | enum : MarkSource | |
313 | de | float | delta;(dOpx / dUPrc) |
316 | ga | float | gamma;(dDelta / dUPrc) |
319 | th | float | theta;(dOpx / dTime) |
322 | ve | float | vega;(dOpx / dVol) |
325 | rh | float | rho;(dOpx / dRate) |
328 | ph | float | phi;(dOpx / dSDiv) |
331 | vo | float | volga (SR surface) |
334 | va | float | vanna (SR surface) |
337 | deDecay | float | delta decay, charm, delta bleed; (dDelta/dTime) |
340 | err | byte | computation error code (if any) |
343 | veSlope | float | ivol correlation (veSlope = dVol / dUPrc) [can be either SR surface veSlope or client theo veSlope] |
346 | hedgeDe | float | hedge delta (either ivol or tvol based;follows binary rules) |
349 | hedgeGa | float | hedge gamma (either ivol or tvol based;follows binary rules) |
352 | srSlope | float | ivol correlation (srSlope = dVol / dUPrc) [always SR surface veSlope] |
355 | isBinary | enum : YesNo | hedge delta/gamma has switched to 'binary' |
358 | premOvPar | float | premium over parity for the option position |
361 | xde | float | xdelta (C: +0.5 - de, P: -0.5 - de) |
364 | loBound | float | minimum no-arb opx (zero volatility given sdiv/ddiv/years/rate) |
367 | su90 | float | underlier up 90%, sticky delta |
370 | sd90 | float | underlier dn 90%, sticky delta |
373 | su50 | float | underlier up 50%, sticky delta |
376 | sd50 | float | underlier dn 50%, sticky delta |
379 | su15 | float | underlier up 15%, sticky delta |
382 | sd15 | float | underlier dn 15%, sticky delta |
385 | su10 | float | underlier up 10%, sticky delta |
388 | sd10 | float | underlier dn 10%, sticky delta |
391 | su06 | float | underlier up 6%, sticky delta |
394 | sd08 | float | underlier dn 8%, sticky delta |
397 | su05 | float | underlier up 5%, sticky delta |
400 | sd05 | float | underlier dn 5%, sticky delta |
403 | su1e | float | underlier up 1x implied earn move, vol ramp out, delta-neutral |
406 | sd1e | float | underlier dn 1x implied earn move, vol ramp out, delta-neutral |
409 | su2e | float | underlier up 2x implied earn move, vol ramp out, delta-neutral |
412 | sd2e | float | underlier dn 2x implied earn move, vol ramp out, delta-neutral |
415 | earn | float | vol earn ramp out (no underlier move) |
418 | cash | float | underlier up 30%, vol = 0.10, 6mn deal close |
421 | theoModel | string(16) | theo model #1 |
424 | tVol | float | theo volatility |
427 | tOpx | float | theo price |
430 | tBOpnPx | float | theo buy/open price |
433 | tSOpnPx | float | theo sell/open price |
436 | tBClsPx | float | theo buy/close price |
439 | tSClsPx | float | theo sell/close price |
442 | tDe | float | theo delta |
445 | tGa | float | theo gamma |
448 | tErr | byte | theo vol error code (TheoError) |
451 | theoModel2 | string(16) | theo model #2 (used for edge markup) |
454 | tVol2 | float | theo volatility (model #2) |
457 | tOpx2 | float | theo price (model #2) |
460 | tErr2 | byte | theo vol error code (model #2) |
463 | yearsPr | float | |
466 | ratePr | float | |
469 | sdivPr | float | |
472 | ddivPr | float | |
475 | iVolPr | float | prior period surface volatility |
478 | dePr | float | |
481 | gaPr | float | |
484 | thPr | float | |
487 | vePr | float | |
490 | rhPr | float | |
493 | phPr | float | |
496 | voPr | float | |
499 | vaPr | float | |
502 | errPr | byte | prior period computation error code (if any) |
505 | veSlopePr | float | prior period veSlope |
508 | hedgeDePr | float | prior period hedge delta |
511 | tVolPr | float | prior period theo volatility (theoModel) |
514 | tOpxPr | float | prior period theo price |
517 | tDePr | float | prior period theo delta |
520 | tVolPr2 | float | prior period theo volatility (theoModel#2) |
523 | tOpxPr2 | float | prior period theo price |
526 | tDePr2 | float | prior period theo delta |
529 | xdePr | float | |
602 | marginUDnVDn | float | Aggregate RiskSlide: uPrc dn, vol dn |
603 | marginUDnVUp | float | Aggregate RiskSlide: uPrc dn, vol up |
604 | marginUUpVDn | float | Aggregate RiskSlide: uPrc up, vol dn |
605 | marginUUpVUp | float | Aggregate RiskSlide: uPrc up, vol up |
532 | opnPnlDe | float | open position * mult * hedgeDe * dUPrc |
535 | opnPnlGa | float | open position * mult * 0.5 * optGamma * dUPrc * dUPrc |
538 | opnPnlTh | float | open position * mult * optTheta * dTime |
541 | opnPnlVe | float | open position * mult * optVega * dVol |
544 | opnPnlVo | float | open position * mult * 0.5 * optVolga * dVol * dVol |
547 | opnPnlVa | float | open position * mult * optVanna * dVol * dUPrc |
550 | opnPnlSl | float | open position * mult * vol/uPrc * slope * optVega * dUPrc |
553 | opnPnlRate | float | open position * mult * optRho * dRate |
556 | opnPnlSDiv | float | open position * mult * optPhi * dSDv |
559 | opnPnlDDiv | float | open position * mult * optPhi * dDDv |
562 | opnPnlSv | float | open position * mult * (SR Vol Pnl - opnPnlDe) |
565 | opnPnlErr | float | unattributed pnl: SR Vol Pnl - opnPnlDe - opnPnlGa - opnPnlTh - opnPnlVe - opnPnlRat - opnPnlSDiv - opnPnlDDiv |
568 | shBotC0 | int | hypothetical shares bot (~1/minute intervals) |
571 | shSldC0 | int | hypothetical shares sld |
574 | shMnyC0 | float | hypothetical money |
577 | shBotC1 | int | hypothetical shares bot (~10/minute intervals) |
580 | shSldC1 | int | hypothetical shares sld |
583 | shMnyC1 | float | hypothetical money |
586 | markErrCodes | flag : MarkErrorCode | |
589 | exValue | float | early exercise value (amLimit - bsPrice) |
592 | riskAlert | enum : AlertCode | |
595 | numExecutions | int | number of included SpdrParentExecution records |
598 | maxExecDttm | DateTime | maximum activity dttm of execution records included in this option risk summary |
601 | 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 = 'OptionPositionRecordV5'
# 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=OptionPositionRecordV5'
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 = 'OptionPositionRecordV5'
# 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 = 'riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|iVol|iVolSrc|de|ga|th|ve|rh|ph|vo|va|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|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=OptionPositionRecordV5' \
--data-urlencode 'view=riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|iVol|iVolSrc|de|ga|th|ve|rh|ph|vo|va|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|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 = 'OptionPositionRecordV5'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|iVol|iVolSrc|de|ga|th|ve|rh|ph|vo|va|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|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 = 'riskServerCode: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=OptionPositionRecordV5' \
--data-urlencode 'view=riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|iVol|iVolSrc|de|ga|th|ve|rh|ph|vo|va|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|timestamp' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=riskServerCode: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 = 'OptionPositionRecordV5'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|iVol|iVolSrc|de|ga|th|ve|rh|ph|vo|va|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'exType|multihedge|optionType|underlierType|pointCurrency|priceFormat|uPriceFormat|uMarkSource|optOpnPosSrc|betaSource|hedgeDeltaRule|iVolSrc|isBinary|riskAlert'
# 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=OptionPositionRecordV5' \
--data-urlencode 'measure=riskServerCode|aggGroup|fkey|ticker|exType|multihedge|multihedgeSource|multihedgePVRatio|optionType|cashOnEx|strikeRatio|uPrcRatio|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|uPriceFormat|uPrc|uBid|uAsk|uMark|uMarkSource|optBid|optAsk|optMidMark|optVolMark|uOpnMark|optOpnVolMark|optOpnMidMark|optOpnClrMark|optOpnPosPrv|optOpnPosClr|optOpnPos|optOpnPosSrc|cnBot|cnSld|cnOpened|cnClosed|edgeOpened|edgeClosed|trdDelta|trdGamma|trdDeltaMny|optMnyBot|optMnySld|dayPnl|dnDayPnl|opnPnlMidMark|opnPnlVolMark|opnPnlClrMark|cnNetOpnPos|cnNetCurPos|cnAtmEquiv|beta|betaSource|divDays|hedgeDeltaRule|binaryDays|days|years|rate|sdiv|ddiv|dadj|atmVol|atmVega|iVol|iVolSrc|de|ga|th|ve|rh|ph|vo|va|deDecay|err|veSlope|hedgeDe|hedgeGa|srSlope|isBinary|premOvPar|xde|loBound|su90|sd90|su50|sd50|su15|sd15|su10|sd10|su06|sd08|su05|sd05|su1e|sd1e|su2e|sd2e|earn|cash|theoModel|tVol|tOpx|tBOpnPx|tSOpnPx|tBClsPx|tSClsPx|tDe|tGa|tErr|theoModel2|tVol2|tOpx2|tErr2|yearsPr|ratePr|sdivPr|ddivPr|iVolPr|dePr|gaPr|thPr|vePr|rhPr|phPr|voPr|vaPr|errPr|veSlopePr|hedgeDePr|tVolPr|tOpxPr|tDePr|tVolPr2|tOpxPr2|tDePr2|xdePr|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|opnPnlDe|opnPnlGa|opnPnlTh|opnPnlVe|opnPnlVo|opnPnlVa|opnPnlSl|opnPnlRate|opnPnlSDiv|opnPnlDDiv|opnPnlSv|opnPnlErr|shBotC0|shSldC0|shMnyC0|shBotC1|shSldC1|shMnyC1|markErrCodes|exValue|riskAlert|numExecutions|maxExecDttm|timestamp' \
--data-urlencode 'group=exType|multihedge|optionType|underlierType|pointCurrency|priceFormat|uPriceFormat|uMarkSource|optOpnPosSrc|betaSource|hedgeDeltaRule|iVolSrc|isBinary|riskAlert' \
--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 = 'OptionPositionRecordV5'
# 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=OptionPositionRecordV5' \
--data-urlencode 'where=accnt:eq:ExampleString'