feat: Implement Real-time External Crypto Price Oracle Connector#454
Open
Ugasutun wants to merge 2 commits intoDevsol-01:mainfrom
Open
feat: Implement Real-time External Crypto Price Oracle Connector#454Ugasutun wants to merge 2 commits intoDevsol-01:mainfrom
Ugasutun wants to merge 2 commits intoDevsol-01:mainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@Ugasutun Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Closes #414
Pull Request Description
Title
[Backend] Real-time External Crypto Price Oracle Connector
Issue Reference
#414
Description
Implements a real-time crypto price oracle connector that normalizes portfolio values to USD using CoinGecko API with intelligent caching to prevent rate limiting.
Background & Context
Nestera aggregates net worth into a unified "USD" figure. Summing 1,000 XLM and 1,000 USDC directly is mathematically useless without normalization. This PR combines Soroban ledger stats with CoinGecko pulling in real-time fiat prices for conversion math.
Changes Made
1. Enhanced oracle.service.ts (backend/src/modules/blockchain/oracle.service.ts)
axiosimport alongside NestJS HttpService for fallback API calls@nestjs/cache-managerwith 5-minute TTL (300000ms) to prevent CoinGecko API rate limitinggetAllPrices()method for batch price fetchinggetXLMPrice()- Fetch XLM price in USDgetAQUAPrice()- Fetch AQUA price in USDconvertXLMToUsd()- Convert XLM amount to USDconvertAQUAToUsd()- Convert AQUA amount to USDconvertStroopsToUsd()- Convert stroops (smallest XLM unit) to USDgetAssetPrices()- Fetch prices for multiple assets2. Updated analytics.service.ts (backend/src/modules/analytics/analytics.service.ts)
getPortfolioTimeline()to return both native value and normalized USD value:value: Native XLM amountvalueUsd: Normalized USD value3. Updated analytics.module.ts (backend/src/modules/analytics/analytics.module.ts)
BlockchainModuleimport to provide access toOracleServicefor USD conversionAcceptance Criteria ✅
Technical Details
Testing
Related Files
Breaking Changes
None - this is a backward-compatible enhancement that adds USD normalization to existing responses.