StaticUpdate

Update an existing record or create a new record in any static table.

The static tables are defined by base table class = Static.

List of all tables

Because nq is an abstraction on top of the raw API, this description is broken up into two sections. Initially testing the message using nq may help to construct a raw interface.

nq API

Running .tx StaticUpdate Firm (for example) in nq will display the field names and types of the Firm table.

If updating a record, nq will automatically fill out missing fields with the existing values on the record.

Raw API

If updating an existing record, the UpdateNumber will need to match the update number of the existing record. This eliminates unintentionally overwriting a recent change to the same record from another source.

All fields must be specified in the raw API.

Metadata

  • Message Type: TransactionMessage
  • Message Number: 1010

Inherited fields

NameTypeSize (bytes)Description
MessageTypeInteger (unsigned)2The unique identifier of this message.
ClientIdInteger (unsigned)4The unique identifier of a session with the server, returned in a successful LoginReply message.
RequestIdInteger (unsigned)4Within each session each message must be uniquely identified by this field. It must be monotonically increasing for the duration of the session.

Fields

NameTypeSize (bytes)Description
TableOne of Table1The Table number of the static table to be updated.
IdInteger (signed)8If the Id of an existing record in the table is specified, the record will be updated. To create a new record, leave as zero or specify as current max Id + 1.

Permissions


Update InstrumentMarket Currency and Instrument

{ Id: 11, Instrument: 10 }

Permission Checks

PermissionActionTableScopeIndex
AmendInstrumentMarketInstance2
ViewMarketInstance0

Test file: StaticUpdate_InstrumentMarket


Create new firm

{
	ShortName: "test-firm2",
	Name: "test-firm2",
	FirmType: FirmType.Regular,
	Enterprise: 1,
}

Permission Checks

PermissionActionTableScopeIndex
CreateFirmEnterprise
CreateFirmNameAll

Test file: StaticUpdate_NewFirm


Enable and Set User Limits

{
	Id: User.find(eq("UserId", "test-user")).Id,
	BuyValLimit: 10,
	CheckLimits: true,
}

Permission Checks

PermissionActionTableScopeIndex
AmendUserInstance2
AmendUserNameAll

Test file: StaticUpdate_UserLimits