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.
- Section: Position Keeping
Metadata
- Base Table Class: Static
- Default Size: Firm * Constants::MaxAccountsPerFirm = 500
Fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| Id | Integer (signed) | 8 | The unique identifier of this Account. |
| Status | Set of Status | 4 | |
| AccountCode | String | 40 | The human readable identifier of the Account. It is a free text field, up to a maximum of 40 characters. |
| AccountName | String | 254 | |
| AccountType | Foreign key to AccountType | 8 | This 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. |
| Firm | Foreign key to Firm | 8 | A Firm is the organisational unit into which users of the Trading System are grouped. Every Firm belongs to one Enterprise. |
| ParentAccount | Foreign key to Account | 8 | If the Account has a parent, this is the FK to that record. |
| WorkingStatus | Set of Status | 4 | |
| DefaultRatio | Integer (signed) | 8 | The default ratio that this Account gets allocated from its parents orders. |
| SoftBlock | Integer (unsigned) | 1 | Set 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. |
| CheckLimits | Integer (unsigned) | 1 | Whether or not to keep the position limits for this Account |
| WarnPercent | Integer (signed) | 8 | |
| LimitStatus | One of LimitStatus | 1 | |
| PlannedBuyVal | Integer (signed) | 8 | |
| PlannedSellVal | Integer (signed) | 8 | |
| ActualBuyVal | Integer (signed) | 8 | |
| ActualSellVal | Integer (signed) | 8 | |
| BuyValLimit | Integer (signed) | 8 | |
| SellValLimit | Integer (signed) | 8 | |
| NetValLimit | Integer (signed) | 8 | Account's value limit for their net trading activity. That is the difference between ActualBuyVal and ActualSellVal plus the value of all Planned Buy orders. |
| GrossValLimit | Integer (signed) | 8 | Account's value limit for all outstanding orders and confirmed trades (Buy + Sell). That is the sum of ActualBuyVal, ActualSellVal, PlannedBuyVal and PlannedSellVal. |
| BuyOrderVal | Integer (signed) | 8 | |
| SellOrderVal | Integer (signed) | 8 | |
| MaintainPositions | Integer (unsigned) | 1 | |
| BankAccount | Foreign key to BankAccount | 8 | |
| SettlementCurrency | Foreign key to Instrument | 8 | An 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_. |
| MpId | String | 20 | |
| ExternalFK | Integer (unsigned) | 8 | FK for this record in external system that generated it |
| VirtualReferenceNumber | String | 20 | Deprecated VRN column, kept and maintainer for KDB backwarkds compatibility wand will be removed once KDB is removed. |
| VRN | Foreign key to VirtualReferenceNumber | 8 | VRN for JPMorgan-linked accounts. |
| NeedsNewVirtualReferenceNumber | Integer (unsigned) | 1 | True if we need to request a Virtual Reference Number for this account. |
| MetaData | String | 1024 | MetaData blob for pass-through to external systems. |
| FeeSet | Foreign key to FeeSet | 8 | This 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. |
| NegDealRequestHolding | Integer (unsigned) | 1 | |
| EffectiveMpId | String | 20 | |
| EffectiveFeeSet | Foreign key to FeeSet | 8 | |
| UpdateNumber | Integer (unsigned) | 8 | A 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. |
| OwnerUser | Foreign key to User | 8 | The Id of the User that owns this Account. |
| OwnerGroup | Foreign key to Group | 8 | The Id of the Group that owns this Account. |
| OwnerFirm | Foreign key to Firm | 8 | The Id of the Firm that owns this Account. |
| CreateUser | Foreign key to User | 8 | The Id of the User that created this Account. |
| CreateTimestamp | Integer (unsigned) | 8 | The time at which this Account was created. |
| UpdateUser | Foreign key to User | 8 | The Id of the User that last updated this Account. |
| UpdateTimestamp | Integer (unsigned) | 8 | The 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"