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
| Attribute | Value |
|---|---|
| Topic | 5120-srse-gateway |
| MLink Token | ClientTrading |
| MLink Endpoint | MLink-Live |
| SRSE Product | SRTrade |
Note: The symbol
=next to a field number indicates that it is a primary key.
BODY
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 10= | ticker | TickerKey | underlier ticker (e.g., AAPL, TSLA) | |
| 11= | expiry | DateKey | flex option expiry date for this RevCon spread | |
| 12= | accnt | string(16) | SR trading account | |
| 13= | side | enum : BuySell | Buy = reversal (lend stock); Sell = conversion (borrow stock) | |
| 14= | clientFirm | string(16) | ||
| 15= | groupingCode | long | client-supplied order identifier; used as SpreadBroker key for cancel/replace | |
| 100 | spdrActionType | enum : SpdrActionType | Add, AddReplace, Cancel | |
| 110 | size | int | number of RevCon units (1 unit = 100 shares) | |
| 120 | useSRRate | enum : YesNo | Yes | Yes = use SR reference rate; No = use clientRate |
| 121 | clientRate | double | client financing rate (only used if useSRRate=No) | |
| 122 | useSRSDiv | enum : YesNo | Yes | Yes = use SR reference sdiv; No = use clientSDiv |
| 123 | clientSDiv | double | client continuous dividend rate (only used if useSRSDiv=No) | |
| 124 | useSRDDiv | enum : YesNo | Yes | Yes = use SR dividend schedule; No = use ClientDDiv set |
| 135 | runAuctionNow | enum : YesNo | No | Yes = trigger RunFinalAuction immediately (Mars testing); resets to No after firing |
| 138 | runTrialNow | enum : YesNo | No | Yes = run an on-demand TRIAL immediately: full solve + cross logging + provisional results, NON-binding (orders are NOT closed, nothing submitted). Repeatable. For testing. |
| 140 | gatewayStatus | enum : AtsRevConGatewayStatus | gateway processing status | |
| 141 | rejectReason | text1 | if rejected, the reason why | |
| 142 | parentNumber | long | assigned SpdrParentOrder number (if accepted) | |
| 150 | orderDttm | DateTime | order entry timestamp | |
| 151 | checksum | short | 13 | standard gateway checksum; must be set to 13 |
| 152 | userName | string(24) | set by server from context | |
| 153 | timestamp | DateTime |
REPEATING FIELDS
ClientDDiv
| # | Field | Type | Default Value | Comment |
|---|---|---|---|---|
| 126 | ddivExDate | DateKey | expected ex-date | |
| 127 | ddivAmount | double | expected dividend amount per share |
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 = '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)
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=AtsDegrossRevConGateway'
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 = '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)
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=AtsDegrossRevConGateway' \
--data-urlencode 'view=spdrActionType|size|useSRRate|clientRate|useSRSDiv|clientSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus|rejectReason|parentNumber|orderDttm|checksum|userName|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 = '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)
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=AtsDegrossRevConGateway' \
--data-urlencode 'view=spdrActionType|size|useSRRate|clientRate|useSRSDiv|clientSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus|rejectReason|parentNumber|orderDttm|checksum|userName|timestamp' \
--data-urlencode 'where=accnt:eq:ExampleString' \
--data-urlencode 'limit=500' \
--data-urlencode 'order=spdrActionType: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 = '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)
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=AtsDegrossRevConGateway' \
--data-urlencode 'measure=spdrActionType|size|useSRRate|clientRate|useSRSDiv|clientSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus|rejectReason|parentNumber|orderDttm|checksum|userName|timestamp' \
--data-urlencode 'group=spdrActionType|useSRRate|useSRSDiv|useSRDDiv|runAuctionNow|runTrialNow|gatewayStatus' \
--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 = '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)
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=AtsDegrossRevConGateway' \
--data-urlencode 'where=accnt:eq:ExampleString'
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, (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)
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, (R)eplace, or (U)pdate
--data-urlencode 'postmerge=Y' \ # (Y)es or (N)o
--header 'Content-Type: application/json' \
--data '{
"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
}
]
}
}'