feat: add parallel asset price fetching with configurable concurrency in Oracle providers#147
Merged
Smartdevs17 merged 2 commits intoSmartdevs17:mainfrom Mar 27, 2026
Conversation
…Smartdevs17#45) - Refactor fetchPrices() to use Promise.allSettled with batched concurrency - Add optional concurrencyLimit to ProviderConfig (defaults to 5) - Failed fetches are isolated and logged without blocking successful ones - Rate limiting is preserved across parallel batches - Add parallel-fetching.test.ts with 5 tests covering all acceptance criteria
|
@DevSolex is attempting to deploy a commit to the smartdevs17's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
@DevSolex 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! 🚀 |
Owner
|
LGTM. Kindly drop a review. Thank you. |
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.
Summary
Closes #45
Refactors
fetchPrices()inoracle/src/providers/base-provider.tsto fetch assets in parallel with a configurable concurrency limit instead of sequentially.Changes
oracle/src/types/index.ts: Added optionalconcurrencyLimit?: numbertoProviderConfigoracle/src/providers/base-provider.ts: Replaced sequential loop with batchedPromise.allSettled— assets fetchedconcurrencyLimitat a time (default: 5)oracle/tests/parallel-fetching.test.ts: 5 new tests covering all acceptance criteriaAcceptance Criteria
Promise.allSettledisolates failures)enforceRateLimit())Test Results
All 282 tests pass (16 test files).