Anchor-Protocol / Anchor-Protocol/anchor.js

APY calculation differs from webapp

Open
#67 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
46
Forks
38
PR merge metrics
No merged PRs in 30d

Description

The APY calculation in the webapp has been updated with `epoch_period`

(https://github.com/Anchor-Protocol/anchor-web-app/pull/353)

https://github.com/Anchor-Protocol/anchor-web-app/blob/d43ab70b8e85dfa144e506160d904d897fcbb27d/app/src/%40anchor-protocol/app-fns/logics/earn/computeApy.ts#L10

This logic is not replicated in `earn.getAPY`

https://github.com/Anchor-Protocol/anchor.js/blob/df76c7f9944094787c9ea5ebdb6e0a6d91ea976e/src/facade/earn/earn.ts#L83

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by comparing the linked webapp logic in app/src/@anchor-protocol/app-fns/logics/earn/computeApy.ts with earn.getAPY in src/facade/earn/earn.ts. Trace how epoch_period affects the calculation, then verify that the SDK result matches the webapp's APY behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
58/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.