Schema: All tables reside in the public schema. Every table includes record_id UUID, filename TEXT, created_on TIMESTAMP, and updated_on TIMESTAMP.
fidelity_account_balance — Account Balances (180 columns)
CREATE TABLE public.fidelity_account_balance (
record_id UUID NOT NULL,
record VARCHAR(1),
branch VARCHAR(3),
accountnumber VARCHAR(6),
lastupdatedate DATE,
-- Net worth
networthfieldsign VARCHAR(1),
networth NUMERIC(17,2),
networthmarketvalue NUMERIC(17,2),
customer_facingnetworth NUMERIC(17,2),
-- Cash & collected balances
cashcollectedbalance NUMERIC(17,2),
collectedbalance NUMERIC(17,2),
nettradedatebalance NUMERIC(17,2),
settledcash NUMERIC(17,2),
unsettledcashcredit NUMERIC(17,2),
unsettledcashdebit NUMERIC(17,2),
cashavailabletowithdraw NUMERIC(17,2),
availabletopay NUMERIC(17,2),
coresweep_fundamount NUMERIC(17,2),
-- Buying power
availabletopurchasemargin NUMERIC(17,2),
availabletopurchase_cash NUMERIC(17,2),
buyingpowercorpbonds NUMERIC(17,2),
buyingpowermunibonds NUMERIC(17,2),
buyingpowergovtbonds NUMERIC(17,2),
-- Market values (options)
cashmoneymarkets NUMERIC(17,2),
optionmarketvalue NUMERIC(17,2),
optioninmoneyamt NUMERIC(17,2),
-- Margin
marginequity NUMERIC(17,2),
marginliquidatingequity NUMERIC(17,2),
marginequitypercentage INTEGER,
housesurpluscall NUMERIC(17,2),
sma_fedcall NUMERIC(17,2),
minimumequitycall NUMERIC(17,2),
fedcallreduction NUMERIC(17,2),
housecallreduction NUMERIC(17,2),
availabletoborrow NUMERIC(17,2),
-- Account type segments: accounttype1..10
-- Each segment has: accounttype, marketvalue, tradedatebalance, settlementdatebalance
accounttype NUMERIC(3,0),
superbranch VARCHAR(3),
-- Indicator flags (portfoliomarginindicator, msla_indicator, etc.)
filename TEXT,
created_on TIMESTAMP NOT NULL,
updated_on TIMESTAMP NOT NULL
);
fidelity_activity — Bookkeeping Activity
CREATE TABLE public.fidelity_activity (
record_id UUID,
branch VARCHAR(3),
accountnumber VARCHAR(6),
accounttype VARCHAR(1),
cusip VARCHAR(9),
transactiontype_mnemonic_ VARCHAR(3),
bkpgreferencenumber VARCHAR(6),
rundate DATE,
entrydate DATE,
tradedate DATE,
-- Amounts
bookkeepingquantity NUMERIC(13,5),
bookkeepingamount NUMERIC(11,2),
bookkeepingmarketvalue NUMERIC(11,2),
principal NUMERIC(15,2),
price NUMERIC(18,9),
accruedinterest NUMERIC(9,2),
commission NUMERIC(7,2),
concession NUMERIC(10,2),
statetax NUMERIC(8,2),
ticketcharge NUMERIC(8,2),
optionsregulatoryfee NUMERIC(8,2),
secfee NUMERIC(8,2),
servicechargemiscfee NUMERIC(10,2),
additionalfeeamount NUMERIC(12,2),
proratedcommission NUMERIC(10,2),
-- Trade classification
buysellcode VARCHAR(1),
marketcode VARCHAR(1),
tradetype VARCHAR(1),
securitytype VARCHAR(1),
ordertype VARCHAR(1),
-- Multi-currency
isin VARCHAR(15),
sedol VARCHAR(15),
currencycode VARCHAR(3),
localcurrencyprice NUMERIC(16,8),
localcurrencyfees NUMERIC(18,4),
reportingcurrencyconversionrate NUMERIC(16,8),
-- Expanded precision fields (same as above at 15-17 digit precision)
-- Description lines: bkpgdescriptionline1..9
-- Broker codes: minorexecutingbroker, majorclearingbroker, etc.
filename TEXT,
created_on TIMESTAMP,
updated_on TIMESTAMP
);
fidelity_positions — Position Detail (110 columns)
CREATE TABLE public.fidelity_positions (
record_id UUID NOT NULL,
branch VARCHAR(3),
accountnumber VARCHAR(6),
accounttype VARCHAR(1),
cusip VARCHAR(9),
isin VARCHAR(15),
sedol VARCHAR(15),
-- Quantities by settlement type
quantitysettledlong NUMERIC,
quantitysettledshort NUMERIC,
quantityunsettledlong NUMERIC,
quantityunsettledshort NUMERIC,
-- Pricing
closingprice NUMERIC,
closingpricefactor NUMERIC,
-- Market values
marketvaluesettledlong NUMERIC,
marketvaluesettledshort NUMERIC,
-- Cost basis
totalcostbasisamount NUMERIC,
averagecostpershare NUMERIC,
-- Income
ytddividend NUMERIC,
ytdinterest NUMERIC,
accruedinterest NUMERIC,
-- Classification
securitytype VARCHAR(1),
assettype VARCHAR(2),
sectorcode VARCHAR(4),
-- Tax lot fields, option fields, additional pricing...
filename TEXT,
created_on TIMESTAMP NOT NULL,
updated_on TIMESTAMP NOT NULL
);
fidelity_rmd / fidelity_rmd_clean — Required Minimum Distributions
CREATE TABLE public.fidelity_rmd (
record_id UUID NOT NULL,
branch TEXT,
accountnumber TEXT,
registrationtype TEXT,
establishdate TEXT,
customerdateofbirth TEXT,
prioryear_endbalance NUMERIC,
year_to_datedistributionamount NUMERIC,
lifeexpectancy_le_factor NUMERIC,
lifeexpectancytypecode TEXT,
periodicplanbalanceadjustmentamount NUMERIC,
periodicplanexpectedpayoutamount NUMERIC,
estimatedrequiredminimumdistributionamount NUMERIC,
registeredrepowningrep_rr_ TEXT,
registeredrepexecrep_rr2_ TEXT,
filler TEXT,
filename TEXT,
created_on TIMESTAMP NOT NULL,
updated_on TIMESTAMP NOT NULL
);
fidelity_iwm_tas_close_lot — Closed Lot Cost Basis
CREATE TABLE public.fidelity_iwm_tas_close_lot (
record_id UUID NOT NULL,
branch VARCHAR(3),
accountnumber VARCHAR(6),
accounttype VARCHAR(1),
symbol_cusip VARCHAR(9),
tradedatequantity NUMERIC(16,5),
costbasissourcecode VARCHAR(1),
totalcostbasisamount NUMERIC,
totalcostbasisproceedsamount NUMERIC,
costbasismethodcode VARCHAR(1),
shortname VARCHAR(10),
retirementindicator VARCHAR(1),
adjustedcostbasissourcecode VARCHAR(1),
totaladjustedcostbasisamount NUMERIC,
ytdacquisitionpremium NUMERIC,
ytdamortizedpremium NUMERIC,
unrealizedmarketdiscountincome NUMERIC,
filename TEXT,
created_on TIMESTAMP NOT NULL,
updated_on TIMESTAMP NOT NULL
);
fidelity_tas_close_delta / fidelity_tas_open_delta
fidelity_tas_close_delta (84 columns) and fidelity_tas_open_delta (77 columns) — lot-level cost basis and quantity change records from Fidelity's Tax Accounting System delta files. Include fields for acquisition date, cost basis amounts, lot quantity changes, wash sale indicators, and amortization adjustments.
Other Tables
| Table | Columns | Key Fields |
fidelity_scheduled_events | 220+ | event type, ex-date, pay date, amount, tax rate, record date |
fidelity_trade_revenue | 225 | revenue per trade, fee breakdown, commission allocation |
fidelity_ibxr | 6 | record_id, portaluserid, branch, accountnumber, filename |