SVM Split#464
Merged
DenisCarriere merged 20 commits intomainfrom Apr 8, 2026
Merged
Conversation
… databases Separate `owner_state` lookups into dedicated `accounts` database and token metadata into `metadata` database. Update example config to use new database versions (svm-transfers@v0.3.1, svm-balances@v0.3.2, svm-accounts@v0.3.0, svm-metadata@v0.3.1, svm-dex@v0.4.0). Add `accountsDatabases` and `metadataDatabases` to config schema and fall back to balances/transfers databases when not configured.
Contributor
ChangelogUpdate to new Clickhouse DBs
OHLCV
Owners
Transfers (SPL & Native)
Transfers (SPL)
Transfers (Native)
DEX Swaps
Balances (SPL)
Balances (Native)
Substreams SVM DB Clickhouse
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request makes significant improvements to Solana (SVM) database configuration and query logic, especially around splitting account and metadata tables, updating SQL queries for consistency, and simplifying how filter logic is handled in large SQL files. The changes improve modularity, correctness, and maintainability across the codebase.
Database configuration and interface updates:
dbs-config.yaml.examplenow splits outaccountsandmetadatadatabases, and updates references to new package versions for transfers, balances, and dexes. (dbs-config.yaml.example)ParsedDbsConfig) and its initialization now includeaccountsDatabasesandmetadataDatabasesfor better separation of concerns. (src/config/dbsConfig.ts) [1] [2]API route and query updates for new database structure:
accountsDatabasesandmetadataDatabaseswhere appropriate, with improved error handling if any are missing. (src/routes/balances/svm.ts,src/routes/holders/svm.ts,src/routes/owner/svm.ts,src/routes/tokens/svm.ts) [1] [2] [3] [4]owner_statenow comes fromaccountsDB, notbalances). (src/routes/balances/svm.sql,src/routes/holders/svm.sql,src/routes/owner/svm.sql) [1] [2] [3] [4]Native balances and naming consistency:
balances_native→native_balances,lamports→amount), and output field names are clarified. (src/routes/balances/svm_native.sql,src/routes/holders/svm.sql) [1] [2] [3]SQL filter logic simplification:
swapsandtransfersSQL files is greatly simplified: instead of complex CTEs and minute-bucket intersection, queries now use ahas_filtersCTE to determine if filters are present, and only apply time window clamping if needed. This reduces query complexity and improves maintainability. (src/routes/swaps/svm.sql,src/routes/transfers/svm.sql) [1] [2] [3] [4] [5]These changes together modernize the SVM data handling, improve reliability, and lay the groundwork for future extensibility.