CUR2-2025: exclude non-circulating owner wallets from Solana USDC supply#9682
CUR2-2025: exclude non-circulating owner wallets from Solana USDC supply#9682alicecha wants to merge 3 commits into
Conversation
…ablecoin balances Adds a parallel non-circulating inventory list keyed on owner_address (vs. the existing token_account keyed list) so we can exclude wallets that hold balances across multiple token accounts. Seeds it with the USDC Circle treasury and the two additional owners DefiLlama treats as non-circulating, bringing Dune's Solana USDC circulating supply in line with DefiLlama and usdc.cool. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
PR SummaryMedium Risk Overview Adds two new static helper models, Reviewed by Cursor Bugbot for commit 3868f43. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Added
where excludedsilently drops premint account exclusions- Removed the
where excludedfilter from account-level exclusions so all premint token accounts remain excluded regardless of owner-list coverage.
- Removed the
Or push these changes by commenting:
@cursor push 4b6d7373c2
Preview (4b6d7373c2)
diff --git a/dbt_subprojects/solana/macros/stablecoins/stablecoins_svm_balances.sql b/dbt_subprojects/solana/macros/stablecoins/stablecoins_svm_balances.sql
--- a/dbt_subprojects/solana/macros/stablecoins/stablecoins_svm_balances.sql
+++ b/dbt_subprojects/solana/macros/stablecoins/stablecoins_svm_balances.sql
@@ -17,7 +17,6 @@
token_mint_address,
token_account
from {{ non_circulating_inventory_accounts_relation }}
- where excluded
),
non_circulating_inventory_owners as (You can send follow-ups to the cloud agent here.
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 3868f43. Configure here.
The seed model marked official_circle_premint rows with excluded=false, so the 6 USDC premint accounts (~$190M as of 2026-05) leaked into circulating supply even though they're tracked in the non-circulating inventory list. Expand the excluded truthy set to cover both legacy_inventory and official_circle_premint; the latter is non-circulating by Circle's own definition (per the Gateway pre-mint blog referenced in the file). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…ages
Replaces 4 split models (core+extended × accounts+owners) with 2 chain-level
lists (accounts + owners). The exclusion set is the same regardless of which
lineage a stablecoin lives in, so duplicating the seed across core/extended
added boilerplate without any benefit. The macro now refs the single chain-level
relation; the inner join against tokens_solana_spl_stablecoins_{core,extended}
is dropped (the inline VALUES are already constrained to known mints, and the
macro's join against the relevant transfers feed handles lineage filtering).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
looks like this new addition and left join lookup on balances really expanded incremental run time? unless this was always slow? |


Summary
stablecoins_solana_{core,extended}_non_circulating_inventory_owners) alongside the existing token-account-keyed list. Any token account whose owner appears in the list is treated as non-circulating instablecoins_solana_{core,extended}_balances.7VHUFJHWu2CuExkJcJrzhQPJ2oygupTWkL2A2For4BmE— Circle treasury41zCUJsKk6cMB94DDtm99qWmyMZfp4GkAhhuz4xTwePu42qwJUTbKf3D8ULfWadUSjnHf6pkJ4H1VjCcfSKHvDTN$8.17b) and usdc.cool ($7.96b); current Dune value as of 2026-04-15 was $9.26b.Why a separate owner list (vs. extending the existing token-account list)
The existing
_inventory_accountslist keys on SPL token accounts, but the addresses above are owner wallets that hold non-circulating inventory across multiple token accounts (current and future). Resolving them to a fixed set of token accounts would be brittle. The new_inventory_ownerslist joins onfrom_owner/to_ownerin the balances macro, so it covers all of an owner's token accounts automatically.Linear: https://linear.app/dune/issue/CUR2-2025/review-and-fix-usdc-supply-on-solana
Test plan
🤖 Generated with Claude Code