GSR Transformer

ETL service that ingests CSV files (ETF holdings, daily NAV, monthly/quarterly performance) from a US Bank SFTP, validates and coerces them, and writes to Postgres via Prisma 7. A Fastify HTTP API exposes per-fund views over the ingested data.

Project Identity

Repository name is bankofus. The application is also referred to as GSR Transformer (the in-product name). Docs in this folder use both names.

Repository

  • Path: /Users/levander/coding/scharge/bankofus
  • Branch: main
  • Package manager: pnpm 10.20.0
  • Module type: ESM
  • Build: tsup to dist/
  • Deploy target: Kubernetes (Helm chart at helm/gsr-transformer/, ingest as CronJob)

Tech Stack

LayerTech
LanguageTypeScript 5.9 (ESM)
RuntimeNode (tsx for dev, tsup-bundled for prod)
HTTP serverFastify 5 (+ swagger / swagger-ui)
ORMPrisma 7
DatabasePostgreSQL
CSV parserPapaParse 5
FTP clientbasic-ftp, ssh2-sftp-client
Loggingpino + pino-pretty
Testingvitest (introduced 2026-05 with the computed performance endpoints — see 2026-05-11 Computed performance endpoints)
DeploymentHelm chart, Kubernetes CronJob for ingest

Data Sources

Configured in src/targets.ts:

DatasourceTypeFile patternNotes
etfHoldingsDsstatic*ETF_Holdings.csvdeletePrevious: true
monthlyPerformanceDsstatic*MonthlyPerformance.csvdeletePrevious: true
quarterlyPerformanceDsstatic*QuarterlyPerformance.csvdeletePrevious: true
dailyEtfDstimeseries*DailyNAV.csvappend-only; source for computed since-inception return + quarterly premium/discount

HTTP API

  • Most routes are auto-generated by the TrackedTabularDataSource framework: per-datasource row-shaped routes (latest / timeseries / list).
  • Plus hand-written computed routes that aggregate over a table — these deliberately sit outside the framework. See 2026-05-11 Computed performance endpoints:
    • GET /etf/:ticker/performance/since-inception — NAV- and market-price-based cumulative return since fund inception (2026-04-22), refreshed daily
    • GET /etf/:ticker/premium-discount/quarterly — % days at premium / discount per calendar quarter from inception onward

Documentation