The dbt Layer: How I Model a Portfolio from Transactions Up
The dbt Layer: How I Model a Portfolio from Transactions Up The hardest part of building a portfolio analytics system isn’t getting prices. It’s accurately reconstructing what you actually held on any given day, and computing returns from that. Here’s how I do it in dbt. The core problem A transaction ledger tells you events: “on this date, I bought X shares of Y at price Z.” To compute portfolio performance, you need states: “on every day from then until now, I held N shares of Y.” ...