Schema: GetFlexSpreadPrice (ID: 3488)
METADATA
| Attribute | Value |
|---|---|
| Topic | 3480-mlink-custom |
| MLink Token | RiskCalc |
Note: The symbol
=next to a field number indicates that it is a primary key.
BODY
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 100 | uPrc | double | 0 | live uPrc on arrival (if not supplied) |
| 101 | fixedPremUPct | double | 0 | premium as a percent of the underlying price. required if a leg with strikeType=PctVariable is included (can be zero). |
| 102 | incGreeks | enum : YesNo | No | whether greeks should be computed |
| 125 | ticker | TickerKey | underlier ticker (all legs must have the same underlier ticker) | |
| 126 | sprdPrem | double | spread premium ($) | |
| 127 | sprdDelta | float | delta | |
| 128 | sprdGamma | float | gamma | |
| 129 | sprdTheta | float | theta | |
| 130 | sprdVega | float | vega | |
| 131 | sprdVolga | float | volga | |
| 132 | sprdVanna | float | vanna | |
| 133 | sprdRho | float | rho | |
| 134 | sprdPhi | float | phi | |
| 138 | calcDetail | text1 | calculation details | |
| 139 | error | text1 | overall error for the calculation | |
| 140 | timestamp | DateTime |
REPEATING FIELDS
Legs
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 104 | okey | OptionKey | should be in OSI root format; strike can be zero for the variable strike leg | |
| 105 | side | enum : BuySell | ||
| 106 | ratio | short | 1 | leg ratio |
| 107 | strikeType | enum : StrikeType | DollarAmt, Percent or PctVariable (exactly one leg can be PctVariable) | |
| 108 | flexTypeOut | enum : FlexType | reflects the type of flex decoded from the okey root | |
| 109 | vYearsOut | double | volatility years to expiry | |
| 110 | dYearsOut | double | calendar days to expiry / 365.0 | |
| 111 | sdivOut | double | continuous stock dividend used for pricing | |
| 112 | rateOut | double | discount rate used for pricing | |
| 113 | effStrikeOut | double | effective strike ($); will be the implied surface strike if strikeType=PctVariable | |
| 114 | sVolOut | double | leg surface volatility | |
| 115 | sPrcOut | double | leg surface price | |
| 116 | deltaOut | float | delta | |
| 117 | gammaOut | float | gamma | |
| 118 | thetaOut | float | theta | |
| 119 | vegaOut | float | vega | |
| 120 | volgaOut | float | volga | |
| 121 | vannaOut | float | vanna | |
| 122 | rhoOut | float | rho | |
| 123 | phiOut | float | phi | |
| 124 | errorOut | string(32) | leg error (if any) |
DiscreteDividend
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 136 | date | DateTime | ||
| 137 | amount | float |
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 = 'GetFlexSpreadPrice'
# 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=GetFlexSpreadPrice'
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 = 'GetFlexSpreadPrice'
# 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 = 'uPrc|fixedPremUPct|incGreeks|ticker|sprdPrem|sprdDelta|sprdGamma|sprdTheta|sprdVega|sprdVolga|sprdVanna|sprdRho|sprdPhi|calcDetail|error|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 = ''
# 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=GetFlexSpreadPrice' \
--data-urlencode 'view=uPrc|fixedPremUPct|incGreeks|ticker|sprdPrem|sprdDelta|sprdGamma|sprdTheta|sprdVega|sprdVolga|sprdVanna|sprdRho|sprdPhi|calcDetail|error|timestamp' \
--data-urlencode 'where='
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 = 'GetFlexSpreadPrice'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'uPrc|fixedPremUPct|incGreeks|ticker|sprdPrem|sprdDelta|sprdGamma|sprdTheta|sprdVega|sprdVolga|sprdVanna|sprdRho|sprdPhi|calcDetail|error|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 = ''
# 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 = 'uPrc: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=GetFlexSpreadPrice' \
--data-urlencode 'view=uPrc|fixedPremUPct|incGreeks|ticker|sprdPrem|sprdDelta|sprdGamma|sprdTheta|sprdVega|sprdVolga|sprdVanna|sprdRho|sprdPhi|calcDetail|error|timestamp' \
--data-urlencode 'where=' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=uPrc: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 = 'GetFlexSpreadPrice'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'uPrc|fixedPremUPct|incGreeks|ticker|sprdPrem|sprdDelta|sprdGamma|sprdTheta|sprdVega|sprdVolga|sprdVanna|sprdRho|sprdPhi|calcDetail|error|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'incGreeks'
# 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 = ''
# 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=GetFlexSpreadPrice' \
--data-urlencode 'measure=uPrc|fixedPremUPct|incGreeks|ticker|sprdPrem|sprdDelta|sprdGamma|sprdTheta|sprdVega|sprdVolga|sprdVanna|sprdRho|sprdPhi|calcDetail|error|timestamp' \
--data-urlencode 'group=incGreeks' \
--data-urlencode 'where='
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 = 'GetFlexSpreadPrice'
# 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 = ''
# 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=GetFlexSpreadPrice' \
--data-urlencode 'where='
Post 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'
# Request Parameters
params = {
# Required Parameters
"apiKey": API_KEY,
"cmd": 'postmsgs',
"postaction": "I", # (I)nsert, or (R)eplace
"postmerge": "Y", # (Y)es or (N)o
}
payload = {
"header": {
"mTyp": "GetFlexSpreadPrice"
},
"message": {
"uPrc": 0, // double. Default=0
"fixedPremUPct": 0, // double. Default=0
"incGreeks": "No", // enum(YesNo) - None, Yes, No. Default=No
"ticker": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL"
},
"sprdPrem": 1.0, // double
"sprdDelta": 1.0, // float
"sprdGamma": 1.0, // float
"sprdTheta": 1.0, // float
"sprdVega": 1.0, // float
"sprdVolga": 1.0, // float
"sprdVanna": 1.0, // float
"sprdRho": 1.0, // float
"sprdPhi": 1.0, // float
"calcDetail": "exampleString", // text1
"error": "exampleString", // text1
"timestamp": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"Legs": [ // Repeating Field
{
"okey": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL",
"dt": "2025-01-01",
"xx": 1,
"cp": "Call"
},
"side": "enumValue", // enum(BuySell) - None, Buy, Sell
"ratio": 1, // short. Default=1
"strikeType": "enumValue", // enum(StrikeType) - None, DollarAmt, Percent, PctVariable
"flexTypeOut": "enumValue", // enum(FlexType) - None, AM_Amer_Cash, AM_Euro_Cash, PM_Amer_Cash, PM_Euro_Cash, PM_Amer_Physical, PM_Euro_Physical, Asian, Cliquet, Other, Listed
"vYearsOut": 1.0, // double
"dYearsOut": 1.0, // double
"sdivOut": 1.0, // double
"rateOut": 1.0, // double
"effStrikeOut": 1.0, // double
"sVolOut": 1.0, // double
"sPrcOut": 1.0, // double
"deltaOut": 1.0, // float
"gammaOut": 1.0, // float
"thetaOut": 1.0, // float
"vegaOut": 1.0, // float
"volgaOut": 1.0, // float
"vannaOut": 1.0, // float
"rhoOut": 1.0, // float
"phiOut": 1.0, // float
"errorOut": "exampleString" // string
}
],
"DiscreteDividend": [ // Repeating Field
{
"date": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"amount": 1.0 // float
}
]
}
}
response = requests.post(MLINK_PROD_URL, params=params, json=payload)
curl -X POST 'https://mlink-live.nms.saturn.spiderrockconnect.com/rest/json' \
--data-urlencode 'apiKey=XXXX-XXXX-XXXX-XXXX' \
--data-urlencode 'cmd=postmsgs' \
--data-urlencode 'postaction=I' \ # (I)nsert, or (R)eplace
--data-urlencode 'postmerge=Y' \ # (Y)es or (N)o
--header 'Content-Type: application/json' \
--data '{
"header": {
"mTyp": "GetFlexSpreadPrice"
},
"message": {
"uPrc": 0, // double. Default=0
"fixedPremUPct": 0, // double. Default=0
"incGreeks": "No", // enum(YesNo) - None, Yes, No. Default=No
"ticker": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL"
},
"sprdPrem": 1.0, // double
"sprdDelta": 1.0, // float
"sprdGamma": 1.0, // float
"sprdTheta": 1.0, // float
"sprdVega": 1.0, // float
"sprdVolga": 1.0, // float
"sprdVanna": 1.0, // float
"sprdRho": 1.0, // float
"sprdPhi": 1.0, // float
"calcDetail": "exampleString", // text1
"error": "exampleString", // text1
"timestamp": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"Legs": [ // Repeating Field
{
"okey": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL",
"dt": "2025-01-01",
"xx": 1,
"cp": "Call"
},
"side": "enumValue", // enum(BuySell) - None, Buy, Sell
"ratio": 1, // short. Default=1
"strikeType": "enumValue", // enum(StrikeType) - None, DollarAmt, Percent, PctVariable
"flexTypeOut": "enumValue", // enum(FlexType) - None, AM_Amer_Cash, AM_Euro_Cash, PM_Amer_Cash, PM_Euro_Cash, PM_Amer_Physical, PM_Euro_Physical, Asian, Cliquet, Other, Listed
"vYearsOut": 1.0, // double
"dYearsOut": 1.0, // double
"sdivOut": 1.0, // double
"rateOut": 1.0, // double
"effStrikeOut": 1.0, // double
"sVolOut": 1.0, // double
"sPrcOut": 1.0, // double
"deltaOut": 1.0, // float
"gammaOut": 1.0, // float
"thetaOut": 1.0, // float
"vegaOut": 1.0, // float
"volgaOut": 1.0, // float
"vannaOut": 1.0, // float
"rhoOut": 1.0, // float
"phiOut": 1.0, // float
"errorOut": "exampleString" // string
}
],
"DiscreteDividend": [ // Repeating Field
{
"date": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"amount": 1.0 // float
}
]
}
}'