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(hermes): create latest TWAP endpoint #2126

Closed
wants to merge 2 commits into from
Closed

Conversation

tejasbadadare
Copy link
Contributor

@tejasbadadare tejasbadadare commented Nov 18, 2024

Purpose

  • Create Hermes endpoint at /v2/updates/twap/:window_seconds/latest/ to get the latest TWAP prices for a list of price IDs with a dynamic time window (default 300s/5m).

Testing

  • [WIP] Creating test suite, will request re-review when ready.

Next up

  • Next PR will include an endpoint for fetching historical TWAP given a publish_time.
  • Future PR will include functionality to fallback to Benchmarks if the required price updates aren't present in the cache (for TWAPs longer than ~15m.)
  • Future PR will add these features to the Solana receiver contract.

Copy link

vercel bot commented Nov 18, 2024

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

Name Status Preview Comments Updated (UTC)
api-reference ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 6:56pm
proposals ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 6:56pm
staking ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 18, 2024 6:56pm
2 Skipped Deployments
Name Status Preview Comments Updated (UTC)
component-library ⬜️ Ignored (Inspect) Nov 18, 2024 6:56pm
insights ⬜️ Ignored (Inspect) Nov 18, 2024 6:56pm

pub struct PriceFeedTwap {
pub id: PriceIdentifier,
pub twap_price: Price,
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

we probably need down_slots as well right?

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.

2 participants