Skip to content

Conversation

@YaroShkvorets
Copy link
Member

This pull request introduces several improvements and refactors to the EVM and SVM SQL queries and route handlers, focusing on better metadata handling, expanded query parameters, and more robust database selection. The changes enhance token metadata joins, add new query filters, and ensure consistent protocol formatting across the API and SQL layers.

EVM SQL and API improvements:

  • Refactored src/sql/pools/evm.sql to use a metadata join for token information, improved native token handling, and updated filtering logic for pools and protocols to be more flexible and consistent.
  • Updated src/sql/ohlcv_prices_for_pool/evm.sql to join token metadata for accurate symbol/decimals, improved high/low price calculations, and added support for passing the token metadata database as a parameter. [1] [2]
  • Expanded swap and pool route query schemas in src/routes/v1/evm/swaps/evm.ts to support filtering by factory, input/output contract, and improved OpenAPI examples and validation. [1] [2] [3]
  • Modified EVM route handlers (evm.ts, ohlc/evm.ts, swaps/evm.ts) to require both Uniswap and token metadata databases, passing the token DB to queries for accurate metadata resolution. [1] [2] [3] [4]

SVM SQL improvements:

  • Changed SVM SQL queries to use non-_latest tables for owner and metadata state, and updated decimals lookup to use decimals_state instead of mints for accuracy. [1] [2] [3] [4] [5]

DEX and protocol listing enhancements:

  • Refactored src/sql/supported_dexes/evm.sql to aggregate protocol/factory stats from ohlc_prices, standardize protocol formatting, and limit results for performance.
  • Added a result limit to src/sql/supported_dexes/svm.sql for efficiency.

Changelog:

  • Added a changeset documenting the updates to SQL queries for token and DEX support.

@changeset-bot
Copy link

changeset-bot bot commented Dec 12, 2025

🦋 Changeset detected

Latest commit: 4ffab9d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
token-api Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@YaroShkvorets YaroShkvorets temporarily deployed to new-version-with-evm-swaps - token-api PR #308 December 12, 2025 04:24 — with Render Destroyed
@YaroShkvorets YaroShkvorets temporarily deployed to new-version-with-evm-swaps - token-api PR #308 December 16, 2025 21:18 — with Render Destroyed
@YaroShkvorets YaroShkvorets temporarily deployed to new-version-with-evm-swaps - token-api PR #308 December 17, 2025 14:26 — with Render Destroyed
@YaroShkvorets YaroShkvorets temporarily deployed to new-version-with-evm-swaps - token-api PR #308 December 17, 2025 15:06 — with Render Destroyed
@YaroShkvorets YaroShkvorets temporarily deployed to new-version-with-evm-swaps - token-api PR #308 December 17, 2025 15:07 — with Render Destroyed
@YaroShkvorets YaroShkvorets temporarily deployed to new-version-with-evm-swaps - token-api PR #308 December 17, 2025 23:47 — with Render Destroyed
@YaroShkvorets YaroShkvorets marked this pull request as ready for review December 18, 2025 15:02
@YaroShkvorets YaroShkvorets merged commit e81a1f7 into main Dec 18, 2025
4 checks passed
@YaroShkvorets YaroShkvorets deleted the new-version-with-evm-swaps branch December 18, 2025 15:03
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.

3 participants