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
| Attribute | Value |
|---|---|
| Topic | 9100-product-def-core |
| MLink Token | Internal |
| MLink Endpoint | MLink-Order |
| SRSE Product | SRReference |
Note: The symbol
=next to a field number indicates that it is a primary key.
BODY
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 10= | head | TickerKey | the family head: 9115 familyHead (@<line>-<venue>-FUT, or @X) | |
| 100 | primary | TickerKey | the elected Primary product (ccode); the product refused when Dead | |
| 103 | rulePrimary | TickerKey | the product the rule elects today | |
| 106 | governs | enum : PrimaryRung | HardCode / Election / Rule: the rung that decided primary | |
| 109 | status | enum : PrimaryElectionStatus | Elected / Pending / Dead / Superseded | |
| 112 | electedAt | DateTime | when primary was last decided; MAR sizes the session it falls in against previousPrimary | |
| 115 | ruleAt | DateTime | when rulePrimary last moved | |
| 118 | ruleReason | string(64) | why rulePrimary last moved: first election, a new product, a point value | |
| 121 | rationale | text1 | a written election says why; the loader writes the rule it applied | |
| 124 | previousPrimary | TickerKey | the Primary this election replaced: what MAR counts in until the roll (the loader fills it) | |
| 127 | timestamp | DateTime | ||
| 900 | v3Source | enum : V3Source | Loader = the rule elected it; Manual = written by hand; HardCode = declared in code |
Get Schema API Call
- Python
- cUrl
import requests
# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'
# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'
# Replace with your desired MsgType.
MSG_TYPE = '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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getschema' \
--data-urlencode 'msgType=FamilyPrimaryElectionV3'
Get Msg API Call
- Python
- cUrl
import requests
# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'
# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'
# Replace with your desired MsgType.
MSG_TYPE = '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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getmsg' \
--data-urlencode 'pkey=ReplaceThisValueForTheQueryToWork' \
--data-urlencode 'msgType=FamilyPrimaryElectionV3' \
--data-urlencode 'view=primary|rulePrimary|governs|status|electedAt|ruleAt|ruleReason|rationale|previousPrimary|timestamp|v3Source' \
--data-urlencode 'where=ruleReason:eq:ExampleString'
Get Msgs API Call
- Python
- cUrl
import requests
# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'
# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'
# Replace with your desired MsgType.
MSG_TYPE = '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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getmsgs' \
--data-urlencode 'msgType=FamilyPrimaryElectionV3' \
--data-urlencode 'view=primary|rulePrimary|governs|status|electedAt|ruleAt|ruleReason|rationale|previousPrimary|timestamp|v3Source' \
--data-urlencode 'where=ruleReason:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=primary:ASC'
Get Aggregate API Call
- Python
- cUrl
import requests
# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'
# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'
# Replace with your desired MsgType.
MSG_TYPE = '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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getaggregate' \
--data-urlencode 'msgType=FamilyPrimaryElectionV3' \
--data-urlencode 'measure=primary|rulePrimary|governs|status|electedAt|ruleAt|ruleReason|rationale|previousPrimary|timestamp|v3Source' \
--data-urlencode 'group=governs|status|v3Source' \
--data-urlencode 'where=ruleReason:eq:ExampleString'
Get Count API Call
- Python
- cUrl
import requests
# Replace with your desired MLINK URL
MLINK_PROD_URL = 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json'
# Replace with your MLINK API Key
API_KEY = 'XXXX-XXXX-XXXX-XXXX'
# Replace with your desired MsgType.
MSG_TYPE = '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)
curl -G 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=getcount' \
--data-urlencode 'msgType=FamilyPrimaryElectionV3' \
--data-urlencode 'where=ruleReason:eq:ExampleString'