โž•LP real APY calculation

The 7d Real APY as displayed on the Swap page shows how profitable providing liquidity has been the last 7 days, compared to just holding both tokens.

7_day_real_apy = ((lp_valuation_now / lp_valuation_7_days_ago)^(365 / 7) - 1) * 100;

With lp_valuation_now being the value of 1 LPSTAB token currently.

And lp_valuation_7_days_ago being the value of 1 LPSTAB token 7 days ago WITH CURRENT STAB and XRD PRICES!

Because for both valuations the current asset prices are used, it makes for a fair comparison between holding and providing liquidity.

Last updated