Skip to content

Commit

Permalink
Merge branch '202411-staking-yield' of github.com:the-standard/decent…
Browse files Browse the repository at this point in the history
…ralised-dashboard-fork into beta
  • Loading branch information
ZakMooney committed Nov 8, 2024
2 parents 05de017 + 13b9bf7 commit 8dc192c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/tst-staking/StakingSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,14 @@ const StakingSummary = ({
function getDaysStaked() {
const start = moment.unix((Number(rawStakedSince)));
const today = moment();
const testSince = start.diff(today, 'days')+1;
return testSince;
const since = today.diff(start, 'days');
return since;
}

const calculateSimpleAPY = (stakedAmount, totalRewardsValue, daysStaked) => {
const dailyEarnings = totalRewardsValue / daysStaked;
const annualEarningsPerTST = (dailyEarnings * 365) / stakedAmount;
// console.log(123123, stakedAmount, totalRewardsValue, daysStaked)
return annualEarningsPerTST * 100;
}

Expand Down

0 comments on commit 8dc192c

Please sign in to comment.