update to use kong and public RPCs#670
Open
rossgalloway wants to merge 1 commit into
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR migrates vault snapshot/price reads from legacy yDaemon usage to Kong’s REST snapshot endpoint and removes the legacy Alchemy mainnet RPC fallback in favor of Yearn public RPC overrides, aligning runtime configuration with public infrastructure.
Changes:
- Switch veYFI calculator vault pricing logic from yDaemon token price data to Kong vault snapshot-derived share price.
- Remove
ALCHEMY_API_KEYlegacy RPC fallback and document the new RPC override expectations. - Add
KONG_ENDPOINTconfiguration (defaulting to Yearn’s hosted Kong REST endpoint) and update env examples.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/ethereum/publicRpc.ts | Removes legacy Alchemy fallback logic so RPCs come only from explicit overrides or Yearn public RPC defaults. |
| src/components/veYFI-calculator/veYFI-calculator.tsx | Replaces yDaemon-based price fetch with Kong-based vault share price fetch. |
| src/components/veYFI-calculator/fetch.ts | Adds Kong snapshot fetching + computation of vault share USD price. |
| README.md | Updates configuration docs for Kong snapshots and removal of ALCHEMY_API_KEY. |
| docusaurus.config.js | Wires KONG_ENDPOINT into customFields with a default Kong REST host. |
| .env.example | Adds KONG_ENDPOINT example value. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+108
to
+118
| export async function fetchVaultSharePrice( | ||
| kongEndpoint: string, | ||
| address: string | ||
| ) { | ||
| const response = await fetch(`${kongEndpoint}/snapshot/1/${address}`) | ||
| if (!response.ok) { | ||
| console.error('Failed to fetch token price') | ||
| return null | ||
| console.error('Failed to fetch vault snapshot') | ||
| return undefined | ||
| } | ||
| const data = await response.json() | ||
| return data | ||
|
|
||
| const data = (await response.json()) as KongVaultSnapshot |
Comment on lines
+191
to
196
| const vaultSharePrice = await fetchVaultSharePrice( | ||
| kongEndpoint, | ||
| selectedGauge.underlyingVaultAddress | ||
| ) | ||
| const underlyingPrice = tokenPriceData?.tvl.price | ||
| const pricePerShare = tokenPriceData?.apr.pricePerShare.today | ||
| const vaultSharePrice = pricePerShare * underlyingPrice | ||
| setSelectedVaultSharePrice(vaultSharePrice) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
updates the code to use kong instead of yDaemon. mostly irrelevant as the pages using it are deprecated now, but if we add features that need vault data, now we have an easy path to get it.
updates the env to use the public yearn RPCs rather than my own alchemy account