Skip to content

Implement multi-pool dashboard view — aggregate credits, total stake, and APY across all user positions #43

Description

@prodbycorne

Problem

The farm page renders each pool position as an independent row with no summary. A user farming across three pools must mentally add up their credits and stakes. There is no at-a-glance view of total portfolio value or portfolio-level daily rate.

useAllUserPositions is already defined in useSorobanQuery.ts and fetches all positions in parallel, but the farm page never shows aggregated values from this hook.

Acceptance Criteria

  • A <FarmSummaryBar> component renders above the pool rows showing:
    • Total Stake across all pools (sum of lockedAmount converted to XLM equivalent for display)
    • Total Credits Earned (sum of live-ticking credit values from useLiveCredits per pool)
    • Portfolio Daily Rate (sum of per-pool dailyRate × lockedAmount)
    • Estimated APY — formula: (totalDailyRate / totalStake) × 365 × 100 formatted as a percentage
  • APY is marked with an asterisk and a tooltip: "Estimated based on current rates. Subject to change as TVL fluctuates."
  • The summary bar is hidden when useAllUserPositions returns all zero-stake positions
  • The summary bar's credit counter also live-ticks using the aggregate of all per-pool useLiveCredits values
  • A Vitest snapshot test renders <FarmSummaryBar> with two mock positions and verifies the aggregated values in the output

Relevant Files

Metadata

Metadata

Labels

Official CampaignCampaign: Official CampaignfarmFarming/staking flow — deposit, lock, unlock, creditshardRequires deep domain knowledge — Soroban, Stellar SDK, or complex statesorobanSoroban smart-contract integration (XDR, RPC, transaction building)uxUser experience, interaction design, loading states

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions