Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): rewards column in ValidatorTable is sortable #249

Merged
merged 7 commits into from
Jul 23, 2024
Merged

Conversation

drichar
Copy link
Contributor

@drichar drichar commented Jul 19, 2024

This adds some additional fetching logic to fetchValidator that runs when the app mounts, so the rewards column in ValidatorTable is sortable. It leaves the queries that were already happening inside the ValidatorRewards component, so the data can be refetched every 30s without triggering all the other refetches from fetchValidator.

The validator metrics being fetched inside fetchValidator has been refactored to:

  1. reduce the number of duplicate fetches and
  2. combine all metrics that are calculated by iterating over a validator's pools (rewards balance, "health" status based on epoch payouts, and average APY)

A new TrafficLight component is created to handle both cases where we show a traffic-light style indicator (validator "health" and stake saturation). There is an option to hide the indicator if the status is green/normal, which is set to true in both places.

Finally, TXN-1742 is addressed here as well. The average APY calculation now excludes pools with zero balance.

Copy link

vercel bot commented Jul 19, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
reti ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 23, 2024 8:08pm

Also moves the function to `src/utils/contracts.ts` and the PoolData type to `src/interfaces/validator.ts`
@drichar drichar merged commit 90b261a into dev Jul 23, 2024
3 checks passed
@drichar drichar deleted the feat/txn-1741 branch July 23, 2024 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant