Skip to content

chore(price-feed): added update parameters as a column in each table for EVM #739

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

Merged
merged 10 commits into from
Jul 14, 2025

Conversation

nidhi-singh02
Copy link
Contributor

@nidhi-singh02 nidhi-singh02 commented Jul 10, 2025

Description

Earlier the update parameters were mentioned at the top for each of the chain, which was not easy to refer if you are at a particular asset in the list and the table is large.
Added a new column for "Update parameters" makes it easy for developers to access it readily.

  • Came up with a new approach for Update parameters as most of the values were same. Wanted to add a column to keep the design consistent, but don't want user to spend lot of time trying to figure out the update parameters.
  • If there are different values, it is shown at the top of each list with different color coding.
  • If values are same, instead of filling same values in each row, we are writing "Same as above".
  • In case, the table is big, fixed the first item in each table to refer the value from.
  • Scroll bar to check all the assets.
  • Added a copy button next to each Price Feed ID

Type of Change

  • New Page
  • Page update/improvement
  • Fix typo/grammar
  • Restructure/reorganize content
  • Update links/references
  • Other (please describe):

Areas Affected

This page is being modified https://docs.pyth.network/price-feeds/sponsored-feeds/evm

Checklist

  • I ran pre-commit run --all-files to check for linting errors
  • I have reviewed my changes for clarity and accuracy
  • All links are valid and working
  • Images (if any) are properly formatted and include alt text
  • Code examples (if any) are complete and functional
  • Content follows the established style guide
  • Changes are properly formatted in Markdown
  • Preview renders correctly in development environment

Related Issues

Closes #

Additional Notes

Contributor Information

  • Name:
  • Email:

Screenshots

image

Updated one:
Screenshot 2025-07-14 at 3 26 16 PM

Copy link

vercel bot commented Jul 10, 2025

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

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2025 2:58pm
documentation ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 14, 2025 2:58pm

Comment on lines -19 to -21
Update Parameters for BOLD: **1 hour heartbeat or 0.5% price deviation**

Update Parameters for the other assets: **1 hour heartbeat or 2% price deviation**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is redundant now and can be removed. Same applies to other places in the file.

Signed-off-by: nidhi-singh02 <[email protected]>
Copy link
Contributor

@cprussin cprussin left a comment

Choose a reason for hiding this comment

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

important stuff LGTM, mostly nits / minor suggestions that I think may make the code a bit easier to maintain

Comment on lines 29 to 32
const paramCounts = feeds.reduce((acc, feed) => {
acc[feed.updateParameters] = (acc[feed.updateParameters] || 0) + 1;
return acc;
}, {} as Record<string, number>);
Copy link
Contributor

Choose a reason for hiding this comment

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

Super minor nit but I tend to find this kind of thing is more easy to understand when implemented as:

const paramCounts = Object.fromEntries(
  Object
    .entries(Object.groupBy(feeds, feed => feed.updateParameters))
    .map(([updateParameters, feeds]) => [updateParameters, feeds.length])
)

I will also typically create a mapValues helper (which really should be in the ES standard IMO and probably will be eventually) which I use all the time and makes the code more concise:

const paramCounts = mapValues(
  Object.groupBy(feeds, feed => feed.updateParameters)),
  feeds => feeds.length
)

For some reason, reduce seems to be a hard operation for a lot of folks to easily grok so I've started to move away from using it except in very specific scenarios. Here is a decent writeup for an eslint rule that I use nowadays that has some links to some threads on the topic.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Interesting, I have created a utility file for object called "ObjectHelpers" in the utils folder so can be used across.
I will see to add a linter rule as well, good idea and thanks for sharing the reference that really helps.
for ensuring Object.groupBy can be used, had to increase the typescript version as it was not present in older versions.

Copy link
Contributor

Choose a reason for hiding this comment

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

For what it's worth, I maintain canned eslint and typescript configs which we use across most node packages here, and I try to keep things in the main monorepo up to date, which applies to a pretty large bulk of our Node work. However, this docs repo is just an old repo and we've been planning to replace the docs app for a long time, so it's in a bit of a weird state.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Perfect! Thanks a lot for sharing this. Yeah, I will import these config in my local and gonna make sure if we have these same config applicable to this documentation repo.

Signed-off-by: nidhi-singh02 <[email protected]>
@nidhi-singh02 nidhi-singh02 merged commit b1ff9e7 into main Jul 14, 2025
5 checks passed
@nidhi-singh02 nidhi-singh02 deleted the sponsored-feeds-evm-update branch July 14, 2025 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants