Skip to content

fix: Refactor APR calculations to APY for Rezerve's lstRZR #2001

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 28, 2025

Conversation

drecronye
Copy link
Contributor

@drecronye drecronye commented Jul 18, 2025

Updated the calculation functions to use APR instead of APY for better accuracy. Introduced a new function to convert APR to APY. This change enhances the clarity and precision of the financial metrics in the rezerve-money adaptor.
@llamatester
Copy link

The rezerve-money adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 0.276 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬─────────────────┬──────────┬────────────────────┬──────────────────────────────────────────────────┬──────────────┬────────────────────┬───────────────────┬───────────┬───────────────────────────────┬──────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project         │ symbol   │ tvlUsd             │ underlyingTokens                                 │ rewardTokens │ apyBase            │ apyBase7d         │ apyReward │ poolMeta                      │ url                                      │
├─────────┼────────────────────────────────────────────────────┼─────────┼─────────────────┼──────────┼────────────────────┼──────────────────────────────────────────────────┼──────────────┼────────────────────┼───────────────────┼───────────┼───────────────────────────────┼──────────────────────────────────────────┤
│ 0       │ '0x67A298e5B65dB2b4616E05C3b455E017275f53cB-sonic' │ 'sonic' │ 'rezerve-money' │ 'lstRZR' │ 465330.07482892467 │ [ '0xb4444468e444f89e1c2cac2f1d3ee7e336cbd1f5' ] │ []           │ 399.18330698693404 │ 534.5355402437343 │ 0         │ 'Liquid Staked Rezerve.money' │ 'https://rezerve.money/stake?tab=vaults' │
└─────────┴────────────────────────────────────────────────────┴─────────┴─────────────────┴──────────┴────────────────────┴──────────────────────────────────────────────────┴──────────────┴────────────────────┴───────────────────┴───────────┴───────────────────────────────┴──────────────────────────────────────────┘

@drecronye drecronye marked this pull request as ready for review July 18, 2025 09:47
@drecronye drecronye changed the title Refactor APR calculations to APY for Rezerve's lstRZR fix: Refactor APR calculations to APY for Rezerve's lstRZR Jul 18, 2025
@llamatester
Copy link

The rezerve-money adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 0.31 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬─────────────────┬──────────┬───────────────────┬──────────────────────────────────────────────────┬──────────────┬───────────────────┬───────────────────┬───────────┬───────────────────────────────┬──────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project         │ symbol   │ tvlUsd            │ underlyingTokens                                 │ rewardTokens │ apyBase           │ apyBase7d         │ apyReward │ poolMeta                      │ url                                      │
├─────────┼────────────────────────────────────────────────────┼─────────┼─────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼──────────────┼───────────────────┼───────────────────┼───────────┼───────────────────────────────┼──────────────────────────────────────────┤
│ 0       │ '0x67A298e5B65dB2b4616E05C3b455E017275f53cB-sonic' │ 'sonic' │ 'rezerve-money' │ 'lstRZR' │ 577110.2521593837 │ [ '0xb4444468e444f89e1c2cac2f1d3ee7e336cbd1f5' ] │ []           │ 297.9650771878728 │ 373.1807621834829 │ 0         │ 'Liquid Staked Rezerve.money' │ 'https://rezerve.money/stake?tab=vaults' │
└─────────┴────────────────────────────────────────────────────┴─────────┴─────────────────┴──────────┴───────────────────┴──────────────────────────────────────────────────┴──────────────┴───────────────────┴───────────────────┴───────────┴───────────────────────────────┴──────────────────────────────────────────┘

@slasher125
Copy link
Collaborator

slasher125 commented Jul 21, 2025

@drecronye does the vault autocompound? yield seems off compared to ur UI

@llamatester
Copy link

The rezerve-money adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 0.298 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬─────────────────┬──────────┬───────────────────┬──────────────────────────────────────────────────┬──────────────┬────────────────────┬────────────────────┬───────────┬───────────────────────────────┬─────────────────────────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project         │ symbol   │ tvlUsd            │ underlyingTokens                                 │ rewardTokens │ apyBase            │ apyBase7d          │ apyReward │ poolMeta                      │ url                                                         │
├─────────┼────────────────────────────────────────────────────┼─────────┼─────────────────┼──────────┼───────────────────┼──────────────────────────────────────────────────┼──────────────┼────────────────────┼────────────────────┼───────────┼───────────────────────────────┼─────────────────────────────────────────────────────────────┤
│ 0       │ '0x67A298e5B65dB2b4616E05C3b455E017275f53cB-sonic' │ 'sonic' │ 'rezerve-money' │ 'lstRZR' │ 631981.5894788147 │ [ '0xb4444468e444f89e1c2cac2f1d3ee7e336cbd1f5' ] │ []           │ 228.12791230926751 │ 296.80768394052734 │ 0         │ 'Liquid Staked Rezerve.money' │ 'https://rezerve.money/liquid-staking?utm_source=defillama' │
└─────────┴────────────────────────────────────────────────────┴─────────┴─────────────────┴──────────┴───────────────────┴──────────────────────────────────────────────────┴──────────────┴────────────────────┴────────────────────┴───────────┴───────────────────────────────┴─────────────────────────────────────────────────────────────┘

@drecronye
Copy link
Contributor Author

drecronye commented Jul 25, 2025

@drecronye does the vault autocompound? yield seems off compared to ur UI

Hey @slasher125 our UI was actually wrong as well. And we got that fixed. It now matches close to what the adapter returns and also what Pendle/Spectra also reports

PFA the UI https://rezerve.money/liquid-staking

image

@llamatester
Copy link

The rezerve-money adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 11 passed, 11 total
Snapshots: 0 total
Time: 0.246 s
Ran all test suites.

Nb of pools: 1
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────┬─────────┬─────────────────┬──────────┬────────────────────┬──────────────────────────────────────────────────┬──────────────┬────────────────────┬────────────────────┬───────────┬───────────────────────────────┬─────────────────────────────────────────────────────────────┐
│ (index) │ pool                                               │ chain   │ project         │ symbol   │ tvlUsd             │ underlyingTokens                                 │ rewardTokens │ apyBase            │ apyBase7d          │ apyReward │ poolMeta                      │ url                                                         │
├─────────┼────────────────────────────────────────────────────┼─────────┼─────────────────┼──────────┼────────────────────┼──────────────────────────────────────────────────┼──────────────┼────────────────────┼────────────────────┼───────────┼───────────────────────────────┼─────────────────────────────────────────────────────────────┤
│ 0       │ '0x67A298e5B65dB2b4616E05C3b455E017275f53cB-sonic' │ 'sonic' │ 'rezerve-money' │ 'lstRZR' │ 1272486.9897874678 │ [ '0xb4444468e444f89e1c2cac2f1d3ee7e336cbd1f5' ] │ []           │ 216.41890587629703 │ 230.88545027930456 │ 0         │ 'Liquid Staked Rezerve.money' │ 'https://rezerve.money/liquid-staking?utm_source=defillama' │
└─────────┴────────────────────────────────────────────────────┴─────────┴─────────────────┴──────────┴────────────────────┴──────────────────────────────────────────────────┴──────────────┴────────────────────┴────────────────────┴───────────┴───────────────────────────────┴─────────────────────────────────────────────────────────────┘

@slasher125 slasher125 merged commit d00b702 into DefiLlama:master Jul 28, 2025
2 checks passed
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