feat: add Stratium TVL adapter on Hyperliquid#18698
feat: add Stratium TVL adapter on Hyperliquid#18698yashj09 wants to merge 3 commits intoDefiLlama:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdded a new TVL adapter for the Changes
Sequence DiagramsequenceDiagram
participant TVL as TVL Module
participant SDK as SDK / EVM API
participant RPC as HyperCore RPC
participant Registry as TVL Registry
TVL->>SDK: getBalance(STAKING_VAULT) on hyperliquid
SDK-->>TVL: evmBalance
TVL->>RPC: POST /info { type: "delegatorSummary", user: STAKING_VAULT } (10s timeout)
RPC-->>TVL: { delegated, undelegated, totalPendingWithdrawal }
TVL->>TVL: validate fields are decimal strings
TVL->>TVL: parse values to 18-decimal units
TVL->>TVL: hypercoreManagedHype = delegated + undelegated - totalPendingWithdrawal
TVL->>TVL: totalTVL = BigInt(evmBalance) + hypercoreManagedHype
TVL->>Registry: addGasToken(totalTVL)
Registry-->>TVL: confirmation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
The adapter at projects/stratium exports TVL: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@projects/stratium/index.js`:
- Around line 8-13: The getUserStakingSummary function calls
axios.post(`${HYPERLIQUID_MAINNET_RPC_URL}/info`, ...) without a timeout and
returns response.data unvalidated; add a request timeout option to the
axios.post call and validate the response before returning (e.g., check
response.status is 200 and that response.data exists and matches the expected
shape like having the delegator summary fields); if validation fails, throw or
return a clear error/default so callers don't receive undefined or hang — update
the axios.post invocation and the return path in getUserStakingSummary to
implement these checks.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: ecee7d97-bcd3-4bdf-a22e-86d7c61fe929
📒 Files selected for processing (1)
projects/stratium/index.js
|
The adapter at projects/stratium exports TVL: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@projects/stratium/index.js`:
- Around line 12-13: The validator currently allows 'delegated', 'undelegated',
and 'totalPendingWithdrawal' to be numbers which risks precision loss; update
the validation expression that checks these fields to require they are strings
matching a decimal format (e.g. /^\d+(\.\d+)?$/) and remove the "|| typeof ...
=== 'number'" branch. Ensure the check references the same field names
('delegated', 'undelegated', 'totalPendingWithdrawal') so parseHypeAmount
receives only decimal strings, and remove or ignore the now-unreachable defaults
applied during destructuring (lines near parseHypeAmount and the defaults at
lines 48–50).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 92968952-460b-4cad-9510-408bafc4a030
📒 Files selected for processing (1)
projects/stratium/index.js
|
The adapter at projects/stratium exports TVL: |
Project Name
Stratium
Twitter Link:
https://x.com/StratiumX
List of audit links if any:
https://docs.stratium.xyz/srhype/audit
Website Link:
https://stratium.xyz/
Logo
https://github.com/user-attachments/assets/f35ae13e-a6b0-4bbe-805e-68b9dd0c5466
Current TVL:
$3.83k
Chain:
Hyperliquid
Short Description
Stratium is a structured products protocol on Hyperliquid delivering volatility perps, asset baskets, and yield strategies. Stake HYPE to receive srHYPE and earn validator rewards plus trading fee share.
Token address and ticker if any:
srHYPE — 0x89A40805a3d069d17B4672982942780A2A1Aa089
Category
Liquid Staking
Oracle Provider(s):
None
Documentation/Proof:
https://docs.stratium.xyz/srhype/overview
https://docs.stratium.xyz/srhype/staking-contracts
https://www.halborn.com/audits/horizonx/stratium-hype-staking-vault-fe466a
https://hyperliquid.gitbook.io/hyperliquid-docs/hypercore/staking
https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint
Methodology:
Counts the underlying HYPE controlled by Stratum's StakingVault: HYPE held by the vault on HyperEVM plus HYPE delegated or undelegated on HyperCore for the vault address. Excludes future HIP-3 market fees, volume, revenue, and any non-staking protocol activity.
Github org/user:
https://github.com/horizonx-tech
Does this project have a referral program?
Yes
Summary by CodeRabbit
New Features
Documentation