Skip to content

Commit 03c88d2

Browse files
committed
fix(neuron-ui): fix the apy calculation
1 parent 8847aec commit 03c88d2

2 files changed

Lines changed: 2 additions & 8 deletions

File tree

packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,7 @@ const DAORecord = ({
134134
</div>
135135
</div>
136136
<div className={styles.secondaryInfo}>
137-
<span>
138-
{`APY: ~${calculateAPY(
139-
interest >= BigInt(0) ? interest.toString() : '0',
140-
capacity,
141-
`${Date.now() - +timestamp}`
142-
)}%`}
143-
</span>
137+
<span>{`APY: ~${calculateAPY(interest.toString(), capacity, `${Date.now() - +timestamp}`)}%`}</span>
144138
<span>{uniformTimeFormatter(+timestamp)}</span>
145139
<span>{metaInfo}</span>
146140
</div>

packages/neuron-ui/src/utils/calculateAPY.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const YEAR = 365 * 30 * 24 * 60 * 60 * 1000
1+
const YEAR = 365 * 24 * 60 * 60 * 1000
22

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

0 commit comments

Comments
 (0)