Skip to content

Add portfolio tracking with token amounts and USD value#64

Merged
TaprootFreak merged 1 commit into
developfrom
feat/portfolio-tracking
Apr 28, 2026
Merged

Add portfolio tracking with token amounts and USD value#64
TaprootFreak merged 1 commit into
developfrom
feat/portfolio-tracking

Conversation

@TaprootFreak
Copy link
Copy Markdown
Contributor

Summary

  • Token tracking: Total svJUSD + WCBTC (wallet + all positions) with delta from initial investment
  • USD tracking: Total portfolio value with P&L (absolute + percentage)
  • Uniswap V3 math: Calculate token amounts from position liquidity + current tick
  • Portfolio chart: Dual Y-axis chart showing token amounts over time
  • Persistence: Portfolio history + initial config saved to disk every 5 min
  • Dashboard: New Portfolio card between pool info and price chart

Technical details

  • getAmountsFromLiquidity() in tick-math.ts: standard Uniswap V3 sqrt price math
  • Liquidity cache refreshed every 5 min (7 RPC calls per refresh, not per 30s update)
  • Initial investment recorded at first mint (for P&L baseline)

Test plan

  • Portfolio card shows token amounts and USD value
  • P&L shows green/red based on profit/loss
  • Portfolio chart renders with dual axes
  • Data persists across restarts
  • Initial investment baseline set on first mint

Track total token holdings (wallet + positions) and USD portfolio
value over time. Calculate position token amounts from Uniswap V3
liquidity math. Display on dashboard with P&L vs initial investment.

- Token amounts: svJUSD + WCBTC totals with delta from initial
- USD value: total portfolio value with P&L absolute + percentage
- Portfolio chart: token amounts over time (dual Y-axis)
- Persisted alongside price history (survives restarts)
- Liquidity cache refreshed every 5 min to limit RPC calls
@TaprootFreak TaprootFreak marked this pull request as ready for review April 28, 2026 08:50
@TaprootFreak TaprootFreak merged commit a693257 into develop Apr 28, 2026
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.

1 participant