Skip to content
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

Calculate and expose APR for 24h and 7d in indexer #74

Open
ebma opened this issue Oct 18, 2024 · 6 comments
Open

Calculate and expose APR for 24h and 7d in indexer #74

ebma opened this issue Oct 18, 2024 · 6 comments
Assignees

Comments

@ebma
Copy link
Member

ebma commented Oct 18, 2024

Context

The portal should show the APR for 24h and 7d in the swap pool info table, see pendulum-chain/portal#590. These fields should be exposed by the indexer instead of calculating them in the frontend.

TODO

Check the calculation of the APR on the indexer of the Nabla team here and apply the same similar calculations to the pendulum indexers.

So we would then have:

  • Rename apr to apr7d
  • apr7d -> (total average fees last 7 days) / (total liability)
  • apr24h -> (total average fees last 24 hours) / (total liability)
@prayagd
Copy link
Contributor

prayagd commented Oct 22, 2024

Hey team! Please add your planning poker estimate with Zenhub @b-yap @ebma @gianfra-t @TorstenStueber

@prayagd
Copy link
Contributor

prayagd commented Oct 22, 2024

Thank you for creating this ticket @ebma

@TorstenStueber
Copy link
Contributor

I want to point out that the formula used by the Nabla team calculates the APR as follows:

  • (total average fees per year) / (total supply)

Where total supply is the number of minted LP pool tokens. This is also the formula we are using at the moment.

However, we argued in this message and the one after that a more appropriate formula would be:

  • (total average fees per year) / (total liability)

@pendulum-chain/product shall we change this as well in this ticket here?

@ebma
Copy link
Member Author

ebma commented Nov 4, 2024

Makes sense. So we would then have:

  • apr -> (total average fees per year) / (total liability)
  • apr7d -> (total average fees last 7 days) / (total liability)
  • apr24h -> (total average fees last 24 hours) / (total liability)

right?

@TorstenStueber
Copy link
Contributor

We would only have the apr7d and apr24h, correct? (the Nabla team basically defines apr as a synonym of apr7d).

@ebma
Copy link
Member Author

ebma commented Nov 4, 2024

Right. I changed the description of this ticket accordingly.

@ebma ebma self-assigned this Nov 5, 2024
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

When branches are created from issues, their pull requests are automatically linked.

3 participants