Skip to content

feat: live vault data, multi-pool aggregation and risk scoring on dashboard - #45

Merged
collinsezedike merged 6 commits into
mainfrom
feat/app-dashboard
May 19, 2026
Merged

feat: live vault data, multi-pool aggregation and risk scoring on dashboard#45
collinsezedike merged 6 commits into
mainfrom
feat/app-dashboard

Conversation

@collinsezedike

@collinsezedike collinsezedike commented May 18, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fetches all Stellar stablecoin pools from DeFiLlama's /pools endpoint in a single request (replaces per-pool /chart/{id} calls)
  • Surfaces 6 pools across 3 protocols — Blend Capital (USDC Fixed, USDC Variable, EURC Fixed, EURC Variable), Ondo Finance (USDY), and DeFindex (USDC testnet estimate)
  • Implements a risk scoring algorithm (assessPoolRisk) using TVL depth, 7-day APY volatility, and APY ceiling — pools are scored safe | caution | risky
  • Jupiter-style dashboard redesign — solid dark cards (#161b22), no glow/pulse, protocol-colour-coded dots and asset badges
  • Risk surfaced on the Deposit button: ghost yellow (caution) and ghost red (risky), with a hover tooltip explaining the reason
  • Redis caching (1 h TTL) with graceful no-Redis fallback
  • Dual timeout: 4 s DeFiLlama server-side abort + 10 s browser-side AbortSignal

Data sources

Pool Protocol Asset Source Live?
blend-usdc-fixed Blend Capital USDC DeFiLlama /pools Yes
blend-eurc-fixed Blend Capital EURC DeFiLlama /pools Yes
blend-usdc-variable Blend Capital USDC DeFiLlama /pools Yes
blend-eurc-variable Blend Capital EURC DeFiLlama /pools Yes
ondo-usdy Ondo Finance USDY DeFiLlama /pools Yes
defindex-usdc DeFindex USDC Testnet estimate Pending vault deploy

Architecture

GET /api/v1/vaults
  └─ services/vaults.ts
       ├─ getStellarStablecoinPools()   → DeFiLlama /pools (single call, filtered)
       │    └─ assessPoolRisk()         → TVL + APY volatility + APY ceiling score
       └─ getDefindexVaultInfo()        → seeded testnet estimate
  └─ Redis cache (1 h TTL)

ApiVault shape: { id, protocol, asset, name, label, apy, tvl, userBalance, riskLevel }

Risk algorithm

Three additive signals scored 0–3 each:

  • TVL depth — < $10 K (+3), < $100 K (+2), < $2 M (+1)
  • 7-day APY swing — > 30 % (+3), > 5 % (+2), > 1 % (+1)
  • APY ceiling — > 20 % (+2), > 12 % (+1)

score ≥ 4 → risky | score ≥ 2 → caution | otherwise → safe

Test plan

  • pnpm typecheck — all packages clean
  • DeFiLlama /pools fetch returns and filters to the 5 known Stellar stablecoin pools
  • assessPoolRisk correctly classifies pools by TVL and volatility
  • Risk badge renders on Deposit button — ghost yellow for caution, ghost red for risky
  • Hover tooltip explains risk reason
  • Dashboard VaultList renders all 6 cards with live APY / TVL

@vercel

vercel Bot commented May 18, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
meridian Ready Ready Preview, Comment May 19, 2026 1:06am

@collinsezedike collinsezedike changed the title feat: live vault data on dashboard feat: live vault data, multi-pool aggregation and risk scoring on dashboard May 19, 2026
@collinsezedike
collinsezedike merged commit 58e810a into main May 19, 2026
4 checks passed
@collinsezedike
collinsezedike deleted the feat/app-dashboard branch May 19, 2026 01:09
@collinsezedike collinsezedike added enhancement New feature or request frontend Involves React components, Tailwind styling, or Next.js pages api Adds or modifies a REST endpoint in apps/api protocol-integration Involves reading from or writing to Blend or DeFindex on-chain and removed enhancement New feature or request frontend Involves React components, Tailwind styling, or Next.js pages api Adds or modifies a REST endpoint in apps/api protocol-integration Involves reading from or writing to Blend or DeFindex on-chain labels May 22, 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