feat(data): Soroban RPC service layer, price feeds, and TVL/APY hooks#66
Merged
Merged
Conversation
…ooks - Add services/rpc.ts: singleton Soroban JSON-RPC client using native fetch, reads NEXT_PUBLIC_SOROBAN_RPC_URL env var - Add services/prices.ts: fetches XLM and EURC prices from Stellar Horizon DEX order book with 60s in-memory cache; exports fetchAssetPrices() and useAssetPrices() hook - Add hooks/usePosition.ts: reads user position (shares, principal, accruedYield, lockUntil) per vault tier with loading/error states - Add hooks/useAllocations.ts: reads AMM pool allocations from StrategyVault contract with 30s polling - Add hooks/useTVL.ts: aggregates per-tier TVL by reading total_shares from each vault and reversing the share multiplier (Flex=1.00x, L3=1.05x, L6=1.15x, L12=1.35x) - Add hooks/useAPY.ts: calculates trailing 7d and 30d APY from Harvester contract events, annualised - Add components/StatsBar.tsx: client component wiring useTVL and useAPY into a live stats bar - Update app/page.tsx: replace static placeholder with StatsBar showing live TVL, vault count, and best 7d APY
|
@devwums is attempting to deploy a commit to the wumibals' projects Team on Vercel. A member of the Team first needs to authorize it. |
wumibals
approved these changes
Jun 25, 2026
wumibals
approved these changes
Jun 25, 2026
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Builds the data service layer connecting the frontend to live on-chain Soroban data, unblocking the dashboard, deposit, and analytics pages.
New files
services/rpc.ts - Soroban JSON-RPC client using native fetch; reads NEXT_PUBLIC_SOROBAN_RPC_URL env var
services/prices.ts - Fetches XLM and EURC prices from Stellar Horizon DEX order book API; 60s in-memory cache; exports fetchAssetPrices() and useAssetPrices() hook
hooks/usePosition.ts - Reads user shares, principal, accrued yield, and lock expiry per vault tier
hooks/useAllocations.ts - Reads AMM pool allocations from StrategyVault contract; polls every 30s
hooks/useTVL.ts - Reads total_shares from each vault and reverses the share multiplier (Flex 1.00x, L3 1.05x, L6 1.15x, L12 1.35x) to produce per-tier and aggregate TVL in USDC
hooks/useAPY.ts - Fetches harvest events from Harvester contract, sums yield over trailing 7d and 30d windows, annualises
components/StatsBar.tsx - Client component wiring useTVL and useAPY into a live stats bar
Updated files
app/page.tsx - Replaces the static placeholder with StatsBar showing live TVL, vault count, and best 7d APY
Notes
closes #44