Skip to main content
Version: 8.6.3.4

Schema: SpdrPairLeggerState (ID: 5370)

METADATA

AttributeValue
Topic5355-strategy-legger
MLink TokenInternal
MLink EndpointMLink-Live
SRSE ProductSRTrade

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

BODY

#FieldTypeDefault ValueComment
10=orderNumberlongpair legger order number (should be an SR Guid)
100spdrSourceenum : SpdrSource
101accntstring(16)SR trading account
102clientFirmstring(16)SR client firm
103pairCtrlStateenum : PairCtrlState
104pairStateenum : PairState
105strategystring(36)client-supplied strategy string; visible on SpiderRock GUI tools and other order reports.
106userNamestring(24)name of the user entering the order
107orderSizeintpair size (number of complete spreads)
108leggerLimitdoublepair limit
109leggerLimitTypeenum : LeggerLimitTypepair limit type (stock: Price, future: Price, optExpiry: AtmVol only, option: Price or StrikeVol)
110leggerAlgoenum : LeggerAlgo
111legRatioTypeenum : LegRatioType
112numAtmStrikesushortnumber of OptExpiry atm strikes [max 6]
113legExposurePctfloatpercentage of legger order size than can be exposed on a single leg without completing related legs
114legCompletionSlippagedoublemaximum leg slippage to complete an open pair order (in leggerLimitType units)
115marketSessionenum : MarketSession
116orderDurationint[optional] (number of seconds)
117goodTillDttmDateTime[optional] (default: 2099-01-01)
118maxMktPctMovedouble[optional] if any leg stock price, future price, or option underlier price moves move that maxMktPctMove from values at order activation then the entire order will be automatically put on hold
119autoHedgeenum : AutoHedgeonly for optExpiry/optExpiry and option/option pairs
120hedgeSessionenum : MarketSession
121userData1text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
122userData2text1client supplied data field; passes through to parent and child executions and reports as well as FIX drops
123childDatatext1client supplied data field; passes through to down stream child orders
124pairStatusenum : PairStatus
125pairDetailtext1
126cumSquareFillQtyint
127cumPartialFillQtyint
128avgSquareFillPrcdouble
129pairBidPxdoublesynthetic pair bid (from individual leg markets)
130pairAskPxdoublesynthetic pair ask (from individual leg markets)
131pairBidSzdouble
132pairAskSzdouble
133timestampDateTime

REPEATING FIELDS

Legs

#FieldTypeDefault ValueComment
135secKeyOptionKeyleg Security (can be a stock, future, optExpiry, or option) [must be the same for all legs] [cp can be call, put, or both if secType = optExpiry]
136secTypeenum : LeggerSecTypenote: stock/stock, stock/future, future/future, optExpiry/optExpiry or option/option are allowed
137ratioushortleg ratio (note: can be in shares, contracts, vega, wvega, tvega, or wtvega terms) (optExpiry must be in one of the xVega choices)
138legPriorityenum : LegPriorityLead leg(s) fill first
139posTypeenum : PositionTypenote: must be Auto for optExpiry (not required for stock)
140ssaleFlagenum : ShortSaleFlagonly for stock legs (and autohedging)
141hedgeInstrumentenum : HedgeInst
142hedgeSecKeyExpiryKeyautohedge instrument (can be a TickerKey (stock) or ExpiryKey (future)) [required for Stock and Future]
143orderSizeintworking size (from parentBrkrState.orderSize) (sum of all individual orders; in cn/share terms)
144orderActiveSizeintorder active size (from parentBrkrState.orderActiveSize) (sum of all individual orders; in cn/share terms)
145numActiveBrkrsushortnumber of parent order legs with leg.activeSize > leg.cumFillQty
146numAvailLegBrkrsushortnumber of parent order legs created
147cumFillQtydoublein LeggerLimitType terms
148avgFillPrcdouble
149activeSprdSizedoubleactive size (sum of all individual orders; in ratio type terms)
150legStatusstring(32)
151targetStateenum : LeggerTargetState
152targetSprdSizefloat
153targetLimitPricefloat
154bestBidPrcfloatleg best bid price (in terms of limit type)
155bestAskPrcfloatleg best ask price
156bestBidSizefloatleg best bid size (in terms of ratio type)
157bestAskSizefloatleg best ask size
158numNewOrdersintnumber of parent orders published
159numLimitUpdatesintnumber of parent limit messages published

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

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

# 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 = 'spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|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 = 'SpdrPairLeggerState'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|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 = 'spdrSource: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 = 'SpdrPairLeggerState'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'spdrSource|accnt|clientFirm|pairCtrlState|pairState|strategy|userName|orderSize|leggerLimit|leggerLimitType|leggerAlgo|legRatioType|numAtmStrikes|legExposurePct|legCompletionSlippage|marketSession|orderDuration|goodTillDttm|maxMktPctMove|autoHedge|hedgeSession|userData1|userData2|childData|pairStatus|pairDetail|cumSquareFillQty|cumPartialFillQty|avgSquareFillPrc|pairBidPx|pairAskPx|pairBidSz|pairAskSz|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrSource|pairCtrlState|pairState|leggerLimitType|leggerAlgo|legRatioType|marketSession|autoHedge|hedgeSession|pairStatus'

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

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