pendulum-chain / portal

The Pendulum/Amplitude portal UI
GNU General Public License v3.0
1 stars 1 forks source link

Show 24h and 7d APR on the swap pools UI #590

Open prayagd opened 3 weeks ago

prayagd commented 3 weeks ago

Context

Currently there is only 7d APR shown on the swap pools screen, this ticket is to show both 24h and 7d APR

Todo

Note

Screenshot 2024-10-04 at 5 31 31 PM
prayagd commented 3 weeks ago

Hey team! Please add your planning poker estimate with Zenhub @ebma @Sharqiewicz @TorstenStueber

ebma commented 3 weeks ago

The indexer currently only exposes a general apr field. If we want to split this into 24h and 7d, we'd need to touch the indexer first.

TorstenStueber commented 2 weeks ago

@prayagd What is the definition of a 24 hour and a 7 day APR? It's an oxymoron, isn't it as APR is an annual rate?

Anyway, whatever that means. We calculate the APR extrapolated from the gains within the last seven days.

prayagd commented 2 weeks ago

We calculate the APR extrapolated from the gains within the last seven days.

What we are extrapolating using APR for 7 days we want to do the same for 24h

prayagd commented 2 weeks ago

What we are extrapolating using APR for 7 days we want to do the same for 24h

Even for doing this we need to make changes to the indexer?

ebma commented 2 weeks ago

Well the apr field is currently exposed by the indexer. And the nabla team also gets it from their indexer, so I think it makes most sense to do this. I found the relevant lines of code that describe the calculation they do for the 24h and 7d apr here. So IMO we should add similar changes to our indexer and then access those fields in the portal. Thus we'd need one extra ticket in pendulum-squids.

TorstenStueber commented 2 weeks ago

Okay, understood. But is this high priority for us? I would consider it more a nice to have – we don't need to copy every aspects of the Nabla UI at this stage of the project.

prayagd commented 1 week ago

Okay, understood. But is this high priority for us?

Not a high priority, good to have in the backlog

ebma commented 1 week ago

@pendulum-chain/product as I pointed out, this ticket requires changes to the indexer before it can be worked on. I created the ticket https://github.com/pendulum-chain/pendulum-squids/issues/74 for you, please prioritize it accordingly.