-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Replace old API endpoint with NAVI Open API for vault TVL data #16122
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
base: main
Are you sure you want to change the base?
Conversation
Replace old API endpoint with NAVI Open API for vault TVL data
Update index.js
The adapter at projects/volo-vsui exports TVL:
|
Error while running adapter at projects/volo-vsui:
|
projects/volo-vsui/index.js
Outdated
|
||
async function getVaultTVL() { | ||
try { | ||
const response = await axios.get(`${naviApiURL}/api/volo/volo-vaults?type=tvl`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please use on chain data and our sui helper functions
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of our protocol’s design, we cannot compute TVL by reading objects directly, it must be derived from event emissions. This PR follows the same approach as Haedal vaults by fetching vault metadata from API and helper to aggregate balances. Please understand this is the only feasible way to calculate TVL on our protocol, and future changes can simply adjust the packageId or API endpoint without modifying on-chain logic. Thank you for understanding🙏
projects/volo-vsui/index.js
Outdated
console.error('Invalid response format from NAVI API:', response.data); | ||
return {}; | ||
} | ||
} catch (error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please no try catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
please fill the PR description |
and please test before maing a PR, see the CI errors |
Error while running adapter at projects/volo-vsui:
|
This PR fixes the TVL calculation precision issues in the volo-vsui adapter: