Account

An Account is the element in the model that links trading activity to the users undertaking that activity. All Accounts are owned by a Firm and it against one of these Accounts that Holding records are managed in the system.

Metadata

  • Base Table Class: Static
  • Default Size: Firm * Constants::MaxAccountsPerFirm = 500

Fields

NameTypeSize (bytes)Description
IdInteger (signed)8The unique identifier of this Account.
StatusSet of Status4
AccountCodeString40The human readable identifier of the Account. It is a free text field, up to a maximum of 40 characters.
AccountNameString254
AccountTypeForeign key to AccountType8This is a reference to the AccountType table. It is keyed by the AccountType column in this table to the Id column in the AccountType table.
FirmForeign key to Firm8A Firm is the organisational unit into which users of the Trading System are grouped. Every Firm belongs to one Enterprise.
ParentAccountForeign key to Account8If the Account has a parent, this is the FK to that record.
WorkingStatusSet of Status4
DefaultRatioInteger (signed)8The default ratio that this Account gets allocated from its parents orders.
SoftBlockInteger (unsigned)1Set to true for an account that is soft blocked, orders will be in pending state for such an Account until the soft block is removed.
CheckLimitsInteger (unsigned)1Whether or not to keep the position limits for this Account
WarnPercentInteger (signed)8
LimitStatusOne of LimitStatus1
PlannedBuyValInteger (signed)8
PlannedSellValInteger (signed)8
ActualBuyValInteger (signed)8
ActualSellValInteger (signed)8
BuyValLimitInteger (signed)8
SellValLimitInteger (signed)8
NetValLimitInteger (signed)8Account'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)8Account's value limit for all outstanding orders and confirmed trades (Buy + Sell). That is the sum of ActualBuyVal, ActualSellVal, PlannedBuyVal and PlannedSellVal.
BuyOrderValInteger (signed)8
SellOrderValInteger (signed)8
MaintainPositionsInteger (unsigned)1
BankAccountForeign key to BankAccount8
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_.
MpIdString20
ExternalFKInteger (unsigned)8FK for this record in external system that generated it
VirtualReferenceNumberString20Deprecated VRN column, kept and maintainer for KDB backwarkds compatibility wand will be removed once KDB is removed.
VRNForeign key to VirtualReferenceNumber8VRN for JPMorgan-linked accounts.
NeedsNewVirtualReferenceNumberInteger (unsigned)1True if we need to request a Virtual Reference Number for this account.
MetaDataString1024MetaData blob for pass-through to external systems.
FeeSetForeign key to FeeSet8This is a reference to the FeeSet table. It is keyed by the FeeSet column in this table to the Id column in the FeeSet table.
NegDealRequestHoldingInteger (unsigned)1
EffectiveMpIdString20
EffectiveFeeSetForeign key to FeeSet8
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 Account.
OwnerGroupForeign key to Group8The Id of the Group that owns this Account.
OwnerFirmForeign key to Firm8The Id of the Firm that owns this Account.
CreateUserForeign key to User8The Id of the User that created this Account.
CreateTimestampInteger (unsigned)8The time at which this Account was created.
UpdateUserForeign key to User8The Id of the User that last updated this Account.
UpdateTimestampInteger (unsigned)8The time at which this Account was last updated.

Foreign Keys

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

graph LR;
	Firm-->|SummaryAccount|Account
	click Firm "/marketgrid/developer/model/tables/Firm"
	Auction-->|IssuerAccount|Account
	Auction-->|IssuerTradingAccount|Account
	click Auction "/marketgrid/developer/model/tables/Auction"
	AuctionAccount-->|Account|Account
	AuctionAccount-->|TopLevelParent|Account
	click AuctionAccount "/marketgrid/developer/model/tables/AuctionAccount"
	AuctionAccountDetail-->|Account|Account
	click AuctionAccountDetail "/marketgrid/developer/model/tables/AuctionAccountDetail"
	AuctionAccountAllocation-->|Account|Account
	click AuctionAccountAllocation "/marketgrid/developer/model/tables/AuctionAccountAllocation"
	VirtualReferenceNumber-->|Account|Account
	click VirtualReferenceNumber "/marketgrid/developer/model/tables/VirtualReferenceNumber"
	AccountLink-->|Account|Account
	click AccountLink "/marketgrid/developer/model/tables/AccountLink"
	ExternalAccount-->|Account|Account
	click ExternalAccount "/marketgrid/developer/model/tables/ExternalAccount"
	Order-->|Account|Account
	click Order "/marketgrid/developer/model/tables/Order"
	OrderNotional-->|Account|Account
	click OrderNotional "/marketgrid/developer/model/tables/OrderNotional"
	Trade-->|Account|Account
	Trade-->|CounterPartyAccount|Account
	click Trade "/marketgrid/developer/model/tables/Trade"