Skip to content

Conversation

@0237h
Copy link
Collaborator

@0237h 0237h commented Dec 9, 2025

  • Same format as EVM with tuple of (mint, symbol, decimals)
  • Add price and price_inv, summary of swap
  • Update OpenAPI schemas

Fixes #298

0237h added 2 commits December 9, 2025 10:05
- Same format as EVM with tuple of `(mint, symbol, decimals)`
- Add `price` and `price_inv`, `summary` of swap
- Update OpenAPI schemas
@changeset-bot
Copy link

changeset-bot bot commented Dec 9, 2025

🦋 Changeset detected

Latest commit: 6d26a2a

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

@0237h 0237h requested a review from Copilot December 9, 2025 15:08
@YaroShkvorets YaroShkvorets temporarily deployed to feat/add-metadata-svm-swaps - token-api PR #305 December 9, 2025 15:08 — with Render Destroyed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the SVM Swaps API response to include token metadata (mint address, symbol, decimals), calculated price fields, and a human-readable swap summary. The changes align the SVM response format with the existing EVM token metadata structure.

Key changes:

  • Token metadata now returns structured objects with (mint, symbol, decimals) instead of just addresses
  • Added price, price_inv, and summary fields to provide calculated swap metrics
  • Updated SQL query to perform batch lookups for token decimals and symbols

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

File Description
src/types/zod.ts Updated schema to rename address to mint and add symbol field with nullable types
src/sql/swaps/svm.sql Added token metadata lookups, price calculations, and summary formatting to swap queries
src/routes/v1/svm/swaps/svm.ts Updated response schema and route handler to include new token metadata structure and fields
.changeset/fresh-lands-bet.md Added changeset documenting the minor version update

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Convert `program_id` to string before using the SQL function
@0237h
Copy link
Collaborator Author

0237h commented Dec 9, 2025

Needs to move to a v2 endpoint as it's breaking existing schema

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.

Token Symbol/Decimals for /svm/swaps

3 participants