Skip to main content
Version: 8.4.12.1

Schema: OptOrderGateway (ID: 5165)

Records inserted, updated, or replaced into the OptionOrderGateway table are validated and then converted to SpdrParentOrder records and forwarded to the appropriate execution engine for futher processing. Parent orders can be inserted as either active/ready or in a wait start mode that requires subsequent release.

See the SpiderRock Execution Engine concept guide for more details.

METADATA

AttributeValue
Topic5120-srse-gateway
MLink TokenInternal
SRSE ProductSRTrade

Note: The symbol = next to a field number indicates that it is a primary key.

BODY

#FieldTypeComment
10=okeyOptionKeySR Option Key
11=accntstring(16)SR Account (default = primary account associated with SRSE login)
12=orderSideenum : BuySellParent Order Size
13=groupingCodelongParent Grouping Code
14=clientFirmstring(16)
103spdrActionTypeenum : SpdrActionType[Add (new order), AddReplace (add or replace order), Cancel (cxl existing), Replace (update existing only), Release (modify order active size)]
106altOrderIdstring(24)Alternate client order ID. This order ID will be copied to all execution reports.
109altAutoHedgeIdstring(24)alternate order ID for child autohedge orders (if any)
112altAccntstring(32)alternate (client assigned) "long" account string (optional) [used to map between client and SR account strings]
115altUserNamestring(24)alternate (client assigned) user name (optional) [used to map between client and SR account strings]
118accntRouteCodetext1accntRoute acronym
576execBrkrCodestring(16)
577externExDeststring(16)routing code for orders directed to an external order router (default = null); should match FixRoutingTable.destination (in SR accnt config)
124externParamstext1external algo names/parameters (usually just an algo name)
127strategystring(36)Client strategy string. This value will appear on the SR Trade Monitor and in execution reports.
133orderDttmDateTimeorder entry time (from client;if any)
136orderSizeintparent order size (contracts) [-1 = no change;used when spdrActionType=Release]
139orderActiveSizeinttotal activated size (total size released for execution) (-1 = all available size)
142addCumFillQuantityenum : YesNoIf Yes then OrderSize is calculated @ order arrival as requested OrderSize + existing 'CumFillQuantity'.
145exchMaskuinteligible exchanges (0 = all)
148maxExposureSizeintmaximum simultaneous cumulative child order public size exposure (-1 = orderActiveSize) [order can overfill if > orderActiveSize and numMakeExchanges > 1]
151numMakeExchangesbytenumber of exchanges (1 - 4) on which to publish public making orders. Effective number might be less than requested number if sufficient exchanges are not available.
154publicSizeenum : PublicSizeHandlingpublic order size handling: None=use default size handling (usually limits public size to 'typical' market size); Randomize=randomize public size; MktSize=expose only 'typical' market size; FullSize=expose entire order size where possible
157randomizeSizeenum : YesNorandomize public order size
160canOverlapCxlReplenum : YesNocan execution engines overlap cancel/replace operations [order can overfill if YES] (at most one active overlapping cxl/replace operation for each parent order)
163progressRuleenum : ProgressRuleNone = all size immediately available;TWAP = size released in time intervals;VWAP = size released in volume intervals;
166twapSliceCntbyte[ProgressSliceCnt] number of progress slices to use. if none given will compute based on active size and duration. [max 20]
169progressExposeTimeintminimum time (secs) to expose order (0 = no minimum; used to guarantee that the order is exposed at mid-market for some time before actively taking)
172auctionResponderenum : AuctionResponderif set, parent order can be an auction responder
175maxMakeExchFeefloatmaximum making exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
178maxTakeExchFeefloatmaximum taking exchange fee (in point value) [zero = no limit; use non-zero number for limit to apply]
181incTakeExchFeeenum : IncExchFeeinclude exchange fee in probability and surface based take limit calculations
184incMakeExchFeeenum : IncExchFeeinclude exchange fee in probability and surface based make limit calculations
187makeExchRuleenum : MakeExchRuleActiveMaker exchange preference rule: 'MaxPart' will pick exchanges to maximize participation; 'FeeOrder' will pick exchanges to minimize fees [maximize rebates]; 'ImprvOnly' will only make when improving NBBO.
190triggerTypeenum : TriggerTypetype of trigger (PrintVol/SurfVol only for options) [print = print or actionable quote]
193triggerLevelfloatstop/trigger price for parent order to go active
196cxlUPrcRangeenum : UPrcCxlcancel parent order if/when outside min/max uPrc range [_Halt = also cancel if the security/underlier has been halted]
199minUBidfloat[optional]
202maxUAskfloat[optional] (< $0.01 = none)
205minMaxTypeenum : MinMaxTypeif Prc minUBid/maxUAsk are expressed as prices; if Pct then they are expresses as pct change since parent order arrival
208minOptionPxfloat[optional] option price floor for tied to stock orders
211maxChildOrdersintmaximum number of child orders that can be generated by this parent order [order will terminate if/when this cap is reached;zero or neg = unlimited]
214spdrStageTypeenum : SpdrStageTypeSizeLock = stage pending modification (can reduce size); SizeModify = stage pending modification (can increase/reduce size)
572marketSessionenum : MarketSession
220startDttmDateTime[optional] (parent order start time)
223orderDurationint[optional] (number of seconds)
573activeDurationint[optional] (number of seconds)
226goodTillDttmDateTime[optional] (default: 2000-01-01)
229startTypeenum : StartType[WaitTrigger]
235parentOrderHandlingenum : ParentOrderHandling
238parentBalanceHandlingenum : ParentBalanceHandling
578blockVisibilityenum : BlockVisibilityfor BlockAuction orders, visibility (to responders) is neither, side only, or side + price
579includeSRNetworkenum : InclExclDisclose
241orderLimitTypeenum : SpdrLimitTypeVarious (Prc, PrcDe, Vol, Rel, Market); establishes the primary LimitPrice for a parent order
244takeLimitClassenum : SpdrLimitClassSimple = LimitPrice, Surface = BEST(LimitPrice, SurfLimit), Probability = BEST(LimitPrice, ProbLimit)
247makeLimitClassenum : SpdrLimitClassSimple = LimitPrice, Surface = BEST(LimitPrice, SurfLimit), Probability = BEST(LimitPrice, ProbLimit)
250takeReachRuleenum : ReachRuleNone = reach room immediately available; Delayed = available after [1-3] seconds; Passive = available if contra side aggresses; WeakOnly = only take if available size < avgMarketSize; ISOSweep = Intermarket Sweep [requires WaitTrigger]
253orderPrcLimitdoubleApplies if LimitType = Prc[]
256orderRefUPrcdoubledefault=underlier.mid
259orderRefDeltafloatdefault=option.delta
262orderRefGammafloatdefault=option.gamma
265orderVolLimitfloatApplies if LimitType = Vol[] [uses SR dividends and borrow rates]
268rateOverridefloatzero = ignore;> zero = override
271sdivOverridefloatDefault: 0.
274ddivOverridetext2Discrete dividend string override ([yearsToExpiry,divYears:divAmount,divYears:divAmount, ...])
277overrideCodeenum : OverrideCodeoverride default SR dividend and rate details (only used if LimitType = Vol)
280orderPrcOffsetdoubledefault=0
283orderRefEventMultfloat
286orderRefEventDttmDateTime
289takeAlphaTypeenum : AlphaTypeApplies if takeLimitClass = Probability
292makeAlphaTypeenum : AlphaTypeApplies if makeLimitClass = Probability
295takeAlphaFactorfloat[-2,+2] takeProbLimit = MAX(takeProbability, takeProbAvg + takeAlphaFactor * takeProbStd) [if takeAlphaType = Relative]
298makeAlphaFactorfloat[-2,+2] makeProbLimit = MAX(makeProbability, makeProbAvg + makeAlphaFactor * makeProbStd) [if makeAlphaType = Relative]
301takeProbabilityfloattakeProbLimit = takeProbability [if takeAlphaType = Static]
304makeProbabilityfloatmakeProbLimit = makeProbability [if makeAlphaType = Static]
307takeSurfPrcOffsetdoubledefault=0
310takeSurfVolOffsetfloatdefault=0
313takeSurfWidthOffsetfloat[-1.x to +1.x] -1.0 = -0.5 * avgMktWidth, +1.0 = +0.5 * avgMktWidth
316makeSurfPrcOffsetdoubledefault=0
319makeSurfVolOffsetfloatdefault=0
322makeSurfWidthOffsetfloat[-1.x to +1.x] -1.0 = -0.5 * avgMktWidth, +1.0 = +0.5 * avgMktWidth
325autoHedgeenum : AutoHedge
328hedgeInstrumentenum : HedgeInstOrigDefault=underlier (EQT or FUT) [Index Options use ETF]; FrontMonth=underlier (EQT) or front month (FUT) [Index Options use FM Fut]; Stock=hedgeSecKey; Future=hedgeSecKey (DirectStock, DirectFuture, and FutUnderlier are depricated)
331hedgeFKeyExpiryKeyautohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]
334hedgeBetaRatiofloatportion of executed $delta to auto-hedge (can be 1.0 / Beta for beta hedging) [-4.0 to +4.0])
337hedgeScopeenum : HedgeScope
574hedgeSessionenum : MarketSession
343positionTypeenum : PositionType
346ssaleFlagenum : ShortSaleFlagUsed to determine stock auto-hedge flags.
349firmTypeenum : FirmTypeUsed to override firmType in account config. Default: None (use SpiderRock account configuration).
352theoVolfloatclient supplied theoretical volatility (used for markup only)
397riskGroupIdlongAll group (grp) risk limits below are relative to this riskGroupId. Default: 0 (none). Required to be non-zero if autoHedge is something other than None.
575reqAuxRiskGroupCtrlenum : YesNo
355refRMetric1Srcenum : RMetricSource
358refRMetric2Srcenum : RMetricSource
361refRMetric3Srcenum : RMetricSource
364refRMetric4Srcenum : RMetricSource
367refRMetric5Srcenum : RMetricSource
370refRMetric6Srcenum : RMetricSource
373refRMetric7Srcenum : RMetricSource
376orderRefRMetric1floatuser supplied RMetric1 value (used in RiskGroupID risk controls) [netRMetric1 = sum(fillQty * orderRefRMetric1 * underlierPerCn)]
379orderRefRMetric2floatuser supplied RMetric2 value (used in RiskGroupID risk controls) [netRMetric2 = sum(fillQty * orderRefRMetric2 * underlierPerCn)]
382orderRefRMetric3floatuser supplied RMetric3 value (used in RiskGroupID risk controls) [netRMetric3 = sum(fillQty * orderRefRMetric3 * underlierPerCn)]
385orderRefRMetric4floatuser supplied RMetric4 value (used in RiskGroupID risk controls) [netRMetric4 = sum(fillQty * orderRefRMetric4 * underlierPerCn)]
388orderRefRMetric5floatuser supplied RMetric5 value (used in RiskGroupID risk controls) [netRMetric5 = sum(fillQty * orderRefRMetric5 * underlierPerCn)]
391orderRefRMetric6floatuser supplied RMetric6 value (used in ExpDay risk controls) [netRMetric6 = sum(fillQty * orderRefRMetric6 * underlierPerCn)]
394orderRefRMetric7floatuser supplied RMetric7 value (used in SymDay risk controls) [netRMetric7 = sum(fillQty * orderRefRMetric7 * underlierPerCn)]
424expDayWtVegaOffsetfloatmax acct+symbol day wtVega offset (target)
418maxExpDayWtVegaLnfloatmax accnt+expiration day (time weighted) vega long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)
421maxExpDayWtVegaShfloatmax accnt+expiration day (time weighted) vega short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)
454maxExpDayRMetric6Lnfloatmax acct+expiration day rMetric6 long (positive number;-1=no limit);risk limit = max limit - current net counter
457maxExpDayRMetric6Shfloatmax acct+expiration day rMetric6 short (positive number;-1=no limit);risk limit = max limit + current net counter
451symDayDDeltaOffsetfloatmax acct+symbol day $delta offset (target)
445maxSymDayDDeltaLnfloatmax acct+symbol day $delta long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)
448maxSymDayDDeltaShfloatmax acct+symbol day $delta short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)
433symDayVegaOffsetfloatmax acct+symbol day vega offset (target)
427maxSymDayVegaLnfloatmax acct+symbol day vega long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)
430maxSymDayVegaShfloatmax acct+symbol day vega short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)
442symDayWtVegaOffsetfloatmax acct+symbol day wtVega offset (target)
436maxSymDayWtVegaLnfloatmax acct+symbol day (time weighted) vega long (positive number;-1=no limit);risk limit = max limit - (current net counter - offset)
439maxSymDayWtVegaShfloatmax acct+symbol day (time weighted) vega short (positive number;-1=no limit);risk limit = max limit + (current net counter - offset)
463maxSymDayRMetric7Lnfloatmax acct+symbol day rMetric7 long (positive number;-1=no limit);risk limit = max limit - current net counter
466maxSymDayRMetric7Shfloatmax acct+symbol day rMetric7 short (positive number;-1=no limit);risk limit = max limit + current net counter
472maxGrpDayDDeltaLnfloatmax acct+riskGroup day $delta long (positive number;-1=no limit);risk limit = max limit - current net counter
475maxGrpDayDDeltaShfloatmax acct+riskGroup day $delta short (positive number;-1=no limit);risk limit = max limit + current net counter
478maxGrpDayVegaLnfloatmax acct+riskGroup day vega long (positive number;-1=no limit);risk limit = max limit - current net counter
481maxGrpDayVegaShfloatmax acct+riskGroup day vega short (positive number;-1=no limit);risk limit = max limit + current net counter
484maxGrpDayVegaAbsfloatmax acct+riskGroup day vega abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)
487grpDayVegaRatiofloattarget bot / sld ratio (eg ratio=2.0 means that neutral is bot vega = 2x sld vega)
538maxGrpDayContractsLnintmax acct+riskGroup day opt contracts long (positive number;-1=no limit);risk limit = max limit - current net counter
541maxGrpDayContractsShintmax acct+riskGroup day opt contracts short (positive number;-1=no limit);risk limit = max limit + current net counter
544maxGrpDayContractsAbsintmax acct+riskGroup day opt contracts abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)
502maxGrpDayRMetric1Lnfloatmax acct+riskGroup day rMetric1 long (positive number;-1=no limit);risk limit = max limit - current net counter
505maxGrpDayRMetric1Shfloatmax acct+riskGroup day rMetric1 short (positive number;-1=no limit);risk limit = max limit + current net counter
508maxGrpDayRMetric1Absfloatmax acct+riskGroup day rMetric1 abs (positive number;-1=no limit);risk limit = max limit - abs(current net counter)
511grpDayRMetric1Ratiofloattarget bot / sld ratio (eg ratio=0.5 means that neutral is bot rMetric1 = 0.5x sld rMetric1)
514maxGrpDayRMetric2Lnfloatmax acct+riskGroup day rMetric2 long (positive number;-1=no limit);risk limit = max limit - current net counter
517maxGrpDayRMetric2Shfloatmax acct+riskGroup day rMetric2 short (positive number;-1=no limit);risk limit = max limit + current net counter
520maxGrpDayRMetric3Lnfloatmax acct+riskGroup day rMetric3 long (positive number;-1=no limit);risk limit = max limit - current net counter
523maxGrpDayRMetric3Shfloatmax acct+riskGroup day rMetric3 short (positive number;-1=no limit);risk limit = max limit + current net counter
526maxGrpDayRMetric4Lnfloatmax acct+riskGroup day rMetric4 long (positive number;-1=no limit);risk limit = max limit - current net counter
529maxGrpDayRMetric4Shfloatmax acct+riskGroup day rMetric4 short (positive number;-1=no limit);risk limit = max limit + current net counter
532maxGrpDayRMetric5Lnfloatmax acct+riskGroup day rMetric5 long (positive number;-1=no limit);risk limit = max limit - current net counter
535maxGrpDayRMetric5Shfloatmax acct+riskGroup day rMetric5 short (positive number;-1=no limit);risk limit = max limit + current net counter
547symEmaCxlDDeltaLnfloatmax acct+symbol 60s EMA $delta long (positive number; <= 0 is no limit) [will immediately cxl all option orders in a symbol if any order in the symbol breaches]
550symEmaCxlDDeltaShfloatmax acct+symbol 60s EMA $delta short (positive number; <= 0 is no limit)
553symEmaCxlWtVegaLnfloatmax acct+symbol 60s EMA wtVega long (positive number; <= 0 is no limit) [will immediately cxl all option orders in a symbol if any order in the symbol breaches]
556symEmaCxlWtVegaShfloatmax acct+symbol 60s EMA wtVega short (positive number; <= 0 is no limit)
559traderNamestring(32)Name of the trader associated with the order
562userData1text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
565userData2text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
568childDatatext1client supplied data field; passes through to down stream child orders
571checksumbyteMust be set to 13. This helps detect some column/value misalignments.

REPEATING FIELDS

DirectedCounterParty

FieldTypeComment
581clientFirmstring(16)
582inclExclenum : InclExclDisclose

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

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

# 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 = 'spdrActionType|altOrderId|altAutoHedgeId|altAccnt|altUserName|accntRouteCode|execBrkrCode|externExDest|externParams|strategy|orderDttm|orderSize|orderActiveSize|addCumFillQuantity|exchMask|maxExposureSize|numMakeExchanges|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|twapSliceCnt|progressExposeTime|auctionResponder|maxMakeExchFee|maxTakeExchFee|incTakeExchFee|incMakeExchFee|makeExchRule|triggerType|triggerLevel|cxlUPrcRange|minUBid|maxUAsk|minMaxType|minOptionPx|maxChildOrders|spdrStageType|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|startType|parentOrderHandling|parentBalanceHandling|blockVisibility|includeSRNetwork|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|orderPrcLimit|orderRefUPrc|orderRefDelta|orderRefGamma|orderVolLimit|rateOverride|sdivOverride|ddivOverride|overrideCode|orderPrcOffset|orderRefEventMult|orderRefEventDttm|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|takeSurfPrcOffset|takeSurfVolOffset|takeSurfWidthOffset|makeSurfPrcOffset|makeSurfVolOffset|makeSurfWidthOffset|autoHedge|hedgeInstrument|hedgeFKey|hedgeBetaRatio|hedgeScope|hedgeSession|positionType|ssaleFlag|firmType|theoVol|riskGroupId|reqAuxRiskGroupCtrl|refRMetric1Src|refRMetric2Src|refRMetric3Src|refRMetric4Src|refRMetric5Src|refRMetric6Src|refRMetric7Src|orderRefRMetric1|orderRefRMetric2|orderRefRMetric3|orderRefRMetric4|orderRefRMetric5|orderRefRMetric6|orderRefRMetric7|expDayWtVegaOffset|maxExpDayWtVegaLn|maxExpDayWtVegaSh|maxExpDayRMetric6Ln|maxExpDayRMetric6Sh|symDayDDeltaOffset|maxSymDayDDeltaLn|maxSymDayDDeltaSh|symDayVegaOffset|maxSymDayVegaLn|maxSymDayVegaSh|symDayWtVegaOffset|maxSymDayWtVegaLn|maxSymDayWtVegaSh|maxSymDayRMetric7Ln|maxSymDayRMetric7Sh|maxGrpDayDDeltaLn|maxGrpDayDDeltaSh|maxGrpDayVegaLn|maxGrpDayVegaSh|maxGrpDayVegaAbs|grpDayVegaRatio|maxGrpDayContractsLn|maxGrpDayContractsSh|maxGrpDayContractsAbs|maxGrpDayRMetric1Ln|maxGrpDayRMetric1Sh|maxGrpDayRMetric1Abs|grpDayRMetric1Ratio|maxGrpDayRMetric2Ln|maxGrpDayRMetric2Sh|maxGrpDayRMetric3Ln|maxGrpDayRMetric3Sh|maxGrpDayRMetric4Ln|maxGrpDayRMetric4Sh|maxGrpDayRMetric5Ln|maxGrpDayRMetric5Sh|symEmaCxlDDeltaLn|symEmaCxlDDeltaSh|symEmaCxlWtVegaLn|symEmaCxlWtVegaSh|traderName|userData1|userData2|childData|checksum'

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

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'spdrActionType|altOrderId|altAutoHedgeId|altAccnt|altUserName|accntRouteCode|execBrkrCode|externExDest|externParams|strategy|orderDttm|orderSize|orderActiveSize|addCumFillQuantity|exchMask|maxExposureSize|numMakeExchanges|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|twapSliceCnt|progressExposeTime|auctionResponder|maxMakeExchFee|maxTakeExchFee|incTakeExchFee|incMakeExchFee|makeExchRule|triggerType|triggerLevel|cxlUPrcRange|minUBid|maxUAsk|minMaxType|minOptionPx|maxChildOrders|spdrStageType|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|startType|parentOrderHandling|parentBalanceHandling|blockVisibility|includeSRNetwork|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|orderPrcLimit|orderRefUPrc|orderRefDelta|orderRefGamma|orderVolLimit|rateOverride|sdivOverride|ddivOverride|overrideCode|orderPrcOffset|orderRefEventMult|orderRefEventDttm|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|takeSurfPrcOffset|takeSurfVolOffset|takeSurfWidthOffset|makeSurfPrcOffset|makeSurfVolOffset|makeSurfWidthOffset|autoHedge|hedgeInstrument|hedgeFKey|hedgeBetaRatio|hedgeScope|hedgeSession|positionType|ssaleFlag|firmType|theoVol|riskGroupId|reqAuxRiskGroupCtrl|refRMetric1Src|refRMetric2Src|refRMetric3Src|refRMetric4Src|refRMetric5Src|refRMetric6Src|refRMetric7Src|orderRefRMetric1|orderRefRMetric2|orderRefRMetric3|orderRefRMetric4|orderRefRMetric5|orderRefRMetric6|orderRefRMetric7|expDayWtVegaOffset|maxExpDayWtVegaLn|maxExpDayWtVegaSh|maxExpDayRMetric6Ln|maxExpDayRMetric6Sh|symDayDDeltaOffset|maxSymDayDDeltaLn|maxSymDayDDeltaSh|symDayVegaOffset|maxSymDayVegaLn|maxSymDayVegaSh|symDayWtVegaOffset|maxSymDayWtVegaLn|maxSymDayWtVegaSh|maxSymDayRMetric7Ln|maxSymDayRMetric7Sh|maxGrpDayDDeltaLn|maxGrpDayDDeltaSh|maxGrpDayVegaLn|maxGrpDayVegaSh|maxGrpDayVegaAbs|grpDayVegaRatio|maxGrpDayContractsLn|maxGrpDayContractsSh|maxGrpDayContractsAbs|maxGrpDayRMetric1Ln|maxGrpDayRMetric1Sh|maxGrpDayRMetric1Abs|grpDayRMetric1Ratio|maxGrpDayRMetric2Ln|maxGrpDayRMetric2Sh|maxGrpDayRMetric3Ln|maxGrpDayRMetric3Sh|maxGrpDayRMetric4Ln|maxGrpDayRMetric4Sh|maxGrpDayRMetric5Ln|maxGrpDayRMetric5Sh|symEmaCxlDDeltaLn|symEmaCxlDDeltaSh|symEmaCxlWtVegaLn|symEmaCxlWtVegaSh|traderName|userData1|userData2|childData|checksum'

# 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 = 'spdrActionType: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 = 'OptOrderGateway'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'spdrActionType|altOrderId|altAutoHedgeId|altAccnt|altUserName|accntRouteCode|execBrkrCode|externExDest|externParams|strategy|orderDttm|orderSize|orderActiveSize|addCumFillQuantity|exchMask|maxExposureSize|numMakeExchanges|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|twapSliceCnt|progressExposeTime|auctionResponder|maxMakeExchFee|maxTakeExchFee|incTakeExchFee|incMakeExchFee|makeExchRule|triggerType|triggerLevel|cxlUPrcRange|minUBid|maxUAsk|minMaxType|minOptionPx|maxChildOrders|spdrStageType|marketSession|startDttm|orderDuration|activeDuration|goodTillDttm|startType|parentOrderHandling|parentBalanceHandling|blockVisibility|includeSRNetwork|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|orderPrcLimit|orderRefUPrc|orderRefDelta|orderRefGamma|orderVolLimit|rateOverride|sdivOverride|ddivOverride|overrideCode|orderPrcOffset|orderRefEventMult|orderRefEventDttm|takeAlphaType|makeAlphaType|takeAlphaFactor|makeAlphaFactor|takeProbability|makeProbability|takeSurfPrcOffset|takeSurfVolOffset|takeSurfWidthOffset|makeSurfPrcOffset|makeSurfVolOffset|makeSurfWidthOffset|autoHedge|hedgeInstrument|hedgeFKey|hedgeBetaRatio|hedgeScope|hedgeSession|positionType|ssaleFlag|firmType|theoVol|riskGroupId|reqAuxRiskGroupCtrl|refRMetric1Src|refRMetric2Src|refRMetric3Src|refRMetric4Src|refRMetric5Src|refRMetric6Src|refRMetric7Src|orderRefRMetric1|orderRefRMetric2|orderRefRMetric3|orderRefRMetric4|orderRefRMetric5|orderRefRMetric6|orderRefRMetric7|expDayWtVegaOffset|maxExpDayWtVegaLn|maxExpDayWtVegaSh|maxExpDayRMetric6Ln|maxExpDayRMetric6Sh|symDayDDeltaOffset|maxSymDayDDeltaLn|maxSymDayDDeltaSh|symDayVegaOffset|maxSymDayVegaLn|maxSymDayVegaSh|symDayWtVegaOffset|maxSymDayWtVegaLn|maxSymDayWtVegaSh|maxSymDayRMetric7Ln|maxSymDayRMetric7Sh|maxGrpDayDDeltaLn|maxGrpDayDDeltaSh|maxGrpDayVegaLn|maxGrpDayVegaSh|maxGrpDayVegaAbs|grpDayVegaRatio|maxGrpDayContractsLn|maxGrpDayContractsSh|maxGrpDayContractsAbs|maxGrpDayRMetric1Ln|maxGrpDayRMetric1Sh|maxGrpDayRMetric1Abs|grpDayRMetric1Ratio|maxGrpDayRMetric2Ln|maxGrpDayRMetric2Sh|maxGrpDayRMetric3Ln|maxGrpDayRMetric3Sh|maxGrpDayRMetric4Ln|maxGrpDayRMetric4Sh|maxGrpDayRMetric5Ln|maxGrpDayRMetric5Sh|symEmaCxlDDeltaLn|symEmaCxlDDeltaSh|symEmaCxlWtVegaLn|symEmaCxlWtVegaSh|traderName|userData1|userData2|childData|checksum'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrActionType|addCumFillQuantity|publicSize|randomizeSize|canOverlapCxlRepl|progressRule|auctionResponder|incTakeExchFee|incMakeExchFee|makeExchRule|triggerType|cxlUPrcRange|minMaxType|spdrStageType|marketSession|startType|parentOrderHandling|parentBalanceHandling|blockVisibility|includeSRNetwork|orderLimitType|takeLimitClass|makeLimitClass|takeReachRule|overrideCode|takeAlphaType|makeAlphaType|autoHedge|hedgeInstrument|hedgeScope|hedgeSession|positionType|ssaleFlag|firmType|reqAuxRiskGroupCtrl|refRMetric1Src|refRMetric2Src|refRMetric3Src|refRMetric4Src|refRMetric5Src|refRMetric6Src|refRMetric7Src'

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

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