Skip to content

Feat/b4 apy history chart#174

Open
vicistar-star wants to merge 2 commits into
Dgetsylver:mainfrom
vicistar-star:feat/b4-apy-history-chart
Open

Feat/b4 apy history chart#174
vicistar-star wants to merge 2 commits into
Dgetsylver:mainfrom
vicistar-star:feat/b4-apy-history-chart

Conversation

@vicistar-star
Copy link
Copy Markdown

Closes #31

Changes:

  • index.html — added hist-chart-wrap with 7d/30d/1y window selector buttons and #hist-chart container inside stats-body
  • main.ts — renderHistoryChart reads B3 snapshots, renders an SVG polyline with y-axis labels, x-axis date ticks, and invisible hit-area rects per point for
    pointer tooltip (cursor dot + exact date/APY text). _histWin session variable persists the selected window. Hooked into renderSelectedAsset and window button
    clicks.
  • style.css — window buttons, SVG chart, cursor, tooltip text, empty-state

Acceptance:

  • ✅ Smooth render without layout shift (fixed SVG viewBox, min-height on container)
  • ✅ Window selector persists per session
  • ✅ Tooltip shows exact value at pointer
  • ✅ Depends on B3 (reads blendlev_rate_history keys written by A10)

- Add rate history storage (B3): recordRateSnapshot / getRateAtWindow
  persist timestamped APY snapshots in localStorage, keyed by pool/asset/field
- Add renderTrendArrow: computes (current-past)/|past| delta, renders ▲/▼
  with percentage and a tooltip showing absolute before/after values + window
- Hook into renderSelectedAsset to record and display arrows on net supply
  APY and net borrow cost rows
- Add .rate-trend CSS (inline, 10px mono, green up / red down)
- Add hist-chart-wrap section in stats-body with 7d/30d/1y window selector
- renderHistoryChart reads B3 localStorage snapshots, renders SVG polyline
  time-series with x/y axis labels and invisible hit-area rects for tooltip
- Pointer tooltip shows exact date + APY value at cursor position
- Window selection persists in _histWin session variable (default 30d)
- Hooked into renderSelectedAsset; window buttons re-render on click
- Add CSS for chart, window buttons, cursor dot, and empty state
@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 29, 2026

@vicistar-star 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

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.

B4: 7d / 30d / 1y APY chart on asset page

1 participant