Schema: FuturePositionRecordV5 (ID: 4775)
FuturePositionRecords are live risk records that contain start-of-day positions and all subsequent executions, including executions reported as done away.
These records are published by a CoreRiskServer and represent the position and risk markup detail for a single futures contract.
New records are published immediately when a position changes and about once per minute if no position has changed.
Note that all stock, future and option records for a chain are published simultaneously and records for the same chain should have consistent marks.
METADATA
Attribute | Value |
---|---|
Topic | 4740-risk-v5 |
MLink Token | ClientRisk |
SRSE Product | SRRisk |
Note: The symbol
=
next to a field number indicates that it is a primary key.
BODY
# | Field | Type | Comment |
---|---|---|---|
10= | fkey | ExpiryKey | |
11= | accnt | string(16) | |
12= | tradeDate | DateKey | |
13= | riskSession | enum : RiskSession | |
14= | clientFirm | string(16) | SR assigned client firm |
103 | riskServerCode | string(6) | |
106 | aggGroup | string(16) | SR assigned aggregation group |
109 | ticker | TickerKey | underlying ticker |
112 | underliersPerCn | int | number of underlying units per futures contract |
115 | underlierType | enum : UnderlierType | |
118 | tickValue | float | $NLV value of a single tick change in display premium (pointValue = tickValue / tickSize) |
121 | pointValue | float | $NLV value of a single point change in display premium (pointValue = tickValue / tickSize) |
124 | pointCurrency | enum : Currency | |
127 | priceFormat | enum : PriceFormat | price display format code |
130 | futPrc | double | current future price (any market session) (persists if market closed/halted) |
133 | futBid | double | current future bid (any market session) (zero if market closed/halted) |
136 | futAsk | double | current future ask (any market session) (zero if market closed/halted) |
139 | futMark | double | current mark (usually mid market) (freezes at SR CloseMarkTime) |
142 | futMarkErrCodes | flag : MarkErrorCode | |
145 | futMarkSource | enum : UMarkSource | |
148 | futOpnMidMark | double | start of day SR mark |
151 | futOpnClrMark | double | start of day clearing mark (usually exchange settlement mark) |
154 | futOpnPosPrv | int | start-of-day SR contract position (rotated from prior day record) |
157 | futOpnPosClr | int | start-of-day CKR contract position (supplied by client/clearing firm via clearing position load) |
160 | futOpnPos | int | start of period contract position (effective; can be from either CLR or SR) |
163 | futOpnPosSrc | enum : PositionSource | start of period position source |
166 | cnBot | int | number of contracts bot today |
169 | cnSld | int | number of contracts sld today |
172 | cnBotTrd | int | number of contracts bot today |
175 | cnSldTrd | int | number of contracts sld today |
178 | cnBotHdg | int | number of contracts bot today from open pos hedging (spdrSource=HedgeTool) |
181 | cnSldHdg | int | number of contracts sld today from open pos hedging (spdrSource=HedgeTool) |
184 | cnBotTrh | int | number of contracts bot today from open pos hedging (spdrSource=TradeHedge) |
187 | cnSldTrh | int | number of contracts sld today from open pos hedging (spdrSource=TradeHedge) |
190 | cnBotOpn | int | number of contracts bot today from open pos hedging (spdrSource=OpenHedge) |
193 | cnSldOpn | int | number of contracts sld today from open pos hedging (spdrSource=OpenHedge) |
196 | cnOpened | int | number of contracts opened today |
199 | cnClosed | int | number of contracts closed today |
202 | futMnyBot | double | sum of settle cash for all buy executions |
205 | futMnySld | double | sum of settle cash for all sell executions |
208 | dayPnl | float | |
211 | opnPnlMidMark | float | |
214 | opnPnlClrMark | float | |
217 | beta | float | beta (usually beta to SPX; see AccountConfig.betaSource) (if applicable) |
220 | betaSource | enum : BetaSource | |
223 | days | short | days to expiration |
226 | rate | float | global rate to expiration |
229 | years | float | years to expiration |
232 | rh | float | rho; (dPrc / dRate) - only for STIR futures |
235 | ve | float | vega; (dPrc / dVol) - only for VIX futures |
238 | ratePr | float | start of period global rate |
241 | yearsPr | float | start of period years to expiration |
251 | marginUDn | float | Aggregate RiskSlide: uPrc dn |
252 | marginUUp | float | Aggregate RiskSlide: uPrc up |
244 | numExecutions | int | number of included SpdrParentExecution records |
247 | maxExecDttm | DateTime | maximum activity dttm of execution records included in this future risk record |
250 | timestamp | DateTime |
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 = 'FuturePositionRecordV5'
# 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=FuturePositionRecordV5'
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 = 'FuturePositionRecordV5'
# 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 = 'riskServerCode|aggGroup|ticker|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|futPrc|futBid|futAsk|futMark|futMarkErrCodes|futMarkSource|futOpnMidMark|futOpnClrMark|futOpnPosPrv|futOpnPosClr|futOpnPos|futOpnPosSrc|cnBot|cnSld|cnBotTrd|cnSldTrd|cnBotHdg|cnSldHdg|cnBotTrh|cnSldTrh|cnBotOpn|cnSldOpn|cnOpened|cnClosed|futMnyBot|futMnySld|dayPnl|opnPnlMidMark|opnPnlClrMark|beta|betaSource|days|rate|years|rh|ve|ratePr|yearsPr|marginUDn|marginUUp|numExecutions|maxExecDttm|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)
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=FuturePositionRecordV5' \
--data-urlencode 'view=riskServerCode|aggGroup|ticker|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|futPrc|futBid|futAsk|futMark|futMarkErrCodes|futMarkSource|futOpnMidMark|futOpnClrMark|futOpnPosPrv|futOpnPosClr|futOpnPos|futOpnPosSrc|cnBot|cnSld|cnBotTrd|cnSldTrd|cnBotHdg|cnSldHdg|cnBotTrh|cnSldTrh|cnBotOpn|cnSldOpn|cnOpened|cnClosed|futMnyBot|futMnySld|dayPnl|opnPnlMidMark|opnPnlClrMark|beta|betaSource|days|rate|years|rh|ve|ratePr|yearsPr|marginUDn|marginUUp|numExecutions|maxExecDttm|timestamp' \
--data-urlencode 'where=accnt: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 = 'FuturePositionRecordV5'
# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'riskServerCode|aggGroup|ticker|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|futPrc|futBid|futAsk|futMark|futMarkErrCodes|futMarkSource|futOpnMidMark|futOpnClrMark|futOpnPosPrv|futOpnPosClr|futOpnPos|futOpnPosSrc|cnBot|cnSld|cnBotTrd|cnSldTrd|cnBotHdg|cnSldHdg|cnBotTrh|cnSldTrh|cnBotOpn|cnSldOpn|cnOpened|cnClosed|futMnyBot|futMnySld|dayPnl|opnPnlMidMark|opnPnlClrMark|beta|betaSource|days|rate|years|rh|ve|ratePr|yearsPr|marginUDn|marginUUp|numExecutions|maxExecDttm|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 = 'riskServerCode: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=FuturePositionRecordV5' \
--data-urlencode 'view=riskServerCode|aggGroup|ticker|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|futPrc|futBid|futAsk|futMark|futMarkErrCodes|futMarkSource|futOpnMidMark|futOpnClrMark|futOpnPosPrv|futOpnPosClr|futOpnPos|futOpnPosSrc|cnBot|cnSld|cnBotTrd|cnSldTrd|cnBotHdg|cnSldHdg|cnBotTrh|cnSldTrh|cnBotOpn|cnSldOpn|cnOpened|cnClosed|futMnyBot|futMnySld|dayPnl|opnPnlMidMark|opnPnlClrMark|beta|betaSource|days|rate|years|rh|ve|ratePr|yearsPr|marginUDn|marginUUp|numExecutions|maxExecDttm|timestamp' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=riskServerCode: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 = 'FuturePositionRecordV5'
# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'riskServerCode|aggGroup|ticker|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|futPrc|futBid|futAsk|futMark|futMarkErrCodes|futMarkSource|futOpnMidMark|futOpnClrMark|futOpnPosPrv|futOpnPosClr|futOpnPos|futOpnPosSrc|cnBot|cnSld|cnBotTrd|cnSldTrd|cnBotHdg|cnSldHdg|cnBotTrh|cnSldTrh|cnBotOpn|cnSldOpn|cnOpened|cnClosed|futMnyBot|futMnySld|dayPnl|opnPnlMidMark|opnPnlClrMark|beta|betaSource|days|rate|years|rh|ve|ratePr|yearsPr|marginUDn|marginUUp|numExecutions|maxExecDttm|timestamp'
# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'underlierType|pointCurrency|priceFormat|futMarkSource|futOpnPosSrc|betaSource'
# 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)
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=FuturePositionRecordV5' \
--data-urlencode 'measure=riskServerCode|aggGroup|ticker|underliersPerCn|underlierType|tickValue|pointValue|pointCurrency|priceFormat|futPrc|futBid|futAsk|futMark|futMarkErrCodes|futMarkSource|futOpnMidMark|futOpnClrMark|futOpnPosPrv|futOpnPosClr|futOpnPos|futOpnPosSrc|cnBot|cnSld|cnBotTrd|cnSldTrd|cnBotHdg|cnSldHdg|cnBotTrh|cnSldTrh|cnBotOpn|cnSldOpn|cnOpened|cnClosed|futMnyBot|futMnySld|dayPnl|opnPnlMidMark|opnPnlClrMark|beta|betaSource|days|rate|years|rh|ve|ratePr|yearsPr|marginUDn|marginUUp|numExecutions|maxExecDttm|timestamp' \
--data-urlencode 'group=underlierType|pointCurrency|priceFormat|futMarkSource|futOpnPosSrc|betaSource' \
--data-urlencode 'where=accnt: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 = 'FuturePositionRecordV5'
# 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)
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=FuturePositionRecordV5' \
--data-urlencode 'where=accnt:eq:ExampleString'