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 84d6a5c + a1de29f commit e3def72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/components/tst-staking/StakingRewardsList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,9 @@ const StakingRewardsList = ({
};

const rewardsWithPrices = rewardData.map(reward => {
const useAmount = ethers.formatUnits(reward.amount, reward.decimals);
const price = latestPrices[reward.asset] || 1; // Default to 1 for stablecoins
const usdValue = parseFloat(reward.amount) * price;
const usdValue = parseFloat(useAmount) * price;
return {
...reward,
usdValue: usdValue,
Expand All @@ -58,6 +59,7 @@ const StakingRewardsList = ({
noRewards = false;
}


return (
<Card className="card-compact w-full">
<div className="card-body">
Expand Down
3 changes: 2 additions & 1 deletion src/components/tst-staking/StakingSummary.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,9 @@ const StakingSummary = ({
}

const rewardsWithPrices = rewardsData.map(reward => {
const useAmount = ethers.formatUnits(reward.amount, reward.decimals);
const price = latestPrices[reward.asset] || 1; // Default to 1 for stablecoins
const usdValue = parseFloat(reward.amount) * price;
const usdValue = parseFloat(useAmount) * price;
return {
...reward,
usdValue: usdValue,
Expand Down

0 comments on commit e3def72

Please sign in to comment.