Skip to content

Commit

Permalink
fix(neuron-ui): fix the apy calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Nov 12, 2019
1 parent 8847aec commit 03c88d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,7 @@ const DAORecord = ({
</div>
</div>
<div className={styles.secondaryInfo}>
<span>
{`APY: ~${calculateAPY(
interest >= BigInt(0) ? interest.toString() : '0',
capacity,
`${Date.now() - +timestamp}`
)}%`}
</span>
<span>{`APY: ~${calculateAPY(interest.toString(), capacity, `${Date.now() - +timestamp}`)}%`}</span>
<span>{uniformTimeFormatter(+timestamp)}</span>
<span>{metaInfo}</span>
</div>
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/utils/calculateAPY.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const YEAR = 365 * 30 * 24 * 60 * 60 * 1000
const YEAR = 365 * 24 * 60 * 60 * 1000

export default (interest: string, amount: string, duration: string) => {
const BASE = 10000
Expand Down

0 comments on commit 03c88d2

Please sign in to comment.