Skip to content

Add Akka vault yield adapter#2719

Open
lkhoshnafs wants to merge 1 commit into
DefiLlama:masterfrom
lkhoshnafs:add-akka-adapter
Open

Add Akka vault yield adapter#2719
lkhoshnafs wants to merge 1 commit into
DefiLlama:masterfrom
lkhoshnafs:add-akka-adapter

Conversation

@lkhoshnafs

@lkhoshnafs lkhoshnafs commented Jun 2, 2026

Copy link
Copy Markdown

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

  • New Features
    • Added Hyperliquid "akka" vault integration exposing vault details in-app.
    • Shows total value locked (USD) for the vault and follower accounts.
    • Provides an estimated base APY with a fallback to reported APR when needed.
    • Returns a normalized single-pool view for this vault.

@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9b30cda0-aae5-419f-b32f-ba62ba088ec6

📥 Commits

Reviewing files that changed from the base of the PR and between 64920ec and 9709ebd.

📒 Files selected for processing (1)
  • src/adaptors/akka/index.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/adaptors/akka/index.js

📝 Walkthrough

Walkthrough

Adds 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.

Changes

Hyperliquid Akka Vault Adaptor

Layer / File(s) Summary
Constants and timestamps
src/adaptors/akka/index.js
Defines adaptor endpoint URL, fixed vault address, and PRODUCTION_LIVE_MS cutoff used by APY calculation.
APY computation and TVL
src/adaptors/akka/index.js
apy() POSTs to the Hyperliquid info endpoint, computes tvlUsd by summing follower vaultEquity (skipping non-finite), derives apyBase from PnL and account-value series sampled at/after PRODUCTION_LIVE_MS (uses first positive account-value), annualizes cumulative return, falls back to reported APR when missing/non-finite, and filters the returned pool via utils.keepFinite.
Adaptor export configuration
src/adaptors/akka/index.js
Exports { timetravel: false, apy, url: 'https://app.akka.finance/vault' }.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Suggested reviewers

  • 0xkr3p

Poem

🐰 I hopped to fetch the vault's true tune,
Summed followers' leaves beneath the moon,
PnL whispers told of growth and cheer,
APR fallback keeps the numbers clear,
Akka's adaptor hops — fresh yield is near!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Akka vault yield adapter' accurately and concisely summarizes the main change—adding a new yield adapter for the Akka vault, which matches the changeset that creates a new adaptor module.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

The akka adapter exports pools:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────────────────┬──────────────────┬─────────┬────────┬──────────────────┬──────────────────┬──────────────────┬──────────────────────────────────┐
│ (index) │ pool                                                     │ chain            │ project │ symbol │ tvlUsd           │ apyBase          │ poolMeta         │ url                              │
├─────────┼──────────────────────────────────────────────────────────┼──────────────────┼─────────┼────────┼──────────────────┼──────────────────┼──────────────────┼──────────────────────────────────┤
│ 0       │ '0x0e008684ae576f280c5426a89d3f5e1da1fc7398-hyperliquid' │ 'Hyperliquid L1' │ 'akka'  │ 'USDC' │ 84331.3690449899 │ 45.8244694944783 │ 'AI Quant Vault' │ 'https://app.akka.finance/vault' │
└─────────┴──────────────────────────────────────────────────────────┴──────────────────┴─────────┴────────┴──────────────────┴──────────────────┴──────────────────┴──────────────────────────────────┘

@coderabbitai coderabbitai Bot 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.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 62932a3 and 64920ec.

📒 Files selected for processing (1)
  • src/adaptors/akka/index.js

Comment thread src/adaptors/akka/index.js Outdated
Comment thread src/adaptors/akka/index.js Outdated
Comment thread src/adaptors/akka/index.js Outdated
@github-actions

github-actions Bot commented Jun 2, 2026

Copy link
Copy Markdown

The akka adapter exports pools:

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

Nb of pools: 1
 

Sample pools:
┌─────────┬──────────────────────────────────────────────────────────┬──────────────────┬─────────┬────────┬──────────────────┬───────────────────┬──────────────────┬──────────────────────────────────┐
│ (index) │ pool                                                     │ chain            │ project │ symbol │ tvlUsd           │ apyBase           │ poolMeta         │ url                              │
├─────────┼──────────────────────────────────────────────────────────┼──────────────────┼─────────┼────────┼──────────────────┼───────────────────┼──────────────────┼──────────────────────────────────┤
│ 0       │ '0x0e008684ae576f280c5426a89d3f5e1da1fc7398-hyperliquid' │ 'Hyperliquid L1' │ 'akka'  │ 'USDC' │ 84331.3690449899 │ 45.81130145017639 │ 'AI Quant Vault' │ 'https://app.akka.finance/vault' │
└─────────┴──────────────────────────────────────────────────────────┴──────────────────┴─────────┴────────┴──────────────────┴───────────────────┴──────────────────┴──────────────────────────────────┘

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.

1 participant