Skip to main content
Version: Upcoming

Schema: ExpirationControl (ID: 1645)

METADATA

AttributeValue
Topic1630-client-book-risk
MLink TokenClientControl
SRSE ProductSRControl

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

BODY

#FieldTypeComment
10=accntstring(16)
11=yearshort
12=monthbyte
13=daybyte
14=clientFirmstring(16)SR client firm
100expStatusenum : OptStatusexpiration trading control
103minThetafloat(xRM) minimum net expiry theta
106maxThetafloat(xRM) maximum net expiry theta
109minWtVegafloat(xRM) minimum net expiry wtVega;wtVega = ve * vol / sqrt(max(0.1, years * 4))
112maxWtVegafloat(xRM) maximum net expiry wtVega;wtVega = ve * vol / sqrt(max(0.1, years * 4))
115maxWtVePctDdfloat% of min/max expiry wtVega in DD {xde < -0.30} strikes
118maxWtVePctDnfloat% of min/max expiry wtVega in DN {-0.30 <= xde < -0.10} strikes
121maxWtVePctAtfloat% of min/max expiry wtVega in AT {-0.10 <= xde <= +0.10} strikes
124maxWtVePctUpfloat% of min/max expiry wtVega in UP {+0.10 < xde <= +0.30} strikes
127maxWtVePctDufloat% of min/max expiry wtVega in DU {+0.30 < xde} strikes
130modifiedBystring(24)user who last modified this record
133modifiedInenum : SysEnvironment
136timestampDateTimetimestamp 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 = 'ExpirationControl'

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

# 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 = 'expStatus|minTheta|maxTheta|minWtVega|maxWtVega|maxWtVePctDd|maxWtVePctDn|maxWtVePctAt|maxWtVePctUp|maxWtVePctDu|modifiedBy|modifiedIn|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 = 'ExpirationControl'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'expStatus|minTheta|maxTheta|minWtVega|maxWtVega|maxWtVePctDd|maxWtVePctDn|maxWtVePctAt|maxWtVePctUp|maxWtVePctDu|modifiedBy|modifiedIn|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 = 'expStatus: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 = 'ExpirationControl'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'expStatus|minTheta|maxTheta|minWtVega|maxWtVega|maxWtVePctDd|maxWtVePctDn|maxWtVePctAt|maxWtVePctUp|maxWtVePctDu|modifiedBy|modifiedIn|timestamp'

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

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

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

Post 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'

# Request Parameters
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'postmsgs',
"postaction": "I", # (I)nsert, (U)pdate, (R)eplace, or (D)elete
"postmerge": "Y", # (Y)es or (N)o
}

payload = {
"header": {
"mTyp": "ExpirationControl"
},
"message": {
"pkey": {
"accnt": "exampleString", // string
"year": 1, // short
"month": 1, // byte
"day": 1, // byte
"clientFirm": "exampleString" // string
},
"expStatus": "enumValue", // enum(OptStatus) - Hold, TwoWay, BuyOnly, SellOnly, CloseOnly, CloseNow, CloseRisk, BuyCloseOnly, SellCloseOnly
"minTheta": 1.0, // float
"maxTheta": 1.0, // float
"minWtVega": 1.0, // float
"maxWtVega": 1.0, // float
"maxWtVePctDd": 1.0, // float
"maxWtVePctDn": 1.0, // float
"maxWtVePctAt": 1.0, // float
"maxWtVePctUp": 1.0, // float
"maxWtVePctDu": 1.0, // float
"modifiedBy": "exampleString", // string
"modifiedIn": "enumValue", // enum(SysEnvironment) - None, Neptune, Pluto, V7_Stable, V7_Latest, Saturn, Venus, Mars, SysTest, V7_Current
"timestamp": "2025-01-01 12:00:00.000000" // yyyy-MM-dd HH:mm:ss.SSSSSS
}
}

response = requests.post(MLINK_PROD_URL, params=params, json=payload)