Deduplicate flashloan matches in NFT wash trades - #10047
Merged
tomfutago merged 1 commit intoSep 28, 2026
Merged
Conversation
jeff-dude
marked this pull request as ready for review
September 27, 2026 13:28
tomfutago
approved these changes
Sep 28, 2026
tomfutago
deleted the
centaur/fix-nft-wash-trades-merge-duplicates-1790511630
branch
September 28, 2026 07:41
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
What & why
Deduplicate flashloan matches by
unique_trade_idbefore joining them to NFT trades.One NFT trade can match several flashloan rows from the same transaction.
The trade keeps its flashloan flag, and the output no longer fans out into duplicate merge keys.
Architecture
dbt_subprojects/hourly_spellbook/macros/_sector/nft/nft_wash_trades.sql- data critical path tonft.wash_trades;filter_5now emits one row per trade ID.MERGE; itsunique_trade_idtest passed. Query of the Ethereum PR CI table returned zero duplicate IDs in the last two days.nft.wash_tradesschema and flags stay the same; duplicate flashloan matches collapse to one row.Agent context
dune.dune_spellbook_ci__tmp_pr10047_36318857788_1.nft_ethereum_wash_trades