Skip to content

add DFlow aggregator swaps for Solana#9325

Open
sq-intern wants to merge 3 commits intoduneanalytics:mainfrom
sq-intern:dflow
Open

add DFlow aggregator swaps for Solana#9325
sq-intern wants to merge 3 commits intoduneanalytics:mainfrom
sq-intern:dflow

Conversation

@sq-intern
Copy link
Copy Markdown
Contributor

Thank you for contributing to Spellbook 🪄

Please open the PR in draft and mark as ready when you want to request a review.

Description: Adds DFlow aggregator swap spell that decodes swap events routed through the DFlow aggregator on Solana. Uses the swap_orchestrator_evt_swapevent decoded table, joins to Jupiter's AMM list for DEX identification, and enriches with token metadata and USD pricing.

[...]


quick links for more information:

@cursor
Copy link
Copy Markdown

cursor Bot commented Feb 15, 2026

PR Summary

Medium Risk
Adds a new incremental, partitioned swaps pipeline with multiple joins (AMM mapping, token metadata, prices), which can affect correctness/duplication if keys or join assumptions are off. No authentication/security-sensitive logic is touched.

Overview
Adds a new Solana dbt incremental model dflow_solana.aggregator_swaps built from the decoded dflow_solana.swap_orchestrator_evt_swapevent source, filtering from 2025-04-01 and merging on a composite unique key.

The model enriches swaps by joining to jupiter_solana_amms for AMM naming plus token metadata (tokens_solana.fungible) and USD forward-fill prices, and introduces a schema file with column docs and a unique_combination_of_columns test. Also registers the new dflow_solana decoded source in _sources.yml.

Written by Cursor Bugbot for commit 9f0e57b. Configure here.

@github-actions github-actions Bot marked this pull request as draft February 15, 2026 12:30
@github-actions github-actions Bot added WIP work in progress dbt: solana covers the Solana dbt subproject labels Feb 15, 2026
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

file_format = 'delta',
incremental_strategy = 'merge',
incremental_predicates = [incremental_predicate('DBT_INTERNAL_DEST.block_time')],
unique_key = ['block_month', 'tx_id', 'input_mint', 'output_mint', 'input_amount', 'output_amount'],
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unique key missing instruction indices causes silent data loss

High Severity

The unique_key uses input_amount and output_amount instead of instruction indices (evt_outer_instruction_index, evt_inner_instruction_index) to distinguish rows. If a transaction contains two identical swaps through the same AMM with the same mints and amounts, one row will be silently dropped during the incremental merge. The comparable Jupiter aggregator models use log_index (derived from instruction indices) for this purpose. The columns are already selected in the query but aren't used in the key. The unique_combination_of_columns data test in the schema file has the same gap.

Additional Locations (1)

Fix in Cursor Fix in Web

@@ -0,0 +1,61 @@
version: 2
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Schema filename has typo with double letter

Low Severity

The schema file is named dfllow_solana_aggregator_schema.yml with a double 'l' instead of dflow_solana_aggregator_schema.yml. While dbt will still find and process it, this inconsistency with the model and directory naming (dflow) is confusing and makes the file harder to locate.

Fix in Cursor Fix in Web

@sq-intern sq-intern marked this pull request as ready for review February 19, 2026 07:57
@github-actions github-actions Bot added ready-for-review this PR development is complete, please review and removed WIP work in progress labels Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dbt: solana covers the Solana dbt subproject ready-for-review this PR development is complete, please review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant