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.

Metadata

  • Base Table Class: Entity
  • Default Size: ExternalAccount * Constants::MaxHoldingsPerExternalAccount = 50000

Fields

NameTypeSize (bytes)Description
IdInteger (signed)8The unique identifier of this Holding.
StatusSet of Status4
ExternalAccountForeign key to ExternalAccount8This 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.
InstrumentForeign 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_.
TagString50For tagged Instruments, this is the identifier of the individual holding.
ExternalIdString30A place for writing the identifier of this Holding at the external venue where it is managed.
ExternalTransactionIdString20A 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.
OpenBalanceInteger (signed)8The balance of the Instrument to which this Holding relates, in this Account at the time of starting the Trading Engine. Copied from Balance.
PlannedBuyInteger (signed)8The sum of the buy Orders currently placed but unmatched in the system for this Account / Instrument.
PlannedSellInteger (signed)8The sum of the sell Orders currently placed, but unmatched in the system for this Account / Instrument.
OptimisedReservedCashRequiredInteger (signed)8For a single-price Auction, this is the PlannedSell that has been optimised.
AuctionResidualsInteger (signed)8Total of MaxResidual for all auctions that the account is active on. Only used for leaf accounts.
ActualBuyInteger (signed)8The sum of the matched buy Orders currently placed in the system for this Account / Instrument.
ActualSellInteger (signed)8The sum of the matched sell Orders currently placed in the system for this Account / Instrument.
UnsettledBuyInteger (signed)8For externally settled trades, buys/sells move from planned to unsettled and must be moved to actual via a HoldingTransaction.
UnsettledSellInteger (signed)8For externally settled trades, buys/sells move from planned to unsettled and must be moved to actual via a HoldingTransaction.
PendingBuyTradeCostsInteger (signed)8
UnsettledBuyTradeCostsInteger (signed)8
ActualBuyTradeCostsInteger (signed)8
PendingSellTradeCostsInteger (signed)8
UnsettledSellTradeCostsInteger (signed)8
ActualSellTradeCostsInteger (signed)8
PendingDepositInteger (signed)8
PendingWithdrawalInteger (signed)8
ApprovedDepositInteger (signed)8
ApprovedWithdrawalInteger (signed)8
PendingReturnInteger (signed)8
AvailableBalanceInteger (signed)8
BalanceInteger (signed)8The balance of the Instrument to which this Holding relates, in this Account at the time of starting the Trading Engine.
MinimumBalanceInteger (signed)8
UnfundedBidsInteger (signed)8Total (cash) value of unfunded bids for the Instrument to which this Holding relates.
NettingFundsReceivableInteger (signed)8For 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.
NettingFundsUsedInteger (signed)8Total funds from Receivable that have been used so far for the Account across all Auctions on which it is participating.
ProjectIdString50The identifier of the specific project at the external register associated with this Holding record.
VintageInteger (unsigned)4A year in YYYY format.
ProjectTypeForeign key to ProjectType8This 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.
RegionForeign key to Region8This 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.
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.
OrderMarginInteger (signed)8
PositionMarginInteger (signed)8
ParentHoldingForeign key to Holding8If an Account has a parent, the Holding movements are mirrored here.
FirmHoldingForeign key to Holding8A 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.
ReservedQuantityInteger (signed)8Total of all associated HoldingReservation records.
ReservedQuantityNoDeficitInteger (signed)8Total of associated HoldingReservation records that do not allow a deficit.
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 Holding.
OwnerGroupForeign key to Group8The Id of the Group that owns this Holding.
OwnerFirmForeign key to Firm8The Id of the Firm that owns this Holding.
CreateUserForeign key to User8The Id of the User that created this Holding.
CreateTimestampInteger (unsigned)8The time at which this Holding was created.
UpdateUserForeign key to User8The Id of the User that last updated this Holding.
UpdateTimestampInteger (unsigned)8The 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"