Skip to content

Update curve and convex forward APY calcs and fix APR to APY - #556

Merged
rossgalloway merged 3 commits into
mainfrom
fix-v2-forward-APY-calcs
Jan 8, 2026
Merged

Update curve and convex forward APY calcs and fix APR to APY#556
rossgalloway merged 3 commits into
mainfrom
fix-v2-forward-APY-calcs

Conversation

@rossgalloway

@rossgalloway rossgalloway commented Jan 8, 2026

Copy link
Copy Markdown
Collaborator

Description

  • Removed lines adding Curve and Convex pool APRs to APR value that gets used to calculate fees (we can't take fees from it) and moved it after the fees are removed.
  • Fixed APR→APY conversion to treat APR values as decimals (e.g. 0.56 for 56%), eliminating the 100x scaling error.
  • (dudesahn) remove extra compounding for curve and convex helper files

Why

  • The existing APY calculation assumed we take fees from curve pool rewards, but we don't.
  • The existing APR→APY helper assumed percent inputs, which caused compounding to be understated by ~2 orders of magnitude for decimal APR inputs seen in APY calculations.

Changes

  • processes/apr/forward.curve.go: remove curve pool APY from pre-fee sums.
  • processes/apr/forward.convex.go: remove convex pool APY from pre-fee sums.
  • processes/apr/helpers.go: convertFloatAPRToAPY now composes directly on decimal APR and no longer divides/multiplies by 100.

Notes

  • Audited all call sites of convertFloatAPRToAPY in processes/apr/; each caller already supplies decimal APRs (Frax min rewards is explicitly divided by 100 before conversion), so no call‑site changes were required.

Testing

  • Run yDaemon and confirmed corrected APYs.
  • good vault to check with is 0x0844C227b892be5d7c837000C096f64bFc316c2d

* fix: remove extra convex compounding

* fix: remove extra compounding from curve helper

@murderteeth murderteeth left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lg. i noticed a temporary trace file that i assume was created for debugging. note you can also interactively debug ydaemon, much better dx. there's info here https://github.com/yearn/ydaemon?tab=readme-ov-file#how-to-use-a-real-debugger-

@rossgalloway
rossgalloway merged commit daca2f5 into main Jan 8, 2026
2 checks passed
@rossgalloway
rossgalloway deleted the fix-v2-forward-APY-calcs branch January 8, 2026 18:31
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.

3 participants