Skip to main content
Version: Upcoming

Schema: SpdrChildOrder (ID: 1540)

SpdrChildOrder records are published when SpiderRock sends orders to downstream exchanges or venues. These records update as the state of the child order updates.

SpdrChildOrder records are published to the SpiderRock elastic cluster when they have reached a terminal state.

METADATA

AttributeValue
Topic1525-child-orders
MLink TokenInternal
MLink EndpointMLink-Live
SRSE Product

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

BODY

#FieldTypeDefault ValueComment
10=clOrdIdlong
100sysRealmenum : SysRealm
103sysEnvironmentenum : SysEnvironmentoriginal (source) sys environment [Stable, Current, etc]
106runStatusenum : RunStatusoriginal (source) run status [Prod,Beta]
1160custClOrdIdlongcust side.clOrdId (non-zero when shape = Cross or MLegCross)
115altOrderIdstring(24)parent/client clOrdId
118altAccountstring(32)altAccount
121altUserNamestring(24)altUserName
124recordVersionshortrecord instance number (1 = original record; 2 = 1st update, etc)
127recordSourceenum : RecordSource
130riskGroupIdlongparent order risk group Id
133triggerGroupIdlongWaitTrigger group Id
136triggerTimestamplongWaitTrigger trigger timestamp (nanoseconds since epoch)
139parentNumberlongorder number from parent order
142parentVersionshortSPDR order instance number (1 = original order; 2 = 1st cancel/replace, etc)
145baseParentNumberlongbase order number (first parent number in chain)
1196prevParentNumberlongprevious order number (prior parent number to this order in chain)
148parent390Numberlongparent order number for 390 counting purposes (can be forwarded to downstream brokers)
151packageIdlongparent order package Id
154spdrSourceenum : SpdrSource
157groupingCodelong
160responseIdstring(20)usually an exch auction response ID
163responseTypestring(4)usually an exch auction response type
166streetClOrdIdstring(24)usually clOrdID.X16 but can be different if street gateway was translating clOrdId
169streetOrderIdstring(24)street side order ID (for canceling order)
172streetDirectedenum : YesNowas this order directed after being sent downstream? (usually yes unless a smartrouter is involved)
175streetHeldenum : YesNowas this order "Held" (yes) or "Not Held" after being sent downstream (usually yes)
178accntstring(16)primary (customer side) account
181clientFirmstring(16)primary (customer side) client firm
1208strategyAccntstring(16)SR strategy account
1161coreClientFirmstring(16)
1162sponsorClientFirmstring(16)
184priAggGroupstring(16)primary aggregation group
187secAggGroupstring(16)secondary aggregation group
190noCrossGroupstring(16)no-cross group for this accnt
193userNamestring(24)
196childShapeenum : SpdrOrderShape
199routeTypeenum : RouteType
202secKeyOptionKey
205secTypeenum : SpdrKeyTypenote: MLeg and Stock both mean only the TickerKey portion of the secKey is valid
208fkeyExpiryKeyunderlier (if option on future); reference future (if trade at settlement; priceType != None)
211tickerTickerKeybase stock key (all orders)
214stripestring(4)
1163engineNamestring(32)machine name of the execution engine that created the child order
220destinationTypeenum : DestinationTypetype of industry member
223routingCodetext1routing code order was sent on
226orderSizeint
229orderSideenum : BuySell
232isFlipSideenum : YesNo
235priceTypeenum : PriceType
238orderPricedouble
241exchOrderPricedoubleeg. iLink price
244exchDisplayFactordouble
247exchMinTickSizedouble
250exchPricePrecisionbyte
253orderExchint
1204orderExDeststring(16)
259isDirectedenum : YesNochild order isDirected flag
262timeInForceenum : TimeInForce
265orderExpireDttmDateTime
1164marketSessionenum : MarketSession
268massQteenum : YesNo
271isoSweepenum : YesNo
274makeOnlyenum : YesNo
277doNotRouteenum : YesNo
280waitTriggerIdtext1
283contingencyenum : SGContingencyStreetGW fast contingency (if any exists)
286contingentLeveldoubleStreetGW contingency trigger level
289contingentSecKeyOptionKey
292actionenum : SGContingentAction
295tick2Actionfloatlatency (seconds) between tick srcTimestamp and sgw send time
298actionLatencyfloatlatency (seconds) between sqw send time and action acknowledgement time
301orderTypeenum : SpdrOrderType
304pegOffsetdoubleprice offset to be used with 'Peg' order types; (+) = more aggressive, (-) = less aggressive
307isPegOrderenum : YesNoYes if order sent to exchange as 'Peg' style (returned in exec report)
310tradingSessionenum : TradingSession
313underliersPerCnintoption delivery underliers per contract
316underlierTypeenum : UnderlierTypetype of underlier (affects $greek calculations)
319tickValuefloat$NLV value of a single tick change in display premium (pointValue = tickValue / tickSize)
322pointValuefloat$NLV value of a single point change in display premium (pointValue = tickValue / tickSize)
325pointCurrencyenum : Currency
328uPrcRatiofloatUPrcRatio (SymbolRatio)
331securityIDstring(24)from ProductDefinition.securityID
334securityDesctext1from ProductDefinition.securityDesc
337productGroupstring(6)from ProductDefinition.productGroup
340productClassenum : ProductClassfrom ProductDefinition.productClass
1211productComplexstring(3)
1251micstring(4)
343undKeyExpiryKeyfrom ProductDefinition.undKey
346undTypeenum : SpdrKeyTypefrom ProductDefinition.undType
349childOrderHandlingstring(24)
352algoHandlerenum : ChildHandleralgo handler for this child order
1212algoMifidIdstring(24)
355strategystring(36)parent order strategy string (can be user supplied)
358methodstring(8)SpiderRock execution method
361sourcestring(12)SpiderRock order source
364externParamtext1
367mktDataDetailtext1
370mmPrefCodestring(6)
1197mmCreditfloat
373riskResetCodestring(6)
376firmTypeenum : FirmType
379orderCapacityenum : OrderCapacity
382ssaleFlagenum : ShortSaleFlagprimary short sale flag (single leg orders)
385positionTypeenum : PositionTypeprimary position type (single leg orders)
388futCustTypeenum : FutCustType
391futClearRngenum : FutClearingRange
394firmPositionint
397openSellShint
400locateQuanintavailable locate quantity (if selling short) @ child order send time
403locateFirmstring(6)firm granting the locate (also locate firm used on street FIX orders)
406locatePoolstring(16)locate pool @ firm granting the locate
1214requireLocateenum : RequireLocatelocate check enforced in SR systems
412exchTraderIdstring(16)
415largeTraderIdstring(16)
418tradingLocationstring(16)
421clearingFirmstring(4)clearing firm from account config [not visible in fix templates]
424clearingAccntstring(16)clearing accnt from account config [not visible in fix templates]
1194execBrkrCodestring(16)
1198execBrkrMPIDstring(8)from ExecBrokerDefinition
433execBrkrAccntstring(16)
436execBrkrClFirmstring(16)
439execBrkrUserNamestring(16)
442clearingFlipTypeenum : FlipType[visible in all fix templates]
445clearingFlipFirmstring(6)[visible in all fix templates]
448clearingFlipAccntstring(10)[visible in all fix templates]
1165clearingAgentstring(10)[visible in all fix templates]
1166clearingTaxIDstring(10)[visible in all fix templates]
1215clearingBrkrMPIDstring(8)equity clearing broker MPID
689badgestring(16)exchange memembership and badge id
451relationshipTypeenum : RelationshipTypetype of SR <-> client relationship
454orderStatusenum : OrderStatus
457rejectReasonenum : ChildRejectReason
460orderCreateDttmDateTimeorder send time
463orderCreateLatencyfloatorder send to order ack latency (in milliseconds)
466orderCreateReasonenum : ChildCreateReason
469orderCreatePriorityenum : RoutePriority
472orderCancelTexttext1cancel reason (from algo handler)
475orderCancelDttmDateTimeorder cancel time
478orderCancelLatencyfloatcancel send to cancel ack latency (in milliseconds)
481orderCancelReasonenum : ChildCancelReason
484orderCancelPriorityenum : RoutePriority
487orderSendTimestamplongnet timestamp of child order send (EE to SGW)
490orderWorkingDttmDateTimeorder send ack time (acknowleged working/new) (first exec report indicating the order is active)
493orderClosedDttmDateTimeorder terminated ack time (first exec report indicating the order is in a terminal state;eg. cancelled, filled, rejected, etc)
496orderCancelFlagenum : YesNoindicated the algo handler attempted to cancel the order while it was in a working state (does not necessarily mean that a cancel message was generated and send)
499isPersistentenum : YesNoindicates whether the child order should persist till rotation period (even if not filled)
502lastStreetTexttext1text message on the (initial) exec report terminating the order sequence
505cumFillQuantityintcum fill quantity (SUM: ExecReport.lastQuantity)
508avgFillPricedoubleavg fill price (AVG: ExecReport.lastPrice)
511cumFillQtyExecintfrom ExecReport.cumFillQuantity
514avgFillPrcExecdoublefrom ExecReport.avgFillPrice
517lastMsgSeqNumintlargest execReport.msgSeqNum process for this child order
520numExecutionsshortnum ExecReports w/lastQuantity > 0
523leavesQtyint
526uLeveldoubleEE level contingency threshold
529uContingencyenum : Contingency
532makerTakerenum : MakerTaker
535parentLmtPricedouble
538parentLmtRefUPrcdouble
541nbboBiddoublenbbo bid @ child order send
544nbboAskdoublenbbo ask @ child order send
547nbboBidSzintnbbo bid size @ child order send
550nbboAskSzintnbbo ask size @ child order send
553exchBiddoubleexch bid @ child order send
556exchAskdoubleexch ask @ child order send
559exchBidSzintexch bid size @ child order send
562exchAskSzintexch ask size @ child order send
565mktStanceenum : MktStance
568uPrcdoubleunderlier price when child order sent (ref uPrc for DAC orders)
571uBiddoubleunderlier bid when child order sent
574uAskdoubleunderlier ask when child order sent
577uBidSzintunderlier bid size when child order sent
580uAskSzintunderlier ask size when child order sent
583uBidCxldoubleunderlier bid when cancel sent (if any)
586uAskCxldoubleunderlier ask when cancel sent (if any)
589surfVolfloatoption only
592surfPricefloatoption only
595childVolfloatchild order volatility [price, parentLmtRefUPrc]
598childProbfloatprobability @ child send time
601childVolAtmfloatatm volatility @ child send time
604cnDefloatcnDe
607cnDdfloatcnDd
616cnVefloatcnVe
1167riskStkSizefloatrisk stk size
1168riskFutSizefloatrisk fut size
1169riskOptSizefloatrisk opt size
1170riskVegafloatrisk vega
1171riskWtVegafloatrisk gamma
1172riskNValuefloatrisk delta
1173riskDeltafloatrisk delta
1174riskDDeltafloatrisk ddelta
1175riskRm1floatuser defined (from parent order) [used to manage order groups
1176riskRm2floatuser defined (from parent order) [used to manage order groups]
1177riskRm3floatuser defined (from parent order) [used to manage order groups]
1178riskRm4floatuser defined (from parent order) [used to manage order groups]
1179riskRm5floatuser defined (from parent order) [used to manage order groups]
1180riskRm6floatuser defined (from parent order) [used to manage order groups]
1181riskRm7floatuser defined (from parent order) [used to manage order groups]
1182marginUDnVDnfloatunderlier down, vol down
1183marginUDnVUpfloatunderlier down, vol up
1184marginUUpVDnfloatunderlier up, vol down
1185marginUUpVUpfloatunderlier up, vol up
1186riskU50Dnfloatunderlier dn 50% shock slide
1187riskU50Upfloatunderlier up 50% shock slide
658catSrcBrkrIMIDtext1B/D firm FDID (only exists if a B/D is the source) (supplied by FINRA fbo client) (from ClientFirm.catSrcBrkrIMID)
661catReportableenum : CatReportTypeCAT reportable type (from AccountConfig.catReportable)
664catSrcAccntTypeenum : CatAccntTypeCAT account holder type (from AccountConfig.catSrcAccntType [Eqt, Opt])
667catSrcFirmTypeenum : CatFirmTypeCAT source type (from AccountConfig.catSrcFirmType [Eqt, Opt])
670catDestFirmIMIDtext1Destination Firm IMID (supplied by FINRA fbo destination; can be B/D or Exchange) (always exists) (from AccountRouteConfig.catDestFirmIMID [Eqt, Opt])
673catDestDeptTypeenum : CatDeptTypeCAT destination type (from AccountRouteConfig.castDestType [Eqt, Opt])
676catExchSessionIDtext1CAT exchange session name
679catParentCreateDttmDateTimeParentOrder CreateDttm
682catParentCancelDttmDateTimeParentOrder CancelDttm
685catAccnttext1CAT Firm Designated ID
688catBrkrAccnttext1Brokers CAT Firm Designated ID
1249catAccntOriginCodestring(4)CAT exchange origin code field. market maker, b/d, pro-cust, etc
691userData1text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
694userData2text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
697childDatatext1client supplied data field; passes through to down stream child orders
700timestampDateTime
1216completionTypeenum : CompletionType
1217completionStateenum : CompletionState
1218completionRefUPrcdouble
1219completionRefDeltafloatref delta (single leg orders only)
1220avgCompletionPricedoublecompletion trade price (final trade price) (package price if MLEG)
1221completionSecKeyOptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1222completionSecTypeenum : SpdrKeyTypeusually Future or Option (None if not yet valid) (single leg orders only)
1188faceClOrdIdlongface side.clOrdId (alternate clOrdID)
1213noticeNumberlongauction notice ID (if cross)
706faceCrossHandlingenum : CrossHandling
1205faceCrossAttrenum : CrossAttrSweepCross = Request Exch Sweep Away market; ISOCross = Mark cross as ISO (we have already swept markets; if required)
709faceHasBestPriceenum : YesNo
712faceBestOrderPricedoublebest limit price of facilitation side
715faceParticipationenum : FaceParticipationmin or max facilitation participation
718faceCumFillQuantityintcum fill quantity (SUM: faceSide.lastQuantity) [all allocation sides]
721faceAvgFillPricedoubleavg fill price (SUM: faceSide.avgFillPrice * faceSide.lastQuantity) / (SUM: faceSide.lastQuantity)
724faceLeavesQtyint(SUM: faceSide.leavesQty)
883stockLegenum : YesNofor OATS reporting purposes

REPEATING FIELDS

FaceSide

#FieldTypeDefault ValueComment
730allocTypeenum : FaceAllocTypenote: only ExecAccnt FaceSide(s) are included in corresponding NewOrderCross/NewOrderMLegCross messages
733allocIdbyteallocation ID for this FaceSide record (1 - 10)
1189allocClOrdIdlongunique allocClOrdID for this FaceSide record (SRGuid)
739altOrderIdstring(24)parent client clOrdId
742accntstring(16)
745clientFirmstring(16)
1209strategyAccntstring(16)
1190coreClientFirmstring(16)
1191sponsorClientFirmstring(16)
748altAccountstring(32)altAccount
751aggGroupstring(16)aggregation group accntFace
754noCrossGroupstring(16)no-cross group for this accnt
757firmTypeenum : FirmType
760orderCapacityenum : OrderCapacity
763ssaleFlagenum : ShortSaleFlagprimary short sale flag (single leg orders)
766positionTypeenum : PositionTypeprimary position type (single leg orders)
769futCustTypeenum : FutCustType
772futClearRngenum : FutClearingRange
775allocSizeintsize/quantity of this allocation slice; (SUM: faceSide.allocRequestQty) == top.orderSize
778allocCumFillQtyintcum fill quantity (SUM: ExecReport.lastQuantity)
781allocAvgPricedoubleavg fill price (AVG: ExecReport.lastPrice)
784allocLeavesQtyintopen allocationRequestQty (leavesQty)
787cumFillQtyExecintfrom ExecReport.cumFillQuantity
790avgFillPrcExecdoublefrom ExecReport.avgFillPrice
793lastMsgSeqNumintlargest execReport.msgSeqNum process for this child order
796numExecutionsshortnum ExecReports w/lastQuantity > 0
799firmPositionint
802openSellShint
805locateQuanintavailable locate quantity (if selling short) @ child order send time
808locateFirmstring(6)firm granting the locate
811locatePoolstring(16)locate pool @ firm granting the locate
814locateSourcestring(12)retaining from V7
817exchTraderIdstring(16)
820largeTraderIdstring(16)
823tradingLocationstring(16)
1200capStrategyIDstring(12)from AccountExchGroup (only used on cap eligible strategies)
826clearingFirmstring(4)from AccountConfig
829clearingAccntstring(16)from AccountConfig
1195execBrkrCodestring(16)
838execBrkrAccntstring(16)
841execBrkrClFirmstring(16)
844execBrkrUserNamestring(16)
847relationshipTypeenum : RelationshipTypetype of SR <-> client relationship
850clearingFlipTypeenum : FlipType[visible in all fix templates]
853clearingFlipFirmstring(6)[visible in all fix templates]
856clearingFlipAccntstring(10)[visible in all fix templates]
1192clearingAgentstring(10)[visible in all fix templates]
1193clearingTaxIDstring(10)[visible in all fix templates]
1223clearingBrkrMPIDstring(8)
848badgestring(16)exchange memembership and badge id
859catSrcBrkrIMIDstring(16)B/D firm FDID (only exists if a B/D is the source) (supplied by FINRA fbo client) (from ClientFirm.catSrcBrkrIMID)
862catReportableenum : CatReportTypeCAT reportable type (from AccountConfig.catReportable)
865catSrcAccntTypeenum : CatAccntTypeCAT account holder type (from AccountConfig.catSrcAccntType [Eqt, Opt])
868catSrcFirmTypeenum : CatFirmTypeCAT source type (from AccountConfig.catSrcType [Eqt, Opt])
871catParentCreateDttmDateTimeParentOrder CreateDttm
874catParentCancelDttmDateTimeParentOrder CancelDttm
877catAccntstring(40)CAT Firm Designated ID
880catBrkrAccntstring(40)Brokers CAT Firm Designated ID
1250catAccntOriginCodestring(4)CAT exchange origin code field. market maker, b/d, pro-cust, etc

OrderLegs

#FieldTypeDefault ValueComment
889lastLegRefIdlong
892lastFillDttmDateTime
895cumSquareQtyintcum spread quantity filled (all legs received)
898avgSquarePrcdouble
901lastSquareDttmDateTime
904cumPartialQtyintcum spread quantity partially filled (at least one leg received) [expected cumFilledQty if all legs square up]
1210spreadClassenum : SpreadClass
1202spreadFlavorenum : SpreadFlavorspread flavor of this order
1203containsHedgeenum : YesNoif this order contains a stock/future leg
907tickerTickerKeystock ticker
910stockSideenum : BuySell[Buy
913stockSharesintnumber of shares included (zero if none)
916stockLegIdlong
919ssaleFlagenum : ShortSaleFlag
922stockCumFillQtyint
925stockAvgFillPrcdouble
1224stockRefPricedoublestock leg ref price (FLEX)
928numLegsbytenumber of valid legs below
931secKey1OptionKeyleg #1
934secType1enum : SpdrKeyType
937mult1ushort
940side1enum : BuySell
943legId1long
946posType1enum : PositionType
949legCumFillQty1int
952legAvgFillPrc1double
1225legRefPrice1doubleleg ref price (FLEX)
1226legRefDelta1floatcompletion ref delta
1227legCmplSecKey1OptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1228legCmplSecType1enum : SpdrKeyTypeusually Future or Option (None if not yet valid)
955secKey2OptionKeyleg #2
958secType2enum : SpdrKeyType
961mult2ushort
964side2enum : BuySell
967legId2long
970posType2enum : PositionType
973legCumFillQty2int
976legAvgFillPrc2double
1229legRefPrice2doubleleg ref price (FLEX)
1230legRefDelta2floatcompletion ref delta (FLEX DAC)
1231legCmplSecKey2OptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1232legCmplSecType2enum : SpdrKeyTypeusually Future or Option (None if not yet valid)
979secKey3OptionKeyleg #3
982secType3enum : SpdrKeyType
985mult3ushort
988side3enum : BuySell
991legId3long
994posType3enum : PositionType
997legCumFillQty3int
1000legAvgFillPrc3double
1233legRefPrice3doubleleg ref price (FLEX)
1234legRefDelta3floatcompletion ref delta
1235legCmplSecKey3OptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1236legCmplSecType3enum : SpdrKeyTypeusually Future or Option (None if not yet valid)
1003secKey4OptionKeyleg #4
1006secType4enum : SpdrKeyType
1009mult4ushort
1012side4enum : BuySell
1015legId4long
1018posType4enum : PositionType
1021legCumFillQty4int
1024legAvgFillPrc4double
1237legRefPrice4doubleleg ref price (FLEX)
1238legRefDelta4floatcompletion ref delta
1239legCmplSecKey4OptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1240legCmplSecType4enum : SpdrKeyTypeusually Future or Option (None if not yet valid)
1027secKey5OptionKeyleg #5
1030secType5enum : SpdrKeyType
1033mult5ushort
1036side5enum : BuySell
1039legId5long
1042posType5enum : PositionType
1045legCumFillQty5int
1048legAvgFillPrc5double
1241legRefPrice5doubleleg ref price (FLEX)
1242legRefDelta5floatcompletion ref delta
1243legCmplSecKey5OptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1244legCmplSecType5enum : SpdrKeyTypeusually Future or Option (None if not yet valid)
1051secKey6OptionKeyleg #6
1054secType6enum : SpdrKeyType
1057mult6ushort
1060side6enum : BuySell
1063legId6long
1066posType6enum : PositionType
1069legCumFillQty6int
1072legAvgFillPrc6double
1245legRefPrice6doubleleg ref price (FLEX)
1246legRefDelta6floatcompletion ref delta
1247legCmplSecKey6OptionKeyfinal settlement secKey (contract that DAC, TAS, TACO, etc. will convert to; might not be valid until completed)
1248legCmplSecType6enum : SpdrKeyTypeusually Future or Option (None if not yet valid)

FaceLegs

#FieldTypeDefault ValueComment
1078lastLegRefIdlong
1081lastFillDttmDateTime
1084cumSquareQtyintcum spread quantity filled (all legs received)
1087avgSquarePrcdouble
1090lastSquareDttmDateTime
1093cumPartialQtyintcum spread quantity partially filled (at least one leg received) [expected cumFilledQty if all legs square up]
1096ssaleFlagenum : ShortSaleFlag
1099stockCumFillQtyint
1102stockAvgFillPrcdouble
1105numLegsbytenumber of valid legs below
1108posType1enum : PositionType
1111legCumFillQty1int
1114legAvgFillPrc1double
1117posType2enum : PositionType
1120legCumFillQty2int
1123legAvgFillPrc2double
1126posType3enum : PositionType
1129legCumFillQty3int
1132legAvgFillPrc3double
1135posType4enum : PositionType
1138legCumFillQty4int
1141legAvgFillPrc4double
1144posType5enum : PositionType
1147legCumFillQty5int
1150legAvgFillPrc5double
1153posType6enum : PositionType
1156legCumFillQty6int
1159legAvgFillPrc6double

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

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

# 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 = 'sysRealm|sysEnvironment|runStatus|custClOrdId|altOrderId|altAccount|altUserName|recordVersion|recordSource|riskGroupId|triggerGroupId|triggerTimestamp|parentNumber|parentVersion|baseParentNumber|prevParentNumber|parent390Number|packageId|spdrSource|groupingCode|responseId|responseType|streetClOrdId|streetOrderId|streetDirected|streetHeld|accnt|clientFirm|strategyAccnt|coreClientFirm|sponsorClientFirm|priAggGroup|secAggGroup|noCrossGroup|userName|childShape|routeType|secKey|secType|fkey|ticker|stripe|engineName|destinationType|routingCode|orderSize|orderSide|isFlipSide|priceType|orderPrice|exchOrderPrice|exchDisplayFactor|exchMinTickSize|exchPricePrecision|orderExch|orderExDest|isDirected|timeInForce|orderExpireDttm|marketSession|massQte|isoSweep|makeOnly|doNotRoute|waitTriggerId|contingency|contingentLevel|contingentSecKey|action|tick2Action|actionLatency|orderType|pegOffset|isPegOrder|tradingSession|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|uPrcRatio|securityID|securityDesc|productGroup|productClass|productComplex|mic|undKey|undType|childOrderHandling|algoHandler|algoMifidId|strategy|method|source|externParam|mktDataDetail|mmPrefCode|mmCredit|riskResetCode|firmType|orderCapacity|ssaleFlag|positionType|futCustType|futClearRng|firmPosition|openSellSh|locateQuan|locateFirm|locatePool|requireLocate|exchTraderId|largeTraderId|tradingLocation|clearingFirm|clearingAccnt|execBrkrCode|execBrkrMPID|execBrkrAccnt|execBrkrClFirm|execBrkrUserName|clearingFlipType|clearingFlipFirm|clearingFlipAccnt|clearingAgent|clearingTaxID|clearingBrkrMPID|badge|relationshipType|orderStatus|rejectReason|orderCreateDttm|orderCreateLatency|orderCreateReason|orderCreatePriority|orderCancelText|orderCancelDttm|orderCancelLatency|orderCancelReason|orderCancelPriority|orderSendTimestamp|orderWorkingDttm|orderClosedDttm|orderCancelFlag|isPersistent|lastStreetText|cumFillQuantity|avgFillPrice|cumFillQtyExec|avgFillPrcExec|lastMsgSeqNum|numExecutions|leavesQty|uLevel|uContingency|makerTaker|parentLmtPrice|parentLmtRefUPrc|nbboBid|nbboAsk|nbboBidSz|nbboAskSz|exchBid|exchAsk|exchBidSz|exchAskSz|mktStance|uPrc|uBid|uAsk|uBidSz|uAskSz|uBidCxl|uAskCxl|surfVol|surfPrice|childVol|childProb|childVolAtm|cnDe|cnDd|cnVe|riskStkSize|riskFutSize|riskOptSize|riskVega|riskWtVega|riskNValue|riskDelta|riskDDelta|riskRm1|riskRm2|riskRm3|riskRm4|riskRm5|riskRm6|riskRm7|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|riskU50Dn|riskU50Up|catSrcBrkrIMID|catReportable|catSrcAccntType|catSrcFirmType|catDestFirmIMID|catDestDeptType|catExchSessionID|catParentCreateDttm|catParentCancelDttm|catAccnt|catBrkrAccnt|catAccntOriginCode|userData1|userData2|childData|timestamp|completionType|completionState|completionRefUPrc|completionRefDelta|avgCompletionPrice|completionSecKey|completionSecType|faceClOrdId|noticeNumber|faceCrossHandling|faceCrossAttr|faceHasBestPrice|faceBestOrderPrice|faceParticipation|faceCumFillQuantity|faceAvgFillPrice|faceLeavesQty|stockLeg'

# 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 = 'altOrderId: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 = 'SpdrChildOrder'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'sysRealm|sysEnvironment|runStatus|custClOrdId|altOrderId|altAccount|altUserName|recordVersion|recordSource|riskGroupId|triggerGroupId|triggerTimestamp|parentNumber|parentVersion|baseParentNumber|prevParentNumber|parent390Number|packageId|spdrSource|groupingCode|responseId|responseType|streetClOrdId|streetOrderId|streetDirected|streetHeld|accnt|clientFirm|strategyAccnt|coreClientFirm|sponsorClientFirm|priAggGroup|secAggGroup|noCrossGroup|userName|childShape|routeType|secKey|secType|fkey|ticker|stripe|engineName|destinationType|routingCode|orderSize|orderSide|isFlipSide|priceType|orderPrice|exchOrderPrice|exchDisplayFactor|exchMinTickSize|exchPricePrecision|orderExch|orderExDest|isDirected|timeInForce|orderExpireDttm|marketSession|massQte|isoSweep|makeOnly|doNotRoute|waitTriggerId|contingency|contingentLevel|contingentSecKey|action|tick2Action|actionLatency|orderType|pegOffset|isPegOrder|tradingSession|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|uPrcRatio|securityID|securityDesc|productGroup|productClass|productComplex|mic|undKey|undType|childOrderHandling|algoHandler|algoMifidId|strategy|method|source|externParam|mktDataDetail|mmPrefCode|mmCredit|riskResetCode|firmType|orderCapacity|ssaleFlag|positionType|futCustType|futClearRng|firmPosition|openSellSh|locateQuan|locateFirm|locatePool|requireLocate|exchTraderId|largeTraderId|tradingLocation|clearingFirm|clearingAccnt|execBrkrCode|execBrkrMPID|execBrkrAccnt|execBrkrClFirm|execBrkrUserName|clearingFlipType|clearingFlipFirm|clearingFlipAccnt|clearingAgent|clearingTaxID|clearingBrkrMPID|badge|relationshipType|orderStatus|rejectReason|orderCreateDttm|orderCreateLatency|orderCreateReason|orderCreatePriority|orderCancelText|orderCancelDttm|orderCancelLatency|orderCancelReason|orderCancelPriority|orderSendTimestamp|orderWorkingDttm|orderClosedDttm|orderCancelFlag|isPersistent|lastStreetText|cumFillQuantity|avgFillPrice|cumFillQtyExec|avgFillPrcExec|lastMsgSeqNum|numExecutions|leavesQty|uLevel|uContingency|makerTaker|parentLmtPrice|parentLmtRefUPrc|nbboBid|nbboAsk|nbboBidSz|nbboAskSz|exchBid|exchAsk|exchBidSz|exchAskSz|mktStance|uPrc|uBid|uAsk|uBidSz|uAskSz|uBidCxl|uAskCxl|surfVol|surfPrice|childVol|childProb|childVolAtm|cnDe|cnDd|cnVe|riskStkSize|riskFutSize|riskOptSize|riskVega|riskWtVega|riskNValue|riskDelta|riskDDelta|riskRm1|riskRm2|riskRm3|riskRm4|riskRm5|riskRm6|riskRm7|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|riskU50Dn|riskU50Up|catSrcBrkrIMID|catReportable|catSrcAccntType|catSrcFirmType|catDestFirmIMID|catDestDeptType|catExchSessionID|catParentCreateDttm|catParentCancelDttm|catAccnt|catBrkrAccnt|catAccntOriginCode|userData1|userData2|childData|timestamp|completionType|completionState|completionRefUPrc|completionRefDelta|avgCompletionPrice|completionSecKey|completionSecType|faceClOrdId|noticeNumber|faceCrossHandling|faceCrossAttr|faceHasBestPrice|faceBestOrderPrice|faceParticipation|faceCumFillQuantity|faceAvgFillPrice|faceLeavesQty|stockLeg'

# 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 = 'altOrderId: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 = 'sysRealm: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 = 'SpdrChildOrder'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'sysRealm|sysEnvironment|runStatus|custClOrdId|altOrderId|altAccount|altUserName|recordVersion|recordSource|riskGroupId|triggerGroupId|triggerTimestamp|parentNumber|parentVersion|baseParentNumber|prevParentNumber|parent390Number|packageId|spdrSource|groupingCode|responseId|responseType|streetClOrdId|streetOrderId|streetDirected|streetHeld|accnt|clientFirm|strategyAccnt|coreClientFirm|sponsorClientFirm|priAggGroup|secAggGroup|noCrossGroup|userName|childShape|routeType|secKey|secType|fkey|ticker|stripe|engineName|destinationType|routingCode|orderSize|orderSide|isFlipSide|priceType|orderPrice|exchOrderPrice|exchDisplayFactor|exchMinTickSize|exchPricePrecision|orderExch|orderExDest|isDirected|timeInForce|orderExpireDttm|marketSession|massQte|isoSweep|makeOnly|doNotRoute|waitTriggerId|contingency|contingentLevel|contingentSecKey|action|tick2Action|actionLatency|orderType|pegOffset|isPegOrder|tradingSession|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|uPrcRatio|securityID|securityDesc|productGroup|productClass|productComplex|mic|undKey|undType|childOrderHandling|algoHandler|algoMifidId|strategy|method|source|externParam|mktDataDetail|mmPrefCode|mmCredit|riskResetCode|firmType|orderCapacity|ssaleFlag|positionType|futCustType|futClearRng|firmPosition|openSellSh|locateQuan|locateFirm|locatePool|requireLocate|exchTraderId|largeTraderId|tradingLocation|clearingFirm|clearingAccnt|execBrkrCode|execBrkrMPID|execBrkrAccnt|execBrkrClFirm|execBrkrUserName|clearingFlipType|clearingFlipFirm|clearingFlipAccnt|clearingAgent|clearingTaxID|clearingBrkrMPID|badge|relationshipType|orderStatus|rejectReason|orderCreateDttm|orderCreateLatency|orderCreateReason|orderCreatePriority|orderCancelText|orderCancelDttm|orderCancelLatency|orderCancelReason|orderCancelPriority|orderSendTimestamp|orderWorkingDttm|orderClosedDttm|orderCancelFlag|isPersistent|lastStreetText|cumFillQuantity|avgFillPrice|cumFillQtyExec|avgFillPrcExec|lastMsgSeqNum|numExecutions|leavesQty|uLevel|uContingency|makerTaker|parentLmtPrice|parentLmtRefUPrc|nbboBid|nbboAsk|nbboBidSz|nbboAskSz|exchBid|exchAsk|exchBidSz|exchAskSz|mktStance|uPrc|uBid|uAsk|uBidSz|uAskSz|uBidCxl|uAskCxl|surfVol|surfPrice|childVol|childProb|childVolAtm|cnDe|cnDd|cnVe|riskStkSize|riskFutSize|riskOptSize|riskVega|riskWtVega|riskNValue|riskDelta|riskDDelta|riskRm1|riskRm2|riskRm3|riskRm4|riskRm5|riskRm6|riskRm7|marginUDnVDn|marginUDnVUp|marginUUpVDn|marginUUpVUp|riskU50Dn|riskU50Up|catSrcBrkrIMID|catReportable|catSrcAccntType|catSrcFirmType|catDestFirmIMID|catDestDeptType|catExchSessionID|catParentCreateDttm|catParentCancelDttm|catAccnt|catBrkrAccnt|catAccntOriginCode|userData1|userData2|childData|timestamp|completionType|completionState|completionRefUPrc|completionRefDelta|avgCompletionPrice|completionSecKey|completionSecType|faceClOrdId|noticeNumber|faceCrossHandling|faceCrossAttr|faceHasBestPrice|faceBestOrderPrice|faceParticipation|faceCumFillQuantity|faceAvgFillPrice|faceLeavesQty|stockLeg'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'sysRealm|sysEnvironment|runStatus|recordSource|spdrSource|streetDirected|streetHeld|childShape|routeType|secType|destinationType|orderSide|isFlipSide|priceType|isDirected|timeInForce|marketSession|massQte|isoSweep|makeOnly|doNotRoute|contingency|action|orderType|isPegOrder|tradingSession|underlierType|pointCurrency|productClass|undType|algoHandler|firmType|orderCapacity|ssaleFlag|positionType|futCustType|futClearRng|requireLocate|clearingFlipType|relationshipType|orderStatus|rejectReason|orderCreateReason|orderCreatePriority|orderCancelReason|orderCancelPriority|orderCancelFlag|isPersistent|uContingency|makerTaker|mktStance|catReportable|catSrcAccntType|catSrcFirmType|catDestDeptType|completionType|completionState|completionSecType|faceCrossHandling|faceCrossAttr|faceHasBestPrice|faceParticipation|stockLeg'

# 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 = 'altOrderId: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 = 'SpdrChildOrder'

# 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 = 'altOrderId: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)