Skip to content

Commit

Permalink
dont calc graph if there are no events (#342)
Browse files Browse the repository at this point in the history
Co-authored-by: Mark Vujevits <[email protected]>
  • Loading branch information
kyriediculous and vmaark authored Nov 18, 2022
1 parent 706b318 commit 03efa0a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/shared/src/calculateAPY.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const calculateAPY = (data: Queries.TenderizerDaysType | undefined): Reco
const rewardsClaimedEvents = tenderizerData.rewardsClaimedEvents.filter((item) => item.rewards !== "0");
let totalTimePassed = 0;

if (staker.name === "graph") {
if (staker.name === "graph" && rewardsClaimedEvents.length > 0) {
const start = rewardsClaimedEvents[0].timestamp;
const end = rewardsClaimedEvents[rewardsClaimedEvents.length - 1].timestamp;
const rewards = rewardsClaimedEvents.reduce((prev, curr) => {
Expand Down

2 comments on commit 03efa0a

@vercel
Copy link

@vercel vercel bot commented on 03efa0a Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

tender-app – ./packages/app

tender-app-git-master-tenderize.vercel.app
tender-app-tenderize.vercel.app
app.tenderize.me

@vercel
Copy link

@vercel vercel bot commented on 03efa0a Nov 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.