Skip to content

SVM Split#464

Merged
DenisCarriere merged 20 commits intomainfrom
feat/svm-split
Apr 8, 2026
Merged

SVM Split#464
DenisCarriere merged 20 commits intomainfrom
feat/svm-split

Conversation

@YaroShkvorets
Copy link
Copy Markdown
Member

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:

  • The Solana network configuration in dbs-config.yaml.example now splits out accounts and metadata databases, and updates references to new package versions for transfers, balances, and dexes. (dbs-config.yaml.example)
  • The TypeScript config interface (ParsedDbsConfig) and its initialization now include accountsDatabases and metadataDatabases for better separation of concerns. (src/config/dbsConfig.ts) [1] [2]

API route and query updates for new database structure:

  • All SVM-related API routes are updated to require and use the new accountsDatabases and metadataDatabases where 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]
  • SQL queries for balances, holders, and owner lookups are refactored to join or select from the correct new tables (owner_state now comes from accounts DB, not balances). (src/routes/balances/svm.sql, src/routes/holders/svm.sql, src/routes/owner/svm.sql) [1] [2] [3] [4]

Native balances and naming consistency:

  • The native SOL balances logic is updated for naming consistency (balances_nativenative_balances, lamportsamount), and output field names are clarified. (src/routes/balances/svm_native.sql, src/routes/holders/svm.sql) [1] [2] [3]

SQL filter logic simplification:

  • The filter logic in both swaps and transfers SQL files is greatly simplified: instead of complex CTEs and minute-bucket intersection, queries now use a has_filters CTE 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.

… 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.
@DenisCarriere
Copy link
Copy Markdown
Contributor

DenisCarriere commented Apr 8, 2026

Changelog

Update to new Clickhouse DBs

  • dex@v0.4.0
  • transfers@v0.3.1
  • balances@v0.3.2
  • metadata@v0.3.1
  • accounts@v0.3.0

OHLCV

  • 🔨 Breaking ❌ remove token* & token*_decimals fields
    • Align the same OHLCV formatting as EVM endpoints

Owners

  • 🔨 Breaking ❌ remove is_closed field
    • The DB table state is auto-deleted, it's no-deterministic to return this field

Transfers (SPL & Native)

  • Update Types
    • amount type is now Number instead of String
  • New Filters
    • fee_payer
    • signer
  • New Fields
    • signers
    • fee
    • compute_units_consumed
    • stack_height

Transfers (SPL)

  • Middleware for Native mint
  • New Fields
    • multisig_authority

Transfers (Native)

  • New Route = /svm/transfers/native
  • Response fields:
    • program_id = 11111111111111111111111111111111 (System Program)
    • mint = So11111111111111111111111111111111111111112 (SOL)
  • New Fields
    • multisig_authority

DEX Swaps

  • Update Types
    • input_amount & output_amount type is now Number instead of String
  • New Filters
    • protocol
    • fee_payer
    • signer
  • New Fields
    • signers
    • fee
    • compute_units_consumed
    • stack_height
  • New DEX enums
    • jupiter_v4
    • jupiter_v6
    • pumpfun
    • pumpfun_amm
    • raydium_amm_v4
    • raydium_clmm
    • raydium_cpmm
    • raydium_launchpad
    • meteora_dllm
    • orca_whirlpool
    • boop
    • darklake
    • dumpfun
  • New OHLCV time intervals
    • 1m, 5m, 10m, 30m

Balances (SPL)

  • Middleware for Native mint
  • Update Types
    • amount type is now Number instead of String

Balances (Native)

  • New Route = /svm/balances/native
  • Update Types
    • amount type is now Number instead of String

Substreams SVM DB Clickhouse

  • ❌ missing SPL Metadata
  • ❌ missing Accounts decimals

@YaroShkvorets YaroShkvorets temporarily deployed to feat/svm-split - token-api PR #464 April 8, 2026 16:06 — with Render Destroyed
@DenisCarriere DenisCarriere marked this pull request as ready for review April 8, 2026 16:21
@DenisCarriere DenisCarriere merged commit 947b032 into main Apr 8, 2026
3 of 4 checks passed
@DenisCarriere DenisCarriere deleted the feat/svm-split branch April 8, 2026 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants