SR Control
Overview
The SR Control database allows the user to manage risk controls, locates, and configuration settings. Key features include:
- View and manage symbol and user supervisory trade risk controls
- Manage borrow rates, locates, and restricted trading lists
- Dynamically control algo configuration and delivery instructions
- Integrated with SpiderRock GUI tools
SR Control Tables
The following image shows the available tables in SR Control:
Query Examples
Stock Locates
Sample Query 1: Insert locates into the AwayStockLocateGateway:
REPLACE INTO srcontrol.msgawaystocklocategateway
VALUES ('EQT', 'NMS', 'AAPL', 'SRCORE', 'GS', 'TEST', 50000, 'No', 1234, NOW());
Sample Query 2: Insert a request for 50,000 shares in AAPL:
VALUES ('EQT', 'NMS', 'AAPL', 'SRCORE', 'GS', 'TEST', 50000, NOW());
Sample Query 3: Retrieve available stock locates from the AvailableStockLocates table:
SELECT * FROM srcontrol.msgavailablestocklocates WHERE coreclientfirm = 'SRCORE';
Client Risk Control and Restricted Symbol Control
Sample Query 4: Insert risk controls for a client firm:
REPLACE INTO srcontrol.msgsrriskcontrol
VALUES ('EQT', 'NMS', 'BA', '*', 'ClientFirm', 'SRCORE', 'Yes', 'Enable', 'Enable', 'Enable',
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 'username', 'Saturn', NOW());
To update a restricted symbol, for a client firm:
UPDATE srcontrol.msgsrriskcontrol
SET stkenabled = 'Disabled', futenabled = 'Disabled', optenabled = 'Disabled'
WHERE riskfirm = 'SRCORE' AND ticker_tk = 'BA' AND riskcontrollevel = 'ClientFirm' AND riskcontrolkey = '*';
Sample Query 5: Insert risk controls for an account:
REPLACE INTO srcontrol.msgsrriskcontrol
VALUES ('EQT', 'NMS', 'Z', 'T.ACCNT', 'Accnt', 'SRCORE', 'Yes', 'Enable', 'Enable', 'Enable',
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 'username', 'Saturn', NOW());
To update a restricted symbol for an account:
UPDATE srcontrol.msgsrriskcontrol
SET stkenabled = 'Disabled', futenabled = 'Disabled', optenabled = 'Closeonly'
WHERE riskfirm = 'SRCORE' AND ticker_tk = 'Z' AND riskcontrollevel = 'Accnt' AND riskcontrolkey = 'T.ACCNT';
Sample Query 6: Insert risk controls for a user:
REPLACE INTO srcontrol.msgsrriskcontrol
VALUES ('EQT', 'NMS', 'DAL', 'user.name', 'USER', 'SRCORE', 'Yes', 'Enable', 'Enable', 'Enable',
-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 'username', 'Saturn', NOW());
To update a restricted symbol for a user:
UPDATE srcontrol.msgsrriskcontrol
SET stkenabled = 'CloseOnly', futenabled = 'Disabled', optenabled = 'Closeonly'
WHERE riskfirm = 'SRCORE' AND ticker_tk = 'DAL' AND riskcontrollevel = 'User' AND riskcontrolkey = 'user.name';
User Overrides
Sample Query 7: Insert a user dividend override:
REPLACE INTO srcontrol.msguserdividendoverride
VALUES ('EQT', 'NMS', 'AAPL', 'SRCORE', 'Tooloverride', NOW(), 'preference', 'Fullreplace',
'[{"divDate":"2025-05-12","divValue":0.26,"divCurrency":"USD","divKind":"Regular","divSource":"Forecast","divFreq":"None","divOverrideSource":"None"},
{"divDate":"2025-08-11","divValue":0.26,"divCurrency":"USD","divKind":"Regular","divSource":"Forecast","divFreq":"None","divOverrideSource":"None"}]');
Sample Query 8: Insert a user rate override:
SELECT * FROM srcontrol.doccolumns WHERE TABLE_NAME='msguserrateoverride' ORDER BY ordinal_position ASC;
SELECT * FROM srcontrol.msguserrateoverride WHERE clientfirm = 'SRCORE';
REPLACE INTO srcontrol.msguserrateoverride
VALUES ('SRCORE', NOW(), 'TEST',
'[{"days":1,"rate":4.395},{"days":7,"rate":4.3878},{"days":30,"rate":4.3962},{"days":61,"rate":4.3825},
{"days":91,"rate":4.3585},{"days":182,"rate":4.2213},{"days":365,"rate":3.9758},{"days":548,"rate":3.8259},
{"days":730,"rate":3.7644},{"days":1095,"rate":3.7373},{"days":1825,"rate":3.7984}]');