Skip to main content
Version: Upcoming

Schema: AtsDegrossRevConGateway (ID: 5240)

Records inserted, updated, or replaced into the AtsDegrossRevConGateway table are validated and then converted to SpdrParentOrder records

and forwarded to the dedicated (non-striped) degrossing execution engine for auction processing.

Each record represents one order line: a single ticker/expiry RevCon spread (call + put + stock legs).

Strike is SR-controlled (published in AtsDegrossRevConSpreads); not a client input.

The groupingCode is client-supplied and used as the SpreadBroker cache key on the EE; lines are independent.

See DEGROSSING_PLAN_2.1.md for the full auction algorithm specification.

METADATA

AttributeValue
Topic5120-srse-gateway
MLink TokenClientTrading
MLink EndpointMLink-Live
SRSE ProductSRTrade

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

BODY

#FieldTypeDefault ValueComment
10=tickerTickerKeyunderlier ticker (e.g., AAPL, TSLA)
11=expiryDateKeyflex option expiry date for this RevCon spread
12=accntstring(16)SR trading account
13=sideenum : BuySellBuy = reversal (lend stock); Sell = conversion (borrow stock)
14=clientFirmstring(16)
15=groupingCodelongclient-supplied order identifier; used as SpreadBroker key for cancel/replace
100spdrActionTypeenum : SpdrActionTypeAdd, AddReplace, Cancel
110sizeintnumber of RevCon units (1 unit = 100 shares)
120useSRRateenum : YesNoYesYes = use SR reference rate; No = use clientRate
121clientRatedoubleclient financing rate (only used if useSRRate=No)
122useSRSDivenum : YesNoYesYes = use SR reference sdiv; No = use clientSDiv
123clientSDivdoubleclient continuous dividend rate (only used if useSRSDiv=No)
124useSRDDivenum : YesNoYesYes = use SR dividend schedule; No = use ClientDDiv set
135runAuctionNowenum : YesNoNoYes = trigger RunFinalAuction immediately (Mars testing); resets to No after firing
138runTrialNowenum : YesNoNoYes = run an on-demand TRIAL immediately: full solve + cross logging + provisional results, NON-binding (orders are NOT closed, nothing submitted). Repeatable. For testing.
140gatewayStatusenum : AtsRevConGatewayStatusgateway processing status
141rejectReasontext1if rejected, the reason why
142parentNumberlongassigned SpdrParentOrder number (if accepted)
150orderDttmDateTimeorder entry timestamp
151checksumshort13standard gateway checksum; must be set to 13
152userNamestring(24)set by server from context
153timestampDateTime

REPEATING FIELDS

ClientDDiv

#FieldTypeDefault ValueComment
126ddivExDateDateKeyexpected ex-date
127ddivAmountdoubleexpected dividend amount per share

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

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

# 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 = 'spdrActionType|size|useSRRate|clientRate|useSRSDiv|clientSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus|rejectReason|parentNumber|orderDttm|checksum|userName|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 = 'AtsDegrossRevConGateway'

# Replace with your desired view. A "|" separated list of views can be provided
# If no view is provided, all views will be returned
VIEW = 'spdrActionType|size|useSRRate|clientRate|useSRSDiv|clientSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus|rejectReason|parentNumber|orderDttm|checksum|userName|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 = 'spdrActionType: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 = 'AtsDegrossRevConGateway'

# Replace with fields you want to see aggregate values for. A "|" separated list of measures should be provided
MEASURE = 'spdrActionType|size|useSRRate|clientRate|useSRSDiv|clientSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus|rejectReason|parentNumber|orderDttm|checksum|userName|timestamp'

# Replace with fields you want to see aggregated. A "|" separated list of fields should be provided
GROUP = 'spdrActionType|useSRRate|useSRSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus'

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

# 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, (R)eplace, or (U)pdate
"postmerge": "Y", # (Y)es or (N)o
}

payload = {
"header": {
"mTyp": "AtsDegrossRevConGateway"
},
"message": {
"pkey": {
"ticker": {
"at": "EQT",
"ts": "NMS",
"tk": "AAPL"
},
"expiry": "2025-01-01", // yyyy-MM-dd
"accnt": "exampleString", // string
"side": "enumValue", // enum(BuySell) - None, Buy, Sell
"clientFirm": "exampleString", // string
"groupingCode": 1 // long
},
"spdrActionType": "enumValue", // enum(SpdrActionType) - Add, AddReplace, Replace, Cancel, Modify
"size": 1, // int
"useSRRate": "Yes", // enum(YesNo) - None, Yes, No. Default=Yes
"clientRate": 1.0, // double
"useSRSDiv": "Yes", // enum(YesNo) - None, Yes, No. Default=Yes
"clientSDiv": 1.0, // double
"useSRDDiv": "Yes", // enum(YesNo) - None, Yes, No. Default=Yes
"runAuctionNow": "No", // enum(YesNo) - None, Yes, No. Default=No
"runTrialNow": "No", // enum(YesNo) - None, Yes, No. Default=No
"gatewayStatus": "enumValue", // enum(AtsRevConGatewayStatus) - None, Pending, Accepted, Rejected
"rejectReason": "exampleString", // text1
"parentNumber": 1, // long
"orderDttm": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"checksum": 13, // short. Default=13
"userName": "exampleString", // string
"timestamp": "2025-01-01 12:00:00.000000", // yyyy-MM-dd HH:mm:ss.SSSSSS
"ClientDDiv": [ // Repeating Field
{
"ddivExDate": "2025-01-01", // yyyy-MM-dd
"ddivAmount": 1.0 // double
}
]
}
}

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