Skip to content

feat: add parallel asset price fetching with configurable concurrency in Oracle providers#147

Merged
Smartdevs17 merged 2 commits intoSmartdevs17:mainfrom
DevSolex:feat/parallel-asset-price-fetching-45
Mar 27, 2026
Merged

feat: add parallel asset price fetching with configurable concurrency in Oracle providers#147
Smartdevs17 merged 2 commits intoSmartdevs17:mainfrom
DevSolex:feat/parallel-asset-price-fetching-45

Conversation

@DevSolex
Copy link
Copy Markdown
Contributor

Summary

Closes #45

Refactors fetchPrices() in oracle/src/providers/base-provider.ts to fetch assets in parallel with a configurable concurrency limit instead of sequentially.

Changes

  • oracle/src/types/index.ts: Added optional concurrencyLimit?: number to ProviderConfig
  • oracle/src/providers/base-provider.ts: Replaced sequential loop with batched Promise.allSettled — assets fetched concurrencyLimit at a time (default: 5)
  • oracle/tests/parallel-fetching.test.ts: 5 new tests covering all acceptance criteria

Acceptance Criteria

  • Assets fetched in parallel with configurable concurrency limit (default 5)
  • Failed fetches don't block successful ones (Promise.allSettled isolates failures)
  • Rate limiting still respected (each fetch still calls enforceRateLimit())
  • Tests verify parallel execution

Test Results

All 282 tests pass (16 test files).

…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
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 27, 2026

@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.

@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 27, 2026

@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! 🚀

Learn more about application limits

@Smartdevs17 Smartdevs17 merged commit 2f57604 into Smartdevs17:main Mar 27, 2026
2 of 7 checks passed
@Smartdevs17
Copy link
Copy Markdown
Owner

LGTM. Kindly drop a review. Thank you.

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.

Feature: Add parallel asset price fetching in Oracle providers

2 participants