Skip to main content
Version: 8.6.10.4

Schema: FamilyPrimaryElectionV3 (ID: 9166)

One row per futures family, keyed by the family head: CCodeDefinitionV3 (9115) familyHead, @[line]-[venue]-FUT for a

venue's products on a line, or the @X head a product names.

primary is the product MAR counts the family in (a sibling's contract counts as its point value over the

Primary's) and the product a FUT head answers through; CCodeDefinitionV3 (9115) role Primary follows it.

THREE RUNGS, STRICT ORDER (governs). HardCode: declared in code (the common US families, a micro under its

E-mini; a FUT head named after a product, ES under @ES; the Europe loader's table); no edit of this row moves it,

a release does. Election: this row decides, whoever wrote it, until written again. Rule: no row exists, so the

loader elects the standard outright (kind Outright, else Physical, else any; never a TAS contract) with the largest

point value, then contract size, then symbol, writes this row and publishes the family's 9115 rows with roles.

A Rule row follows the rule on later loads; an Election or HardCode row stays as written. rulePrimary is what

the rule elects today: a difference is research, not a change.

STATUS. Elected: primary governs. Dead: the elected product is not in the load; the family has no Primary and

every order on it is refused at MAR arrival (SpdrRejectReason MarNoPrimary) until a new election is written.

None (the SRSE default on a hand-written row) governs and is stamped by the next pass. Pending and Superseded

are reserved: such a row does not govern and the check reports it. A written row relinks its family within the

session; counters accumulated for the day keep the old Primary's contracts until the trade-date roll.

METADATA​

AttributeValue
Topic9100-product-def-core
MLink TokenInternal
MLink EndpointMLink-Order
SRSE ProductSRReference

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

BODY​

#FieldTypeDefault ValueComment
10=headTickerKeythe family head: 9115 familyHead (@<line>-<venue>-FUT, or @X)
100primaryTickerKeythe elected Primary product (ccode); the product refused when Dead
103rulePrimaryTickerKeythe product the rule elects today
106governsenum : PrimaryRungHardCode / Election / Rule: the rung that decided primary
109statusenum : PrimaryElectionStatusElected / Pending / Dead / Superseded
112electedAtDateTimewhen primary was last decided; MAR sizes the session it falls in against previousPrimary
115ruleAtDateTimewhen rulePrimary last moved
118ruleReasonstring(64)why rulePrimary last moved: first election, a new product, a point value
121rationaletext1a written election says why; the loader writes the rule it applied
124previousPrimaryTickerKeythe Primary this election replaced: what MAR counts in until the roll (the loader fills it)
127timestampDateTime
900v3Sourceenum : V3SourceLoader = the rule elected it; Manual = written by hand; HardCode = declared in code

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

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

# 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 = 'primary|rulePrimary|governs|status|electedAt|ruleAt|ruleReason|rationale|previousPrimary|timestamp|v3Source'

# 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 = 'ruleReason: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 = 'FamilyPrimaryElectionV3'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'primary|rulePrimary|governs|status|electedAt|ruleAt|ruleReason|rationale|previousPrimary|timestamp|v3Source'

# 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 = 'ruleReason: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 = 'primary: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 = 'FamilyPrimaryElectionV3'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'primary|rulePrimary|governs|status|electedAt|ruleAt|ruleReason|rationale|previousPrimary|timestamp|v3Source'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'governs|status|v3Source'

# 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 = 'ruleReason: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 = 'FamilyPrimaryElectionV3'

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