feat(web3): Integrate Flare Time Series Oracle (FTSO) for Price Feeds#35
Merged
zakkiyyat merged 4 commits intoMixMatch-Inc:mainfrom Sep 21, 2025
Merged
feat(web3): Integrate Flare Time Series Oracle (FTSO) for Price Feeds#35zakkiyyat merged 4 commits intoMixMatch-Inc:mainfrom
zakkiyyat merged 4 commits intoMixMatch-Inc:mainfrom
Conversation
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.
PR: feat(web3): Integrate Flare Time Series Oracle (FTSO) for Price Feeds
Closes #[Issue Number]
Description
This pull request enhances the application with reliable, decentralized, and real-time financial data by integrating directly with the Flare Time Series Oracle (FTSO).
A new service has been created to query the FTSO smart contracts on the Flare network, allowing the application to fetch the latest price feeds for various tokens (e.g., FLR/USD). This provides users with crucial financial context, such as displaying the real-time fiat value of on-chain transactions, without relying on centralized off-chain APIs.
Implementation Details
FTSO Service&useFtsoPriceHookSmart Contract Interaction:
ftso.service.ts) has been implemented to handle all direct interactions with the FTSOPriceSubmittersmart contract usingethers.js.getLatestPrice(symbol), is exposed, which takes a token symbol (e.g., 'FLR') and returns its latest price and decimal information from the oracle.Caching with TanStack Query:
useFtsoPrice(symbol), wraps the service call with TanStack Query'suseQuery.staleTimeis configured to ensure the price is re-fetched periodically, keeping the data fresh.UI Demonstration:
How to Test
1. Setup
2. UI Verification
3. Caching Behavior Verification
staleTimeto expire (e.g., 2 minutes).