Skip to content

harmonix-finance: price each hyperevm vault by its own currency instead of one pyth feed - #3274

Merged
0xkr3p merged 2 commits into
DefiLlama:masterfrom
0xshubhs:harmonix-hyperevm-pricing
Nov 28, 2026
Merged

0xkr3p merged 2 commits into
DefiLlama:masterfrom
0xshubhs:harmonix-hyperevm-pricing

Conversation

@0xshubhs

@0xshubhs 0xshubhs commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #3273

The chainId === 'hyperliquid' branch read one Pyth feed and multiplied every vault's tvl by it,
whatever the vault held, which is why all three Hyperliquid pools published the same implied price of
$65.2563 and a 167,869 USDC vault came out at $10.95m. This prices v.tvl by the vault's own
vault_currency, through assets.hyperliquid, which is what the other chains' branch already does. The
hand-rolled ethers provider and the feed id go with it.

pool before after why
USDC 0x1D5D9E73... 10,954,520 167,842 167,869.0642 USDC at $0.9998 instead of at $65.26
KHYPE 0x1368ee9d... 3,484,662 3,311,971 53,399.5963 kHYPE at kHYPE's own $62.02
HYPE 0xfde5b062... 618,247 572,885 9,474.1282 HYPE at $60.47, coins instead of the Pyth read
Arbitrum USDC x2 425,631 425,631 untouched branch
total 15,483,060 4,478,329

The control is the other repo: DefiLlama-Adapters' TVL for the protocol reads Hyperliquid L1
$4,102,909 and Arbitrum $436,638 against the $4,052,698 and $425,631 here, both inside the price
timing, where before the merge the Hyperliquid side disagreed by $11.0m.

testing

npm run test --adapter=harmonix-finance, twice, 41 tests passed both times and the two runs differ
only by the price refresh ($167,840.29 then $167,841.97):

Test Suites: 1 passed, 1 total
Tests:       41 passed, 41 total
Nb of pools: 5

  { pool: '0x1368ee9d...', chain: 'hyperliquid', symbol: 'KHYPE', tvlUsd: 3311971.2793484083 }
  { pool: '0xfde5b062...', chain: 'hyperliquid', symbol: 'HYPE',  tvlUsd: 572884.9708536329 }
  { pool: '0x1D5D9E73...', chain: 'hyperliquid', symbol: 'USDC',  tvlUsd: 167841.96851675812 }
  { pool: '0xF12F8753...', chain: 'arbitrum',    symbol: 'USDC',  tvlUsd: 408849.378235 }
  { pool: '0x4a10C31b...', chain: 'arbitrum',    symbol: 'USDC',  tvlUsd: 16781.711784 }

The two throws are deliberate: a vault currency with no address in assets.hyperliquid, or a token
coins does not price, should stop the pool rather than publish a figure priced off something else.

Summary by CodeRabbit

  • Bug Fixes
    • Hyperliquid vault USD TVL now reflects the vault token’s current price, improving displayed valuations as prices change. TVL can’t be calculated if the token isn’t recognized or its price is unavailable.
    • A vault that fails to load no longer prevents other vault results from being displayed; unavailable vaults are omitted.

@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

No actionable comments were generated in the recent review.

Walkthrough

The Hyperliquid pricing path now uses each vault currency’s mapped token address and current price. Missing addresses or prices raise errors. Vault requests use Promise.allSettled; the adapter logs and omits rejected results.

Changes: Hyperliquid vault pricing

Layer / File(s) Summary
Vault-currency pricing and result handling
src/adaptors/harmonix-finance/index.js
The Hyperliquid branch looks up the vault currency’s address in the asset map and requests its current price through the price API. It calculates USD TVL as v.tvl * tokenPrice and raises errors if the address or price is missing. The adapter logs rejected vault requests and omits them while retaining fulfilled results. The prior ethers-based price-feed lookup was removed.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: vinhpad, 0xkr3p

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: Hyperliquid vault pricing switches from one shared Pyth feed to each vault's own currency. The raw summary confirms this. The code now looks up the vault currency in t…
Linked Issues check Passed Issue #3273 requires that each Hyperliquid vault's tvl be priced by its own vault_currency, using the address in assets.hyperliquid, and that the hand-rolled ethers provider and Pyth feed be removed. …
Out of Scope Changes check Passed The whole-PR diff against the merge base 96aa952 touches only src/adaptors/harmonix-finance/index.js. Every hunk is part of the issue #3273 fix: the hyperliquid pricing branch replacement and the remo…
Full details: Title check

Explanation

The title names the main change: Hyperliquid vault pricing switches from one shared Pyth feed to each vault's own currency. The raw summary confirms this. The code now looks up the vault currency in the hyperliquid asset map, fetches its price through the shared price API, and computes TVL as tvl times token price. The title is specific, one sentence, and free of file lists or vague terms. It names the adaptor and the vault-specific pricing. Only the title's wording on the Pyth removal is slightly less prominent, but it is still covered.

Full details: Linked Issues check

Explanation

Issue #3273 requires that each Hyperliquid vault's tvl be priced by its own vault_currency, using the address in assets.hyperliquid, and that the hand-rolled ethers provider and Pyth feed be removed. The diff to src/adaptors/harmonix-finance/index.js at the reviewed head does this. The hyperliquid branch now resolves assets[chainId][v.vault_currency.toLowerCase()] (hype, khype, usdc are all mapped), requests /prices/current/hyperliquid:<address> through utils.getPriceApiUrl, and sets tvlUsd = v.tvl * tokenPrice. The ethers require, the JsonRpcProvider, the contract address 0xe9d69..., and the feed id 0x4279e... are removed. No ethers reference remains in the file. The non-hyperliquid branch is unchanged. The issue requires no automated test additions, and none are required by its stated objectives. The PR's reported test runs are not independently verified here, but no coding requirement depends on them.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base 96aa952 touches only src/adaptors/harmonix-finance/index.js. Every hunk is part of the issue #3273 fix: the hyperliquid pricing branch replacement and the removal of the now-unused ethers import. The two new throws (missing vault_currency address in assets.hyperliquid, missing coins price) are the error handling the PR description explains and do not add unrelated behavior. No unrelated changes were found.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1286b157-bc09-4409-a860-39b9f1d5770d
Commits

Reviewing files that changed from the base of the PR and between 96aa952 and 6909a3d.

Files selected for processing: 1

  • src/adaptors/harmonix-finance/index.js

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

@github-actions

Copy link
Copy Markdown

The harmonix-finance adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 41 passed, 41 total
Snapshots: 0 total
Time: 0.203 s
Ran all test suites.

Nb of pools: 5
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬───────────────┬────────────────────┬─────────┬────────────────────┬────────────────────┬───────────┬──────────────┬────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │ pool                                         │ chain         │ project            │ symbol  │ tvlUsd             │ apyBase            │ apyReward │ rewardTokens │ url                                                                    │ underlyingTokens                                 │
├─────────┼──────────────────────────────────────────────┼───────────────┼────────────────────┼─────────┼────────────────────┼────────────────────┼───────────┼──────────────┼────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│ 0       │ '0x1368ee9d1212ae5b26ff166049220051a9eebc42' │ 'hyperliquid' │ 'harmonix-finance' │ 'KHYPE' │ 3311971.2793484083 │ 2.8547159382640968 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hyperevm-khype-v1'                     │ [ '0xfD739d4e423301CE9385c1fb8850539D657C296D' ] │
│ 1       │ '0xfde5b0626fc80e36885e2fa9cd5ad9d7768d725c' │ 'hyperliquid' │ 'harmonix-finance' │ 'HYPE'  │ 571888.6568400048  │ 2.2276622224121745 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hyperevm-delta-neutral-hype-v3'        │ [ '0x5555555555555555555555555555555555555555' ] │
│ 2       │ '0xF12F8753C25F8005311a24bbbA1f7209249B00e3' │ 'arbitrum'    │ 'harmonix-finance' │ 'USDC'  │ 408849.378235      │ 5.1972848019602225 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hype-delta-neutral-v1'                 │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │
│ 3       │ '0x1D5D9E73f8219fB4396a9060C49c155dA0D65066' │ 'hyperliquid' │ 'harmonix-finance' │ 'USDC'  │ 167843.64907074682 │ 5.7320506812083005 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hip3-usdc-vault'                       │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │
│ 4       │ '0x4a10C31b642866d3A3Df2268cEcD2c5B14600523' │ 'arbitrum'    │ 'harmonix-finance' │ 'USDC'  │ 16781.711784       │ 0.1857425414385716 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/kelpdao-restaking-delta-neutral-vault' │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │
└─────────┴──────────────────────────────────────────────┴───────────────┴────────────────────┴─────────┴────────────────────┴────────────────────┴───────────┴──────────────┴────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┘

A vault whose currency is unmapped, has no coins.llama.fi price, or whose
tvl call fails now drops out on its own; the other vaults still publish.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown

The harmonix-finance adapter exports pools:

Test Suites: 1 passed, 1 total
Tests: 41 passed, 41 total
Snapshots: 0 total
Time: 0.269 s
Ran all test suites.

Nb of pools: 5
 

Sample pools:
┌─────────┬──────────────────────────────────────────────┬───────────────┬────────────────────┬─────────┬────────────────────┬────────────────────┬───────────┬──────────────┬────────────────────────────────────────────────────────────────────────┬──────────────────────────────────────────────────┐
│ (index) │ pool                                         │ chain         │ project            │ symbol  │ tvlUsd             │ apyBase            │ apyReward │ rewardTokens │ url                                                                    │ underlyingTokens                                 │
├─────────┼──────────────────────────────────────────────┼───────────────┼────────────────────┼─────────┼────────────────────┼────────────────────┼───────────┼──────────────┼────────────────────────────────────────────────────────────────────────┼──────────────────────────────────────────────────┤
│ 0       │ '0x1368ee9d1212ae5b26ff166049220051a9eebc42' │ 'hyperliquid' │ 'harmonix-finance' │ 'KHYPE' │ 3429424.1261555334 │ 2.8547159382640968 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hyperevm-khype-v1'                     │ [ '0xfD739d4e423301CE9385c1fb8850539D657C296D' ] │
│ 1       │ '0xfde5b0626fc80e36885e2fa9cd5ad9d7768d725c' │ 'hyperliquid' │ 'harmonix-finance' │ 'HYPE'  │ 591724.9879921032  │ 2.2276622224121745 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hyperevm-delta-neutral-hype-v3'        │ [ '0x5555555555555555555555555555555555555555' ] │
│ 2       │ '0xF12F8753C25F8005311a24bbbA1f7209249B00e3' │ 'arbitrum'    │ 'harmonix-finance' │ 'USDC'  │ 408837.556425      │ 4.854080752396173  │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hype-delta-neutral-v1'                 │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │
│ 3       │ '0x1D5D9E73f8219fB4396a9060C49c155dA0D65066' │ 'hyperliquid' │ 'harmonix-finance' │ 'USDC'  │ 167839.5843060129  │ 5.7464484292742535 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/hip3-usdc-vault'                       │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │
│ 4       │ '0x4a10C31b642866d3A3Df2268cEcD2c5B14600523' │ 'arbitrum'    │ 'harmonix-finance' │ 'USDC'  │ 16781.711784       │ 0.1857425414385716 │ 0         │ []           │ 'https://app.harmonix.fi/vaults/kelpdao-restaking-delta-neutral-vault' │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │
└─────────┴──────────────────────────────────────────────┴───────────────┴────────────────────┴─────────┴────────────────────┴────────────────────┴───────────┴──────────────┴────────────────────────────────────────────────────────────────────────┴──────────────────────────────────────────────────┘

@0xkr3p 0xkr3p left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

great pr thank you @0xshubhs

@0xkr3p
0xkr3p merged commit da8bbd3 into DefiLlama:master Nov 28, 2026
2 of 3 checks passed
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.

harmonix-finance: all three Hyperliquid vaults are priced with one token price, so a 167,869 USDC vault publishes $10.95m

2 participants