41 production dbt models migrated in ~20 hours this week — including full data quality validation against legacy outputs before every cutover.
And yes — I completely burned through my Cursor monthly quota doing it.
Here's the workflow that made it possible. 🧵
➢ The stack:
@cursor_ai +
@claudeai +
@dune MCP + a living SOP
Every model follows the same loop:
1. Author in Cursor with Claude
Cursor keeps the SOP in-context across the entire session. Claude writes the SQL.
Known Trino failure patterns (integer division, USING join resolution, sequence() 10k limit) are in-context before they become bugs — because the SOP is always there.
I've tested other models. Claude still produces the fewest SQL bugs on Trino-specific edge cases. Not close.
2. Validate on Dune
FULL OUTER JOIN new vs legacy. Every metric. Every day. The gate runs before cutover — not after.
3. Update the SOP
Every edge case becomes a guardrail. The next migration starts from a better baseline.
➢ The SOP isn't documentation. It's a feedback loop.
Bug → rule → Cursor keeps it in Claude's context → fewer bugs per model.
By model 47, the failure modes in the SOP are all real — each traced to a dated incident with root cause and fix.
The document became the system's memory.
➢ Why this matters — and why Dune made it possible
Complex DeFi financials (per-user balances, supply indices, borrow rates across chains) used to refresh once a day at best.
Dune's dbt + Trino stack makes hourly incremental jobs on this data actually viable — at sustainable cost.
That's not a small thing. Hourly on-chain financial data, production-grade, open to the ecosystem.
Thanks to
@dune and the team (
@onchain_ben @fr0zensun @kdotkrisp @Maria) for building infrastructure that makes this real. 🙏
➢ Why I care this much about accuracy
@sparkfinance is one of the most data-driven teams I've worked with.
Data here isn't a dashboard for show — it directly informs protocol decisions. The team asks hard questions. Numbers need to be right before they're trusted, not after.
That standard is what pushed me to build the validation gate in the first place.
Working with a team that respects data rigor pushes you to build better systems, not just better dashboards.
I'm grateful for that.