Skip to main content

Position

Data Dictionary - Entity Table: Position#

Table represents all client positions (market values and quantities) for every portfolio. Each position includes a cost price and a timestamp to allow complex tax optimization in relevant jurisdictions (Tax lot accounting).

Primary Key ('id').ENGINE = InnoDB..
Column NameData TypePK Primary Key, NN-Not Null, NullExampleComments
idBIGINT(12)PK, NN1PrimaryKey-ID,(auto creates)
financial_account_idBIGINT(12)NOT NULL1ID of financial account-Mandatory
instrument_idBIGINT(12)NOT NULL1ID of the instrument Mandatory
original_idBIGINT(12)NULL1Orginal ID is used to support simulated positions by storing the link to the ID of the real position.
quantityDECIMAL(25,9)NOT NULL100Count of units purchased. Measured in items.
market_valueDECIMAL(25,9)NOT NULL2000Market_value of the position. Measured in currency of portfolio
accrualsDECIMAL(25,9)NOT NULL20Accrued absolute amount of the interest or dividend of the position. Best to be maintained as cumulative value.
cost_priceDECIMAL(25,9)NOT NULL54Purchase Price of the position. Measured in currency of the instrument
currency_idBIGINT(12)NOT NULL1ID of the currency of the instrument for this position.
purchase_datetimeDATETIME(3)NOT NULL1/1/2020 12:30:00 PMDate when the instrument was purchased
close_datetimeDATETIME(3)NOT NULL12/31/9999 12:30:00 PMDate when the Position is closed. If not closed - default value is '12/31/9999'
market_value_datetimeDATETIME(3)NOT NULL1/1/2020 12:30:00 PMDate when the market value of the position has been updated from the Price table.
market_value_ percentage_modifiableTINYINTNOT NULL1Flag whether the market value percentage is modifiable. Determines whether user (client advisor) can modify position share (in percentages) and trigger a new proposal/trade or not.
CONSTRAINTFOREIGN KEYREFERENCESON DELETEON UPDATE
currency_id(currency_id)Currency (id)NO ACTIONNO ACTION
financial_account(financial_account_id)Financial_Account (id)NO ACTIONNO ACTION
Instrument(instrument_id)Instrument (id)NO ACTIONNO ACTION
CREATE INDEXONASCVISIBLE.
currency_id_idxPosition(currency_id ASC)VISIBLE.
financial_account_idxPosition (financial_account_id ASC)VISIBLE.
Instrument_idxPosition (instrument_id ASC)VISIBLE.