Skip to content

fix: update datafeed module#2092

Open
dwjanus wants to merge 2 commits intomainfrom
dwj/eng-1921-datafeed-for-candles
Open

fix: update datafeed module#2092
dwjanus wants to merge 2 commits intomainfrom
dwj/eng-1921-datafeed-for-candles

Conversation

@dwjanus
Copy link
Contributor

@dwjanus dwjanus commented Mar 6, 2026

Changes

tldr; Hardens the dydx TradingView datafeed to properly use TradingView's countBack parameter and pass an explicit limit to candle API requests.

  • src/lib/tradingView/dydxfeed/index.ts: Extract countBack from periodParams and pass it through to getCandlesForDatafeed. Removes the TODO acknowledging this gap.
    -src/hooks/useDydxClient.tsx: Accept countBack in getCandlesForDatafeed
    Refactor while loop from while (true) to while (candlesInRange.length < countBack) — stops once TradingView has enough bars
  • Simplify stop conditions

Issue

ENG-1921

Previously the while loop relied solely on time-range pagination with no explicit limit, and countBack was ignored entirely. With smaller API responses, the loop now properly paginates until countBack is fulfilled, ensuring TradingView always receives enough bars for chart rendering.

@linear
Copy link

linear bot commented Mar 6, 2026

@vercel
Copy link

vercel bot commented Mar 6, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
v4-staging Ready Ready Preview, Comment Mar 9, 2026 4:17pm
v4-testnet Ready Ready Preview, Comment Mar 9, 2026 4:17pm

Request Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant