From e900c04c88ef15f4577325b7ac6913d78eb5f870 Mon Sep 17 00:00:00 2001 From: zp6 <373669493@qq.com> Date: Fri, 15 May 2026 23:59:57 +0800 Subject: [PATCH] Add src/fixes/pool-metrics.md --- src/fixes/pool-metrics.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/fixes/pool-metrics.md diff --git a/src/fixes/pool-metrics.md b/src/fixes/pool-metrics.md new file mode 100644 index 0000000..9377189 --- /dev/null +++ b/src/fixes/pool-metrics.md @@ -0,0 +1,25 @@ +# Fix: Pool metrics are wrong / weird + +## Problem (Issue #6) +Pool performance metrics display incorrect or unexpected values. Common issues: +- Return percentage showing negative when pool is profitable +- APR calculation using wrong time period +- Total value locked not accounting for pending withdrawals + +## Root Cause +Pool metrics likely use inconsistent data sources: +- Historical returns calculated from spot prices vs TWAP +- APR annualized from short timeframes causing extreme values +- TVL not reflecting pending transactions + +## Solution +1. Use consistent price feeds for all calculations +2. Annualize APR using minimum 7-day average +3. Exclude pending withdrawals from TVL +4. Add null/loading states for missing data + +## Implementation +- Review pool metric calculation functions +- Ensure consistent data fetching (same API endpoint) +- Add proper number formatting (toLocaleString, toFixed) +- Handle edge cases (division by zero, null values)