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

Historical Earn APY displayed incorrectly #171

Open
davordavidovic opened this issue Sep 12, 2021 · 1 comment
Open

Historical Earn APY displayed incorrectly #171

davordavidovic opened this issue Sep 12, 2021 · 1 comment

Comments

@davordavidovic
Copy link

Problem
The historical APY in the Earn interest section shows today's date (eg: Sep 12, 2021) on all slider values. Looking at the network tab I can see these values fetched from the https://mantle.anchorprotocol.com/?earn--apy-history endpoint.

{
    "apyHistory": [
        {
            "DepositRate": "0.000000041816843557",
            "Height": 4498946,
            "Timestamp": 1631452797
        },
        {
            "DepositRate": "0.000000041816843557",
            "Height": 4498424,
            "Timestamp": 1631449190
        },
        {
            "DepositRate": "0.000000041833331018",
            "Height": 4497901,
            "Timestamp": 1631445583
        },
        {
            "DepositRate": "0.000000041833331018",
            "Height": 4497379,
            "Timestamp": 1631441980
        },
        {
            "DepositRate": "0.000000041833331018",
            "Height": 4496858,
            "Timestamp": 1631438377
        },
        {
            "DepositRate": "0.000000041833331018",
            "Height": 4496335,
            "Timestamp": 1631434775
        },
        {
            "DepositRate": "0.000000041637400716",
            "Height": 4495810,
            "Timestamp": 1631431173
        },
        {
            "DepositRate": "0.000000041637400716",
            "Height": 4495287,
            "Timestamp": 1631427571
        },
        {
            "DepositRate": "0.000000041637400716",
            "Height": 4494764,
            "Timestamp": 1631423966
        }
    ]
}

Parsing the timestamps using new Date(timestamp * 1000) as done in the InterestSection.tsx I get that the timestamps are from today's date, each an hour apart.

Proposed solution
If possible the values fetched should be from previous days and not hours. Otherwise, the time should also be included in the slider label (eg: 13h, Sep 12, 2021). Ideally a larger historical view is shown (past 50, 100 or 1000 days).

@kjessec
Copy link
Contributor

kjessec commented Sep 13, 2021

We're working to solve this. This needs support from the backend where APY snapshot is taken every hour. We have the code for it but didn't implement it on the webapp front due to other tasks being of higher priority.

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

No branches or pull requests

2 participants