Holding
A Holding describes the position held by an Account_ for a given Instrument_. Such a position is a combination of the balance at the start of the day and the aggregate actual buys and sells completed since the opening balance. In addition, the balances of planned transactions (effectively the unmatched Order_ records) are also recorded here for the purposes of monitoring and risk management.
- Section: Position Keeping
Metadata
- Base Table Class: Entity
- Default Size: ExternalAccount * Constants::MaxHoldingsPerExternalAccount = 50000
Fields
| Name | Type | Size (bytes) | Description |
|---|---|---|---|
| Id | Integer (signed) | 8 | The unique identifier of this Holding. |
| Status | Set of Status | 4 | |
| ExternalAccount | Foreign key to ExternalAccount | 8 | This is a reference to the ExternalAccount table. It is keyed by the ExternalAccount column in this table to the Id column in the ExternalAccount table. |
| Instrument | 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_. |
| Tag | String | 50 | For tagged Instruments, this is the identifier of the individual holding. |
| ExternalId | String | 30 | A place for writing the identifier of this Holding at the external venue where it is managed. |
| ExternalTransactionId | String | 20 | A place for writing the identifier of the external transaction that is connected with this Holding record at the external venue to which it is related. |
| OpenBalance | Integer (signed) | 8 | The balance of the Instrument to which this Holding relates, in this Account at the time of starting the Trading Engine. Copied from Balance. |
| PlannedBuy | Integer (signed) | 8 | The sum of the buy Orders currently placed but unmatched in the system for this Account / Instrument. |
| PlannedSell | Integer (signed) | 8 | The sum of the sell Orders currently placed, but unmatched in the system for this Account / Instrument. |
| OptimisedReservedCashRequired | Integer (signed) | 8 | For a single-price Auction, this is the PlannedSell that has been optimised. |
| AuctionResiduals | Integer (signed) | 8 | Total of MaxResidual for all auctions that the account is active on. Only used for leaf accounts. |
| ActualBuy | Integer (signed) | 8 | The sum of the matched buy Orders currently placed in the system for this Account / Instrument. |
| ActualSell | Integer (signed) | 8 | The sum of the matched sell Orders currently placed in the system for this Account / Instrument. |
| UnsettledBuy | Integer (signed) | 8 | For externally settled trades, buys/sells move from planned to unsettled and must be moved to actual via a HoldingTransaction. |
| UnsettledSell | Integer (signed) | 8 | For externally settled trades, buys/sells move from planned to unsettled and must be moved to actual via a HoldingTransaction. |
| PendingBuyTradeCosts | Integer (signed) | 8 | |
| UnsettledBuyTradeCosts | Integer (signed) | 8 | |
| ActualBuyTradeCosts | Integer (signed) | 8 | |
| PendingSellTradeCosts | Integer (signed) | 8 | |
| UnsettledSellTradeCosts | Integer (signed) | 8 | |
| ActualSellTradeCosts | Integer (signed) | 8 | |
| PendingDeposit | Integer (signed) | 8 | |
| PendingWithdrawal | Integer (signed) | 8 | |
| ApprovedDeposit | Integer (signed) | 8 | |
| ApprovedWithdrawal | Integer (signed) | 8 | |
| PendingReturn | Integer (signed) | 8 | |
| AvailableBalance | Integer (signed) | 8 | |
| Balance | Integer (signed) | 8 | The balance of the Instrument to which this Holding relates, in this Account at the time of starting the Trading Engine. |
| MinimumBalance | Integer (signed) | 8 | |
| UnfundedBids | Integer (signed) | 8 | Total (cash) value of unfunded bids for the Instrument to which this Holding relates. |
| NettingFundsReceivable | Integer (signed) | 8 | For a CCMX issuer, this is funds that will be transferred to the issuer's account and can be used to offset the issuer's buy trade costs. |
| NettingFundsUsed | Integer (signed) | 8 | Total funds from Receivable that have been used so far for the Account across all Auctions on which it is participating. |
| ProjectId | String | 50 | The identifier of the specific project at the external register associated with this Holding record. |
| Vintage | Integer (unsigned) | 4 | A year in YYYY format. |
| ProjectType | Foreign key to ProjectType | 8 | This is a reference to the ProjectType table. It is keyed by the ProjectType column in this table to the Id column in the ProjectType table. |
| Region | Foreign key to Region | 8 | This is a reference to the Region table. It is keyed by the Region column in this table to the Id column in the Region table. |
| Country | Foreign key to Country | 8 | This 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. |
| OrderMargin | Integer (signed) | 8 | |
| PositionMargin | Integer (signed) | 8 | |
| ParentHolding | Foreign key to Holding | 8 | If an Account has a parent, the Holding movements are mirrored here. |
| FirmHolding | Foreign key to Holding | 8 | A Holding describes the position held by an Account_ for a given Instrument_. Such a position is a combination of the balance at the start of the day and the aggregate actual buys and sells completed since the opening balance. In addition, the balances of planned transactions (effectively the unmatched Order_ records) are also recorded here for the purposes of monitoring and risk management. |
| ReservedQuantity | Integer (signed) | 8 | Total of all associated HoldingReservation records. |
| ReservedQuantityNoDeficit | Integer (signed) | 8 | Total of associated HoldingReservation records that do not allow a deficit. |
| 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 Holding. |
| OwnerGroup | Foreign key to Group | 8 | The Id of the Group that owns this Holding. |
| OwnerFirm | Foreign key to Firm | 8 | The Id of the Firm that owns this Holding. |
| CreateUser | Foreign key to User | 8 | The Id of the User that created this Holding. |
| CreateTimestamp | Integer (unsigned) | 8 | The time at which this Holding was created. |
| UpdateUser | Foreign key to User | 8 | The Id of the User that last updated this Holding. |
| UpdateTimestamp | Integer (unsigned) | 8 | The time at which this Holding was last updated. |
Foreign Keys
The following diagram shows the tables that have a foreign key link to the Holding table. All Table nodes can be clicked to take you to that table's definition page.
graph LR; AuctionAccount-->|Holding|Holding AuctionAccount-->|Cash|Holding click AuctionAccount "/marketgrid/developer/model/tables/AuctionAccount" HoldingTransaction-->|Holding|Holding click HoldingTransaction "/marketgrid/developer/model/tables/HoldingTransaction" HoldingReservation-->|Holding|Holding click HoldingReservation "/marketgrid/developer/model/tables/HoldingReservation" Order-->|Holding|Holding Order-->|Cash|Holding click Order "/marketgrid/developer/model/tables/Order" Trade-->|Holding|Holding Trade-->|Cash|Holding click Trade "/marketgrid/developer/model/tables/Trade" Trade_children-->|Holding|Holding Trade_children-->|Cash|Holding click Trade_children "/marketgrid/developer/model/tables/Trade_children"