Skip to content

Conversation

@sahar-fehri
Copy link
Contributor

@sahar-fehri sahar-fehri commented Jan 8, 2026

Description

use v3 for EVM historical prices instead of V1 price api.
Api platform team has made improvements on the v3 api; they added geckoterminal as provider for historical prices, hence it should have more coverage for prices.

Changelog

CHANGELOG entry: using v3 api to get historical prices for asset details page instead of v1

Related issues

Fixes:

Manual testing steps

Feature: my feature name

  Scenario: user [verb for user action]
    Given [describe expected initial app state]

    When user [verb for user action]
    Then [describe expected outcome]

Screenshots/Recordings

Before

Screen.Recording.2026-01-08.at.18.25.48.mov

After

Screen.Recording.2026-01-08.at.18.23.26.mov

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Note

Switch EVM historical price fetch to v3

  • In useTokenHistoricalPrices, replace v1 price.api endpoint with v3 and change path to use CAIP-2/CAIP-19 (eip155:{chainId} and erc20:{address}) for EVM assets
  • Preserve existing query params (timePeriod, vsCurrency, optional from/to) and 204 handling; non-EVM flow unchanged

Written by Cursor Bugbot for commit 8e2fd83. This will update automatically on new commits. Configure here.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@github-actions
Copy link
Contributor

github-actions bot commented Jan 8, 2026

🔍 Smart E2E Test Selection

  • Selected E2E tags: SmokeAssets
  • Risk Level: low
  • AI Confidence: 75%
click to see 🤖 AI reasoning details

The change modifies the useTokenHistoricalPrices.ts hook to update the price API endpoint from v1 to v3 and changes the URL format to use CAIP-19 format for asset identification. This is a backend API format change that affects how historical prices are fetched for EVM tokens.

The hook is used by the AssetOverview component which displays token details and price charts. The change is relatively isolated and straightforward - it's updating the API endpoint URL structure to use a newer API version with CAIP-19 format (eip155:{chainId}/erc20:{address}).

Risk is assessed as LOW because:

  1. The change is a simple URL format update to use a standardized CAIP-19 format
  2. The logic flow remains the same - only the API endpoint structure changes
  3. No changes to error handling or data transformation logic
  4. The change is isolated to the EVM token path (non-EVM assets use a different code path)

Selected SmokeAssets tag as it's the most relevant for asset management and display functionality. Note that while this tag is defined in the test framework, there are currently no E2E tests using this tag, so this selection serves as documentation of the intended test coverage area rather than triggering actual tests.

View GitHub Actions results

@sonarqubecloud
Copy link

sonarqubecloud bot commented Jan 8, 2026

Copy link
Contributor

@bergarces bergarces left a comment

Choose a reason for hiding this comment

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

I gave the url a test with multiple native, non-native and mixed case addresses and it seems to work.

@sahar-fehri sahar-fehri added this pull request to the merge queue Jan 9, 2026
Merged via the queue into main with commit a7cc1a0 Jan 9, 2026
114 of 118 checks passed
@sahar-fehri sahar-fehri deleted the fix/use-historical-prices-v3-api branch January 9, 2026 22:24
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2026
@metamaskbot metamaskbot added the release-7.62.0 Issue or pull request that will be included in release 7.62.0 label Jan 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

release-7.62.0 Issue or pull request that will be included in release 7.62.0 size-XS team-assets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants