Firm

A Firm is the organisational unit into which users of the Trading System are grouped. Every Firm belongs to one Enterprise.

Metadata

  • Base Table Class: Static
  • Default Size: 50

Fields

NameTypeSize (bytes)Description
IdInteger (signed)8The unique identifier of this Firm.
StatusSet of Status4
ShortNameString24The short text identifier of this Firm.
NameString48The long text identifier of this Firm.
ExternalFKInteger (unsigned)8The FK of this record in the external system that generated it.
FirmTypeOne of FirmType1The type of the Firm.
PermissionGroupForeign key to PermissionGroup8(Optional) permission group that defines a base collection of permissions applied to this firm.
TemplateFirmForeign key to Firm8The Id of the template firm from which to inherit permissions, status & groups.
FeeSetForeign key to FeeSet8The default fee set used to calculate Exchange fees for the Firm. A value from the FeeSet table.
CheckAccountsInteger (unsigned)1If set to 1, indicates that the System should validate the Account field for order entry against the Account Table.
TrackHoldingsInteger (unsigned)1If set to 1, indicates that Holdings balances should be maintained by the System for the Firm's accounts. If this is set, CheckAccounts must also be set.
CanShortSellInteger (unsigned)1If set to 1, indicates that the Firm is allowed to short sell for Instruments that allow short selling This bit is only used if CheckAccounts and TrackHoldings are both set.
CanResellTodayInteger (unsigned)1If set and short selling is being checked, indicates that today's buys can be sold on the same day for the Firm.
TrackCashInteger (unsigned)1If set to 1, indicates that Cash balances should be maintained by the System for the Firm's accounts. If this is set, CheckAccounts must also be set.
CanUseTodaysCashInteger (unsigned)1If set and cash balances are not allowed to be negative, indicates that cash from today's sells can be used on the same day for the Firm.
CashCanBeNegativeInteger (unsigned)1If set to 1, indicates that the Firm is allowed to have a negative cash balance. This bit is only used if CheckAccounts and TrackCash are both set.
EnterpriseForeign key to Enterprise8The Firm's Enterprise, from the Enterprise table.
CheckLimitsInteger (unsigned)1If set, trading limits will be checked by the System for the Firm.
WarnPercentInteger (signed)8If non-zero, a level (as a percentage of limits set) at which a warning will be issued for the Firm for any of the trading limits. CheckLimits must be set if this is used.
LimitStatusOne of LimitStatus1If non-zero, one of the Firm's trading limits has breached the WarnPercent level.
AddressString500The street address of the Firm.
WorkingStatusSet of Status4The Firm's current Status taking into account the Enterprise's Status.
BankNameString20The name of the banking institution at which the Firm's HouseAccount and CustomerAccounts are held.
HouseAccountString35The account to use when processing payments for Proprietary or House trading for this Firm.
CustomerAccountString35The account to use when processing payments for Agency or Client trading for this Firm.
PlannedBuyValInteger (signed)8Total outstanding balance (value) of buy orders for the Firm. Will be maintained if either CheckLimits or MaintainPositions is set.
PlannedSellValInteger (signed)8Total outstanding balance (value) of sell orders for the Firm. Will be maintained if either CheckLimits or MaintainPositions is set.
ActualBuyValInteger (signed)8Total value of buy trades for the Firm. Will be maintained if either CheckLimits or MaintainPositions is set.
ActualSellValInteger (signed)8Total value of sell trades for the Firm. Will be maintained if either CheckLimits or MaintainPositions is set.
BuyValLimitInteger (signed)8Firm's value limit for outstanding buy orders and confirmed trades.
SellValLimitInteger (signed)8Firm's value limit for outstanding sell orders and confirmed trades.
NetValLimitInteger (signed)8Firm's value limit for their net trading activity. That is the difference between ActualBuyVal and ActualSellVal plus the value of all Planned Buy orders.
GrossValLimitInteger (signed)8Firm's value limit for all outstanding orders and confirmed trades (Buy + Sell). That is the sum of ActualBuyVal, ActualSellVal, PlannedBuyVal and PlannedSellVal.
BuyOrderValInteger (signed)8Firm's value limit for a single buy order.
SellOrderValInteger (signed)8Firm's value limit for a single sell order.
MaintainPositionsInteger (unsigned)1If set to 1, the System will maintain trading positions for the Firm without checking trading limits (use CheckLimits to have both positions maintained and limits checked).
SummaryAccountForeign key to Account8This is the first Account for the Firm (i.e., the first Account for this Firm in the Account table). It is used for an Enterprise Control Firm, which should only have one Account that will be used to provide summary Holdings totals for the Firms in the Enterprise.
NewCounterpartiesInteger (signed)8
BICIdString34Banking BIC code for the firm if relevant. Not currently in use.
CityString24The city name (as text) of the Firm.
StateString24The State (as text) of the Firm.
ZipCodeString20The zip or post code (as text) of the Firm.
CountryForeign key to Country8This is a reference to the Country table. It is keyed by the Country column in this table to the Id column in the Country table.
FirmPriorityMatchingOne of FirmPriorityMatching1If set to 1, indicates that this Price-Firm-Time priority matching will be used for the Firm's orders.
SettlementCurrencyForeign key to Instrument8An Instrument is the entity that represents something to be traded in MarketGrid. In order for an Instrument to trade it must be listed on a Market_ to produce an InstrumentMarket_. Each Instrument may be traded simultaneously on one or more Markets, each such instance being an InstrumentMarket.
DefaultExpiryTypeSet of OrderType4The default Expiry for orders entered for the Firm.
UpdateNumberInteger (unsigned)8A number that records every change that happens to a record. It is primarily used to avoid write after read problems when an intermediate write has changed the originally read record.
OwnerUserForeign key to User8The Id of the User that owns this Firm.
OwnerGroupForeign key to Group8The Id of the Group that owns this Firm.
OwnerFirmForeign key to Firm8The Id of the Firm that owns this Firm.
CreateUserForeign key to User8The Id of the User that created this Firm.
CreateTimestampInteger (unsigned)8The time at which this Firm was created.
UpdateUserForeign key to User8The Id of the User that last updated this Firm.
UpdateTimestampInteger (unsigned)8The time at which this Firm was last updated.

Foreign Keys

The following diagram shows the tables that have a foreign key link to the Firm table. All Table nodes can be clicked to take you to that table's definition page.

graph LR;
	Group-->|Firm|Firm
	click Group "/marketgrid/developer/model/tables/Group"
	User-->|Firm|Firm
	click User "/marketgrid/developer/model/tables/User"
	UserName-->|Firm|Firm
	click UserName "/marketgrid/developer/model/tables/UserName"
	Auction-->|Firm|Firm
	click Auction "/marketgrid/developer/model/tables/Auction"
	Permission-->|Firm|Firm
	click Permission "/marketgrid/developer/model/tables/Permission"
	Account-->|Firm|Firm
	click Account "/marketgrid/developer/model/tables/Account"
	ExternalAccount-->|Firm|Firm
	click ExternalAccount "/marketgrid/developer/model/tables/ExternalAccount"
	FirmAccountType-->|Firm|Firm
	click FirmAccountType "/marketgrid/developer/model/tables/FirmAccountType"
	Order-->|Firm|Firm
	Order-->|CounterPartyFirm|Firm
	click Order "/marketgrid/developer/model/tables/Order"
	Trade-->|Firm|Firm
	click Trade "/marketgrid/developer/model/tables/Trade"
	RFQ-->|Firm|Firm
	RFQ-->|CounterPartyFirm|Firm
	click RFQ "/marketgrid/developer/model/tables/RFQ"
	RFQCounterParty-->|CPFirm|Firm
	click RFQCounterParty "/marketgrid/developer/model/tables/RFQCounterParty"
	RFQRecipient-->|Firm|Firm
	click RFQRecipient "/marketgrid/developer/model/tables/RFQRecipient"