Skip to main content
Version: Upcoming

Schema: SpdrParentBrkrEvent (ID: 4065)

SpdrParentBrkrEvent records are published when a new or cxl/replace parent order arrives causes a broker to begin working and again when a parent order terminates and the underlying broker stops working. The initial version contains state and market data from just after the initial risk check and first attempt at generating child orders.

METADATA

AttributeValue
Topic3985-parent-orders
MLink TokenClientTrading
SRSE ProductSRTrade

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

BODY

#FieldTypeComment
10=parentNumberlong
11=recTypeenum : EventRecTypetype of record [New,Modify,Replace,Close,Reject]
100secKeyOptionKey
103secTypeenum : SpdrKeyType
106accntstring(16)
109spdrSourceenum : SpdrSource
112groupingCodelong
115orderSideenum : BuySell
118clientFirmstring(16)SR client firm code
121altAccnttext1alternate (client assigned) "long" account string (optional)
124altUserNamestring(24)alternate (client assigned) user name (optional)
127eventNumberushort
130stageTypeenum : SpdrStageTypeparent is a staged order [ToolVisible]
371stageReviewenum : StageReview
133baseParentNumberlongSPDR order number (initial number in cancel/replace sequence) (also, source parent for dynamically generated orders;eg auto-hedges)
136prevParentNumberlongSPDR order number (order being cancelled/replaced) (zero if none)
139engineNametext1server stripe
142tickerTickerKeySpiderRock underlier stock key
145spdrBrokerStatusenum : SpdrBrokerStatus
148spdrOrderStatusenum : SpdrOrderStatusparent order status
151spdrCloseReasonenum : SpdrCloseReasonparent order close reason (if closed)
154spdrRejectReasonenum : SpdrRejectReasonparent order reject reason (if any)
157spdrCommenttext1additional detail (close/reject reason; last child order error)
178bidPrcdoublebid (nbbo) price @ record publish
181askPrcdoubleask (nbbo) price @ record publish
184bidIVolfloatbid (nbbo) ivol @ record publish
187askIVolfloatask (nbbo) ivol @ record publish
190bidSizeintbid size (nbbo cum) @ record publish
193askSizeintask size (nbbo cum) @ record publish
196uBiddoubleunderlier bid price @ record publish (options only)
199uAskdoubleunderlier ask price @ record publish (options only)
202surfacePrcfloatSR surface price @ record publish
205surfaceVolfloatSR surface volatility @ record publish
208surfaceYrsfloatSR surface calc value @ record publish
211surfaceSDivfloatSR surface calc value @ record publish
214surfaceRatefloatSR surface calc value @ record publish
217surfaceUPrcfloatSR surface calc value @ record publish
220surfaceDefloatSR surface calc value @ record publish
223surfaceGafloatSR surface calc value @ record publish
226surfaceThfloatSR surface calc value @ record publish
229surfaceVefloatSR surface calc value @ record publish
232surfaceRofloatSR surface calc value @ record publish
235surfacePhfloatSR surface calc value @ record publish
238arriveNbboSizeintsize of the single largest exchange @ parent order arrival
241arriveNbboExchenum : OptExchexchange representing largest size @ order arrival
244arriveCumSizeintcum size of all exchanges at NBBO price @ parent order arrival
247arriveNumExchbytenum exchanges making up cum size @ parent order arrival
250arriveLimitSizeintimmediately marketable size up to limit price on parent order arrival
253arriveLimitPrcdoubleexpected average fill price if all immediately marketable size executed as advertized
256avgFillPrcdoubleaverage fill price of all fills attributed parent order
259cumFillQuanintcumulative fill quantity attributed to parent order
262numChildOrdersushorttotal number of child orders generated by this parent broker (parent number)
265numDayChildOrdersushorttotal number of child orders generated by this parent broker (all day; base parent number)
268openOrderSizeintopen order size
271actionOrderSizeintorder size available for immediate action (note: not all algo combinations allow immediate action)
274riskLimitSizeintrisk limit size (distance to most restrictive risk limit associated with this parent order)
277riskLimitDescenum : SpdrRiskreason for size reduction (identifies the most restrictive risk limit)
372riskLimitLevelenum : SpdrRiskLevelrisk limit level responsible for reduction
280riskLimitDetailtext1risk limit level responsible for reduction
283limitRefUPrcdoubleeffective reference underlier price @ record publish (usually either mid or bid/ask depending on limit type)
286limitPricedoubleparent simple prc limit (if any)
289limitVolfloatparent simple vol limit (if any)
292makeLimitPricedoubleeffective order limit price @ record publish
295makeLimitErrenum : LimitErrorlimit price error code (if any)
298makeLimitErrDesctext1additional limit price error descriptive text
301takeLimitPricedoubleeffective order limit price @ record publish
304takeLimitErrenum : LimitErrorlimit price error code (if any)
307takeLimitErrDesctext1additional limit price error descriptive text
310brokerStateenum : BrokerStatebroker monitor state
313makeStateenum : AlgoState[enum] current state of non-marketable order handler (maker)
316takeStateenum : AlgoState[enum] current state of marketable order handler (taker)
319mktCrossStateenum : MktCrossState[enum] current state of mkt cross handler (if any)
322lastChildEventenum : ChildEventmost recent child handling event
325spdrMktStateenum : SpdrMarketStatemarket state code
328numOrdersintnumber active child orders @ record send
331leavesQtyintnumber of active child order contracts (sum of all active child orders) @ record send
334childOrderLeavesintnumber of open child orders @ record send
337arrivalSDivfloateffective sdiv rate @ parent order arrival (fixed for life of parent order)
340arrivalRatefloateffective interest rate @ parent order arrival (fixed for life of parent order)
343arrivalDDivfloateffective cumulative discrete dividend @ parent order arrival (fixed for life of parent order)
346hedgeSecKeyExpiryKeyauto-hedge sec key
349hedgeSecTypeenum : SpdrKeyTypeauto-hedge sec type
352theoOpxfloatoption theo prc (from theoVol)
355theoVolfloatoption theo vol (from theoModel;if any)
358childOrderMaskuintbit-mask of all exchange for which a child order was generated
361priceFormatenum : PriceFormatprice display format code
364uPriceFormatenum : PriceFormatunderlier price display format code
367userNamestring(24)user associated with the most recent parent order
370timestampDateTimetimestamp of last modification

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

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

# 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 = 'secKey|secType|accnt|spdrSource|groupingCode|orderSide|clientFirm|altAccnt|altUserName|eventNumber|stageType|stageReview|baseParentNumber|prevParentNumber|engineName|ticker|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|bidPrc|askPrc|bidIVol|askIVol|bidSize|askSize|uBid|uAsk|surfacePrc|surfaceVol|surfaceYrs|surfaceSDiv|surfaceRate|surfaceUPrc|surfaceDe|surfaceGa|surfaceTh|surfaceVe|surfaceRo|surfacePh|arriveNbboSize|arriveNbboExch|arriveCumSize|arriveNumExch|arriveLimitSize|arriveLimitPrc|avgFillPrc|cumFillQuan|numChildOrders|numDayChildOrders|openOrderSize|actionOrderSize|riskLimitSize|riskLimitDesc|riskLimitLevel|riskLimitDetail|limitRefUPrc|limitPrice|limitVol|makeLimitPrice|makeLimitErr|makeLimitErrDesc|takeLimitPrice|takeLimitErr|takeLimitErrDesc|brokerState|makeState|takeState|mktCrossState|lastChildEvent|spdrMktState|numOrders|leavesQty|childOrderLeaves|arrivalSDiv|arrivalRate|arrivalDDiv|hedgeSecKey|hedgeSecType|theoOpx|theoVol|childOrderMask|priceFormat|uPriceFormat|userName|timestamp'

# Replace with your desired where clause.
# a string in the form "field1:eq:valuse" or "(field1:ne:value1 & field1:ne:value2)
# "WHERE" clauses can contain the following comparison symbols:
# :gt: is greater than
# :ge: is greater than or equal to
# :lt: is less than
# :le: is less than or equal to
# :eq: is equal
# :ne: is not equal
# %26 is an AND statement
# | is an OR statement
# :sw: is starts with
# :ew: is ends with
# :cv: is contains values
# :nv: is does not contain value
# :cb: is contained between (two dates for instance) separated by '$'
WHERE = 'accnt:eq:ExampleString'

# Request Parameters for getmsg Of The MsgType
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'getmsg',
"pkey": PKEY,
"msgType": MSG_TYPE,
# Optional Parameters
"view": VIEW,
"where": WHERE
}

response = requests.get(MLINK_PROD_URL, params=params)

Get Msgs API Call

import requests 

# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'

# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'

# Replace with your desired MsgType.
MSG_TYPE = 'SpdrParentBrkrEvent'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'secKey|secType|accnt|spdrSource|groupingCode|orderSide|clientFirm|altAccnt|altUserName|eventNumber|stageType|stageReview|baseParentNumber|prevParentNumber|engineName|ticker|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|bidPrc|askPrc|bidIVol|askIVol|bidSize|askSize|uBid|uAsk|surfacePrc|surfaceVol|surfaceYrs|surfaceSDiv|surfaceRate|surfaceUPrc|surfaceDe|surfaceGa|surfaceTh|surfaceVe|surfaceRo|surfacePh|arriveNbboSize|arriveNbboExch|arriveCumSize|arriveNumExch|arriveLimitSize|arriveLimitPrc|avgFillPrc|cumFillQuan|numChildOrders|numDayChildOrders|openOrderSize|actionOrderSize|riskLimitSize|riskLimitDesc|riskLimitLevel|riskLimitDetail|limitRefUPrc|limitPrice|limitVol|makeLimitPrice|makeLimitErr|makeLimitErrDesc|takeLimitPrice|takeLimitErr|takeLimitErrDesc|brokerState|makeState|takeState|mktCrossState|lastChildEvent|spdrMktState|numOrders|leavesQty|childOrderLeaves|arrivalSDiv|arrivalRate|arrivalDDiv|hedgeSecKey|hedgeSecType|theoOpx|theoVol|childOrderMask|priceFormat|uPriceFormat|userName|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 = 'secKey: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 = 'SpdrParentBrkrEvent'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'secKey|secType|accnt|spdrSource|groupingCode|orderSide|clientFirm|altAccnt|altUserName|eventNumber|stageType|stageReview|baseParentNumber|prevParentNumber|engineName|ticker|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|spdrComment|bidPrc|askPrc|bidIVol|askIVol|bidSize|askSize|uBid|uAsk|surfacePrc|surfaceVol|surfaceYrs|surfaceSDiv|surfaceRate|surfaceUPrc|surfaceDe|surfaceGa|surfaceTh|surfaceVe|surfaceRo|surfacePh|arriveNbboSize|arriveNbboExch|arriveCumSize|arriveNumExch|arriveLimitSize|arriveLimitPrc|avgFillPrc|cumFillQuan|numChildOrders|numDayChildOrders|openOrderSize|actionOrderSize|riskLimitSize|riskLimitDesc|riskLimitLevel|riskLimitDetail|limitRefUPrc|limitPrice|limitVol|makeLimitPrice|makeLimitErr|makeLimitErrDesc|takeLimitPrice|takeLimitErr|takeLimitErrDesc|brokerState|makeState|takeState|mktCrossState|lastChildEvent|spdrMktState|numOrders|leavesQty|childOrderLeaves|arrivalSDiv|arrivalRate|arrivalDDiv|hedgeSecKey|hedgeSecType|theoOpx|theoVol|childOrderMask|priceFormat|uPriceFormat|userName|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'secType|spdrSource|orderSide|stageType|stageReview|spdrBrokerStatus|spdrOrderStatus|spdrCloseReason|spdrRejectReason|arriveNbboExch|riskLimitDesc|riskLimitLevel|makeLimitErr|takeLimitErr|brokerState|makeState|takeState|mktCrossState|lastChildEvent|spdrMktState|hedgeSecType|priceFormat|uPriceFormat'

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

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