Add Akka vault yield adapter#2719
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)
📝 WalkthroughWalkthroughAdds a new Hyperliquid "akka" vault adaptor that POSTs to the Hyperliquid info endpoint, computes tvlUsd from follower equity, derives apyBase from historical PnL/account-value samples with a production cutoff (fallback to reported APR), and exports the adaptor with metadata. ChangesHyperliquid Akka Vault Adaptor
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 akka adapter exports pools: Test Suites: 1 passed, 1 total |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/adaptors/akka/index.js`:
- Around line 9-12: The axios POST to HL_INFO_URL using VAULT_ADDRESS can hang;
add a bounded timeout and error handling to prevent the adaptor from stalling by
passing a timeout option (or an AbortController) to axios.post — e.g., call
axios.post(HL_INFO_URL, { type: 'vaultDetails', vaultAddress: VAULT_ADDRESS }, {
timeout: <ms> }) and wrap the call in a try/catch to handle timeout/errors and
log or fail gracefully instead of letting the process hang.
- Around line 15-18: The tvlUsd reducer currently sums Number(f.vaultEquity)
directly so a single malformed vaultEquity yields NaN and breaks
utils.keepFinite; update the tvlUsd calculation (the reduce over data.followers
used to compute tvlUsd) to skip non-numeric/malformed entries by coercing each
f.vaultEquity to a numeric value (e.g., parseFloat/Number) and only adding it
when Number.isFinite(value) (or isFinite) is true, thereby ignoring invalid
follower balances instead of letting them contaminate the total.
- Around line 31-59: The PnL and account-value selection logic (pnlSorted,
avSorted, liveStartPnl, liveStartValue vs PRODUCTION_LIVE_MS) use independent
nearest-time searches which can pick timestamps on different sides of
PRODUCTION_LIVE_MS; change both to the same cutoff strategy (e.g., pick the
first sample with t >= PRODUCTION_LIVE_MS for both series or perform a single
interpolation at PRODUCTION_LIVE_MS and use those interpolated values) so
apyBase calculation and APR fallback see a consistent start-time; update the
loops that compute liveStartPnl and liveStartValue to apply the chosen unified
rule.
🪄 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: 09c31199-90a8-4ebb-80ec-b88ac14a0f27
📒 Files selected for processing (1)
src/adaptors/akka/index.js
64920ec to
9709ebd
Compare
|
The akka adapter exports pools: Test Suites: 1 passed, 1 total |
Akka AI Quant Vault on Hyperliquid L1. Fetches TVL and computes annualized APY from on-chain PnL history via the Hyperliquid API.
Summary by CodeRabbit