Skip to main content
Version: Upcoming

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

AttributeValue
Topic4740-risk-v5
MLink TokenClientRisk
SRSE ProductSRRisk

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

BODY

#FieldTypeComment
10=fkeyExpiryKey
11=accntstring(16)
12=tradeDateDateKey
13=riskSessionenum : RiskSession
14=clientFirmstring(16)SR assigned client firm
103riskServerCodestring(6)
106aggGroupstring(16)SR assigned aggregation group
109tickerTickerKeyunderlying ticker
112underliersPerCnintnumber of underlying units per futures contract
115underlierTypeenum : UnderlierType
118tickValuefloat$NLV value of a single tick change in display premium (pointValue = tickValue / tickSize)
121pointValuefloat$NLV value of a single point change in display premium (pointValue = tickValue / tickSize)
124pointCurrencyenum : Currency
127priceFormatenum : PriceFormatprice display format code
130futPrcdoublecurrent future price (any market session) (persists if market closed/halted)
133futBiddoublecurrent future bid (any market session) (zero if market closed/halted)
136futAskdoublecurrent future ask (any market session) (zero if market closed/halted)
139futMarkdoublecurrent mark (usually mid market) (freezes at SR CloseMarkTime)
142futMarkErrCodesflag : MarkErrorCode
145futMarkSourceenum : UMarkSource
148futOpnMidMarkdoublestart of day SR mark
151futOpnClrMarkdoublestart of day clearing mark (usually exchange settlement mark)
154futOpnPosPrvintstart-of-day SR contract position (rotated from prior day record)
157futOpnPosClrintstart-of-day CKR contract position (supplied by client/clearing firm via clearing position load)
160futOpnPosintstart of period contract position (effective; can be from either CLR or SR)
163futOpnPosSrcenum : PositionSourcestart of period position source
166cnBotintnumber of contracts bot today
169cnSldintnumber of contracts sld today
172cnBotTrdintnumber of contracts bot today
175cnSldTrdintnumber of contracts sld today
178cnBotHdgintnumber of contracts bot today from open pos hedging (spdrSource=HedgeTool)
181cnSldHdgintnumber of contracts sld today from open pos hedging (spdrSource=HedgeTool)
184cnBotTrhintnumber of contracts bot today from open pos hedging (spdrSource=TradeHedge)
187cnSldTrhintnumber of contracts sld today from open pos hedging (spdrSource=TradeHedge)
190cnBotOpnintnumber of contracts bot today from open pos hedging (spdrSource=OpenHedge)
193cnSldOpnintnumber of contracts sld today from open pos hedging (spdrSource=OpenHedge)
196cnOpenedintnumber of contracts opened today
199cnClosedintnumber of contracts closed today
202futMnyBotdoublesum of settle cash for all buy executions
205futMnySlddoublesum of settle cash for all sell executions
208dayPnlfloat
211opnPnlMidMarkfloat
214opnPnlClrMarkfloat
217betafloatbeta (usually beta to SPX; see AccountConfig.betaSource) (if applicable)
220betaSourceenum : BetaSource
223daysshortdays to expiration
226ratefloatglobal rate to expiration
229yearsfloatyears to expiration
232rhfloatrho; (dPrc / dRate) - only for STIR futures
235vefloatvega; (dPrc / dVol) - only for VIX futures
238ratePrfloatstart of period global rate
241yearsPrfloatstart of period years to expiration
251marginUDnfloatAggregate RiskSlide: uPrc dn
252marginUUpfloatAggregate RiskSlide: uPrc up
244numExecutionsintnumber of included SpdrParentExecution records
247maxExecDttmDateTimemaximum activity dttm of execution records included in this future risk record
250timestampDateTime

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

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

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

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

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