Skip to content

feat: stackingdao page on the new api - #183

Closed
pradel wants to merge 1 commit into
mainfrom
feat/web-stackingdao-new-api
Closed

pradel wants to merge 1 commit into
mainfrom
feat/web-stackingdao-new-api

Conversation

@pradel

@pradel pradel commented Oct 21, 2026

Copy link
Copy Markdown
Owner

The StackingDAO page (/protocols/stackingdao) now reads the new indexer API, so it works locally against the indexer. The homepage and the other protocol pages still call the old server's routes and are fixed in a follow-up PR.

Sections

Section Endpoint
Card per token: amount minted by deposits, stakers, deposits, 30-day APY (stSTX, stBTC) /stackingdao/stats, /stackingdao/yield
Deposits and withdrawals per month, with a stSTX / stSTXbtc / stBTC switch /stackingdao/flows
stSTX value in STX / stBTC value in sBTC over time, with APY /stackingdao/yield
Stakers per month, new vs returning /stackingdao/stakers
Instant vs standard withdrawals per month, with a token switch /stackingdao/withdrawals
stSTX ⇄ stSTXbtc swaps per month /stackingdao/swaps
Latest 25 deposits, withdrawals and swaps /stackingdao/activity
  • They replace the generic stats cards, unique-users chart and transactions feed on this page; the old /api/protocols/stackingdao chart is deleted.
  • The cards and the deposits/withdrawals chart use token amounts (minted / burned): core-v1 stSTX deposits print no STX amount, so STX totals would undercount the earliest months.
  • New shared pieces: fetchApi and the response types in lib/api.ts, token metadata in lib/stackingdao.ts, ChartCard, TokenSwitch.

Area charts fix

Every Tremor AreaChart rendered empty, including the token page's volume chart: recharts 2 resolved react-is 18.3.1, which does not recognize React 19 elements, so its fragment-wrapped series were dropped. pnpm-workspace.yaml now overrides recharts>react-is to 19.1.0, the version apps/web already depends on.

Verification

  • tsc and vp check (0 errors).
  • Indexer API on :3001 against mainnet on a fresh database plus next dev: the empty state renders; real core-v1 deposits show in the cards, charts and feed. With sample recent rows seeded in the throwaway database, all five charts draw on a clean load, the token switches work, the stSTX APY matches the hand calculation, and the console has no errors.

Running locally

pnpm dev in apps/indexer (API on :3001), then pnpm dev in apps/web. A fresh indexer database fills in oldest first.

Known gap

The withdrawals chart is in STX/sBTC; core-v1 standard withdrawals print no STX amount and are missing from the earliest months. Fixing it needs token amounts on /stackingdao/withdrawals.

@pradel pradel closed this Oct 22, 2026
@pradel
pradel deleted the feat/web-stackingdao-new-api branch October 22, 2026 13:25
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