Data Schema

Financial Intelligence Platform

Five interconnected tables in DuckDB covering market prices, banking transactions, loan portfolios, fraud detection, and automated data quality logs. PK = primary key · FK = logical foreign key reference.

DuckDB Python FastAPI :8765 yfinance Local Llama (Ollama) LangChain NL-to-SQL
~26k
Market data rows (real OHLCV, yfinance)
500k
Synthetic banking transactions
200k
Synthetic loan records
~850
Fraud detection events

ETL + DQ Pipeline

Data flows from sources through quality validation into the warehouse, then queried by the NL-SQL agent.

yfinance API
+
Synthetic Generators
DQ Validation
DuckDB Warehouse
Lineage Tracker
NL-SQL Agent (Llama)
FastAPI :8765

Warehouse Schema

Five tables. PK = primary key · FK = logical foreign key (not enforced at DB level).

market_data
Real OHLCV · 20 tickers · 5 years
idPKBIGINT
symbolVARCHAR(10)
trade_dateDATE
openDOUBLE
highDOUBLE
lowDOUBLE
closeDOUBLE
adj_closeDOUBLE
volumeBIGINT
ingest_tsTIMESTAMP
transactions
500k synthetic banking txns · 3yr
transaction_idPKVARCHAR(36)
account_idVARCHAR(20)
customer_idVARCHAR(20)
txn_dateTIMESTAMP
amountDOUBLE
merchant_nameVARCHAR(100)
merchant_categoryVARCHAR(50)
channelVARCHAR(20)
currencyVARCHAR(3)
is_flaggedBOOLEAN
data_quality_flagVARCHAR(20)
ingest_tsTIMESTAMP
loans
200k consumer loans · 7yr history
loan_idPKVARCHAR(36)
member_idVARCHAR(20)
issue_dateDATE
loan_amountDOUBLE
funded_amountDOUBLE
interest_rateDOUBLE
term_monthsINTEGER
gradeVARCHAR(2)
sub_gradeVARCHAR(2)
purposeVARCHAR(50)
annual_incomeDOUBLE
dtiDOUBLE
fico_lowINTEGER
fico_highINTEGER
home_ownershipVARCHAR(20)
loan_statusVARCHAR(30)
delinq_2yrsINTEGER
ingest_tsTIMESTAMP
fraud_events
Detection events on flagged transactions
event_idPKVARCHAR(36)
transaction_idFKVARCHAR(36)
detected_atTIMESTAMP
fraud_typeVARCHAR(40)
confidence_scoreDOUBLE
model_versionVARCHAR(20)
is_confirmedBOOLEAN
resolved_atTIMESTAMP
resolution_noteVARCHAR(255)
ingest_tsTIMESTAMP
data_quality_log
Automated DQ check results written after every ingestion run
run_idPKVARCHAR(36)
dataset_nameVARCHAR(50)
run_tsTIMESTAMP
total_checksINTEGER
passed_checksINTEGER
failed_checksINTEGER
success_rateDOUBLE
ge_result_pathVARCHAR(255)
ingest_tsTIMESTAMP

Table Relationships

fraud_events references transactions logically. data_quality_log validates all 4 data tables. market_data and loans are independent.

transactions PK: transaction_id fraud_events FK: transaction_id market_data PK: id (symbol+date) loans PK: loan_id data_quality_log validates all 4 tables references logical reference

API Endpoints (port 8765)

No authentication required. NL-to-SQL powered by local Llama via Ollama.

POST /query Ask a plain-English question. Returns generated SQL + rows.
GET /query/schema Browse warehouse tables and row counts.
GET /query/dq Latest automated data quality check results per dataset.
GET /query/lineage/{'{'}table{'}'} Data lineage trace from source to warehouse for a given table.
GET /health Health check. Returns {"{"}"status":"ok","port":8765{"}"}.

Financial Intelligence Platform — solo project by Rahul Veerapur · Project · Live Demo