Skip to content

feat(liminal-basis): add remaining Liminal products#2838

Open
shkkgit wants to merge 3 commits into
DefiLlama:masterfrom
shkkgit:feat/liminal-basis-all-products
Open

feat(liminal-basis): add remaining Liminal products#2838
shkkgit wants to merge 3 commits into
DefiLlama:masterfrom
shkkgit:feat/liminal-basis-all-products

Conversation

@shkkgit

@shkkgit shkkgit commented Jul 21, 2026

Copy link
Copy Markdown

Summary

  • add xBTC, xLEND, and limUSD to the existing Liminal Basis adapter
  • list every product on Hyperliquid, Arbitrum, and Ethereum
  • calculate each product's TVL and 7-day APY from its own HyperEVM NAV Oracle and ShareManager
  • preserve the existing xHYPE integration and pool identifiers

Why

The adapter currently lists only xHYPE. This change adds the other active Liminal products using the same on-chain methodology.

Validation

  • ran the official adapter test suite: 77 tests passed
  • adapter returns 12 pools across 4 products and 3 networks

Summary by CodeRabbit

  • New Features
    • Added support for tracking NAV update events.
    • APY calculations now use NAV updates and share values for improved annualized performance reporting.
    • Added support for multiple Liminal Basis products, including xHYPE, xBTC, xLEND, and limUSD, across supported networks.
    • Pool listings now include product-specific symbols, metadata, TVL, and seven-day APY.

@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

The Liminal Basis adapter now calculates 7-day APY from NAV update events, retrieves share-manager values at NAV blocks, and supports pool generation for multiple products across Hyperliquid L1, Arbitrum, and Ethereum.

Changes

Liminal Basis adapter

Layer / File(s) Summary
NAV event discovery and parsing
src/adaptors/liminal-basis/abi.js, src/adaptors/liminal-basis/apy.js
Adds the NAVUpdated ABI event and retrieves, buffers, normalizes, and sorts NAV updates over cached block ranges.
Event-based APY calculation
src/adaptors/liminal-basis/apy.js
Selects a trailing NAV baseline, computes normalized share values from supply and decimals, and returns annualized compounded APY through the updated getApy7d pipeline.
Multi-product pool generation
src/adaptors/liminal-basis/index.js
Adds product deployment metadata, computes product-specific TVL and APY, and emits filtered pools for all configured deployments.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Adapter
  participant NAVOracle
  participant ShareManager
  participant EventLogs
  Adapter->>EventLogs: retrieve NAVUpdated records
  EventLogs-->>Adapter: return normalized NAV updates
  Adapter->>ShareManager: read totalSupply and decimals at NAV blocks
  ShareManager-->>Adapter: return supply and decimals
  Adapter->>Adapter: calculate share values and compounded APY
  Adapter->>NAVOracle: use product deployment metadata for TVL
  NAVOracle-->>Adapter: return product TVL
  Adapter-->>Adapter: generate pools for configured chains
Loading

Suggested reviewers: slasher125

🚥 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 clearly matches the main change: adding the remaining Liminal products to the adapter.
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.
✨ 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.

@github-actions

Copy link
Copy Markdown

The liminal-basis adapter exports pools:

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

Nb of pools: 12
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────┬──────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬─────────────────────────────────┬───────────────────────────────────────┐
│ (index) │ pool                                                                   │ chain            │ project         │ symbol   │ tvlUsd             │ apyBase            │ apyBase7d          │ underlyingTokens                                 │ poolMeta                        │ url                                   │
├─────────┼────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────┼──────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼─────────────────────────────────┼───────────────────────────────────────┤
│ 0       │ '0x1822bd335489d84abdd0779a7dcaeda0625e83c8-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'limUSD' │ 11902416.534016699 │ 10.618684208371388 │ 10.618684208371388 │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 1       │ '0x9b74d3bd96f54de689cffdeb27ee34f68dff086d-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'limUSD' │ 11902416.534016699 │ 10.618684208371388 │ 10.618684208371388 │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 2       │ '0x9b74d3bd96f54de689cffdeb27ee34f68dff086d-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'limUSD' │ 11902416.534016699 │ 10.618684208371388 │ 10.618684208371388 │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 3       │ '0x95f6d66c09a22e6f2bb693306b3ed69663066cbb-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xLEND'  │ 6371542.798775099  │ 6.569084081016295  │ 6.569084081016295  │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 4       │ '0xd68700e70f1bc9bfc589082b27083f27ac85936c-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'xLEND'  │ 6371542.798775099  │ 6.569084081016295  │ 6.569084081016295  │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 5       │ '0xd68700e70f1bc9bfc589082b27083f27ac85936c-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'xLEND'  │ 6371542.798775099  │ 6.569084081016295  │ 6.569084081016295  │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 6       │ '0xac962fa04bf91b7fd0dc0c5c32414e0ce3c51e03-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xHYPE'  │ 5785978.695017527  │ 9.937960395312524  │ 9.937960395312524  │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 7       │ '0xcffe430e9492966727ddc60eb183fe93e5a218e4-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'xHYPE'  │ 5785978.695017527  │ 9.937960395312524  │ 9.937960395312524  │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 8       │ '0xac962fa04bf91b7fd0dc0c5c32414e0ce3c51e03-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'xHYPE'  │ 5785978.695017527  │ 9.937960395312524  │ 9.937960395312524  │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 9       │ '0x97df58ce4489896f4ec7d16b59b64ad0a56243a8-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xBTC'   │ 1223106.6538368384 │ 9.499567167860565  │ 9.499567167860565  │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Delta-neutral BTC yield'       │ 'https://liminal.money/app/tokenized' │
└─────────┴────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────┴──────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴─────────────────────────────────┴───────────────────────────────────────┘

@github-actions

Copy link
Copy Markdown

The liminal-basis adapter exports pools:

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

Nb of pools: 12
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────┬──────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬─────────────────────────────────┬───────────────────────────────────────┐
│ (index) │ pool                                                                   │ chain            │ project         │ symbol   │ tvlUsd             │ apyBase            │ apyBase7d          │ underlyingTokens                                 │ poolMeta                        │ url                                   │
├─────────┼────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────┼──────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼─────────────────────────────────┼───────────────────────────────────────┤
│ 0       │ '0x1822bd335489d84abdd0779a7dcaeda0625e83c8-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'limUSD' │ 11902919.899729699 │ 10.618684208371388 │ 10.618684208371388 │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 1       │ '0x9b74d3bd96f54de689cffdeb27ee34f68dff086d-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'limUSD' │ 11902919.899729699 │ 10.618684208371388 │ 10.618684208371388 │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 2       │ '0x9b74d3bd96f54de689cffdeb27ee34f68dff086d-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'limUSD' │ 11902919.899729699 │ 10.618684208371388 │ 10.618684208371388 │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 3       │ '0x95f6d66c09a22e6f2bb693306b3ed69663066cbb-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xLEND'  │ 6372027.541702099  │ 6.569084081016295  │ 6.569084081016295  │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 4       │ '0xd68700e70f1bc9bfc589082b27083f27ac85936c-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'xLEND'  │ 6372027.541702099  │ 6.569084081016295  │ 6.569084081016295  │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 5       │ '0xd68700e70f1bc9bfc589082b27083f27ac85936c-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'xLEND'  │ 6372027.541702099  │ 6.569084081016295  │ 6.569084081016295  │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 6       │ '0xac962fa04bf91b7fd0dc0c5c32414e0ce3c51e03-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xHYPE'  │ 5785978.695017527  │ 9.937960395312524  │ 9.937960395312524  │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 7       │ '0xcffe430e9492966727ddc60eb183fe93e5a218e4-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'xHYPE'  │ 5785978.695017527  │ 9.937960395312524  │ 9.937960395312524  │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 8       │ '0xac962fa04bf91b7fd0dc0c5c32414e0ce3c51e03-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'xHYPE'  │ 5785978.695017527  │ 9.937960395312524  │ 9.937960395312524  │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 9       │ '0x97df58ce4489896f4ec7d16b59b64ad0a56243a8-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xBTC'   │ 1223106.6538368384 │ 9.499567167860565  │ 9.499567167860565  │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
└─────────┴────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────┴──────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴─────────────────────────────────┴───────────────────────────────────────┘

@github-actions

Copy link
Copy Markdown

The liminal-basis adapter exports pools:

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

Nb of pools: 12
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────────────────────────┬──────────────────┬─────────────────┬──────────┬────────────────────┬────────────────────┬────────────────────┬──────────────────────────────────────────────────┬─────────────────────────────────┬───────────────────────────────────────┐
│ (index) │ pool                                                                   │ chain            │ project         │ symbol   │ tvlUsd             │ apyBase            │ apyBase7d          │ underlyingTokens                                 │ poolMeta                        │ url                                   │
├─────────┼────────────────────────────────────────────────────────────────────────┼──────────────────┼─────────────────┼──────────┼────────────────────┼────────────────────┼────────────────────┼──────────────────────────────────────────────────┼─────────────────────────────────┼───────────────────────────────────────┤
│ 0       │ '0x1822bd335489d84abdd0779a7dcaeda0625e83c8-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'limUSD' │ 11902919.899729699 │ 8.77293857703727   │ 8.77293857703727   │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 1       │ '0x9b74d3bd96f54de689cffdeb27ee34f68dff086d-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'limUSD' │ 11902919.899729699 │ 8.77293857703727   │ 8.77293857703727   │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 2       │ '0x9b74d3bd96f54de689cffdeb27ee34f68dff086d-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'limUSD' │ 11902919.899729699 │ 8.77293857703727   │ 8.77293857703727   │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Diversified Hyperliquid yield' │ 'https://liminal.money/app/tokenized' │
│ 3       │ '0x95f6d66c09a22e6f2bb693306b3ed69663066cbb-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xLEND'  │ 6372134.609036339  │ 7.9698894427857825 │ 7.9698894427857825 │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 4       │ '0xd68700e70f1bc9bfc589082b27083f27ac85936c-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'xLEND'  │ 6372134.609036339  │ 7.9698894427857825 │ 7.9698894427857825 │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 5       │ '0xd68700e70f1bc9bfc589082b27083f27ac85936c-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'xLEND'  │ 6372134.609036339  │ 7.9698894427857825 │ 7.9698894427857825 │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Money market yield'            │ 'https://liminal.money/app/tokenized' │
│ 6       │ '0xac962fa04bf91b7fd0dc0c5c32414e0ce3c51e03-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xHYPE'  │ 5791682.170092527  │ 12.719507166841538 │ 12.719507166841538 │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 7       │ '0xcffe430e9492966727ddc60eb183fe93e5a218e4-arbitrum-arbitrum'         │ 'Arbitrum'       │ 'liminal-basis' │ 'xHYPE'  │ 5791682.170092527  │ 12.719507166841538 │ 12.719507166841538 │ [ '0xaf88d065e77c8cC2239327C5EDb3A432268e5831' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 8       │ '0xac962fa04bf91b7fd0dc0c5c32414e0ce3c51e03-ethereum-ethereum'         │ 'Ethereum'       │ 'liminal-basis' │ 'xHYPE'  │ 5791682.170092527  │ 12.719507166841538 │ 12.719507166841538 │ [ '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
│ 9       │ '0x97df58ce4489896f4ec7d16b59b64ad0a56243a8-hyperliquid-hyperliquidl1' │ 'Hyperliquid L1' │ 'liminal-basis' │ 'xBTC'   │ 1223108.6538368384 │ 12.114378099345501 │ 12.114378099345501 │ [ '0xb88339CB7199b77E23DB6E890353E22632Ba630f' ] │ 'Delta-neutral yield'           │ 'https://liminal.money/app/tokenized' │
└─────────┴────────────────────────────────────────────────────────────────────────┴──────────────────┴─────────────────┴──────────┴────────────────────┴────────────────────┴────────────────────┴──────────────────────────────────────────────────┴─────────────────────────────────┴───────────────────────────────────────┘

@shkkgit
shkkgit marked this pull request as ready for review July 21, 2026 22:43

@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: 2

🧹 Nitpick comments (1)
src/adaptors/liminal-basis/apy.js (1)

86-109: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

No minimum-gap safeguard on the selected baseline.

findClosestNavApyBaseline only requires the closest match to the 7-day target; it doesn't enforce a minimum distance from endRecord. If NAV updates are sparse/irregular and the closest available baseline ends up very close in time to endRecord, computeCompoundedApy's (ratio)**(365/periodDays) will amplify tiny share-value deltas into large-but-finite APY values that pass the Number.isFinite check in computeCompoundedApy (lines 124-144) and get surfaced to users.

Consider requiring periodDays to exceed some floor (e.g., 1-2 days) before accepting a baseline, falling back to 0 otherwise.

🤖 Prompt for 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.

In `@src/adaptors/liminal-basis/apy.js` around lines 86 - 109, Add a minimum
elapsed-period safeguard to findClosestNavApyBaseline or its caller before
computeCompoundedApy accepts the selected baseline. Reject baselines whose
timestamp gap from endRecord is below the chosen floor (such as 1–2 days), and
return the existing zero/fallback result so short periods cannot produce
surfaced APY values.
🤖 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/liminal-basis/index.js`:
- Around line 138-142: Update main’s concurrent product loading to isolate
failures per product by replacing Promise.all with Promise.allSettled or
equivalent per-product error handling. Retain fulfilled pool results, discard
rejected getPools results, and preserve the existing flattening and tvlUsd > 0
filtering for successful products.
- Around line 115-136: Update getPools so the hubDeployment NAV-derived tvlUsd
and apy values are assigned only to the canonical hyperliquidL1 pool, while
wrapper deployments receive no duplicated NAV metrics (or appropriately split
values). Preserve the existing pool mapping and metadata for every deployment
without inflating aggregate TVL.

---

Nitpick comments:
In `@src/adaptors/liminal-basis/apy.js`:
- Around line 86-109: Add a minimum elapsed-period safeguard to
findClosestNavApyBaseline or its caller before computeCompoundedApy accepts the
selected baseline. Reject baselines whose timestamp gap from endRecord is below
the chosen floor (such as 1–2 days), and return the existing zero/fallback
result so short periods cannot produce surfaced APY values.
🪄 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: d22619e5-91d5-44c7-997e-e045ed12269a

📥 Commits

Reviewing files that changed from the base of the PR and between 83ee686 and eec4aed.

📒 Files selected for processing (3)
  • src/adaptors/liminal-basis/abi.js
  • src/adaptors/liminal-basis/apy.js
  • src/adaptors/liminal-basis/index.js

Comment on lines +115 to +136
async function getPools(product) {
const hubDeployment = product.deployments.hyperliquidL1;
const tvlUsd = await getTvlUsd(hubDeployment.navOracle);
const apyBase7d = await getApy7d(
XHYPE.hyperliquidL1.navOracle,
XHYPE.hyperliquidL1.address,
HYPERLIQUID_L1_CHAIN,
hubDeployment.navOracle,
hubDeployment.address,
HYPERLIQUID_L1_CHAIN
);

const pools = Object.entries(XHYPE).map(([key, config]) => ({
return Object.entries(product.deployments).map(([key, config]) => ({
pool: `${config.address}-${config.chain}-${key}`.toLowerCase(),
chain: utils.formatChain(config.chain),
project: 'liminal-basis',
symbol: 'xHYPE',
symbol: product.symbol,
tvlUsd,
apyBase: apyBase7d,
apyBase7d,
underlyingTokens: config.underlyingTokens,
poolMeta: 'Delta-neutral yield',
poolMeta: product.poolMeta,
url: 'https://liminal.money/app/tokenized',
}));
}

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.

🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map the target file and nearby symbols
ast-grep outline src/adaptors/liminal-basis/index.js --view expanded || true

# Show the relevant section with line numbers
sed -n '1,220p' src/adaptors/liminal-basis/index.js

# Search for related patterns in the repo
rg -n "liminal-basis|getPools\\(|hyperliquidL1|underlyingTokens|tvlUsd" src/adaptors -S

Repository: DefiLlama/yield-server

Length of output: 50379


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,240p' src/adaptors/liminal-basis/index.js

printf '\n--- related occurrences ---\n'
rg -n "hyperliquidL1|getApy7d|getTvlUsd|product\\.deployments|deployments\\." src/adaptors/liminal-basis/index.js src/adaptors -S --glob '!**/node_modules/**' | head -n 120

Repository: DefiLlama/yield-server

Length of output: 8544


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Show only the target adaptor file with line numbers
cat -n src/adaptors/liminal-basis/index.js | sed -n '1,260p'

printf '\n---\n'

# Search for any notes/docs on this adaptor or product model
rg -n "liminal-basis|liminal.money|hyperliquidL1|xHYPE|product" . -S \
  --glob '!**/node_modules/**' \
  --glob '!**/dist/**' \
  --glob '!**/build/**' \
  | head -n 200

Repository: DefiLlama/yield-server

Length of output: 13943


Avoid reusing the same NAV for every deployment

getPools reads tvlUsd once from hyperliquidL1 and copies it onto the arbitrum/ethereum wrappers for each product. If these pools are summed, liminal-basis TVL is inflated by 3x per product; keep the NAV on one canonical pool or split it per deployment.

🤖 Prompt for 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.

In `@src/adaptors/liminal-basis/index.js` around lines 115 - 136, Update getPools
so the hubDeployment NAV-derived tvlUsd and apy values are assigned only to the
canonical hyperliquidL1 pool, while wrapper deployments receive no duplicated
NAV metrics (or appropriately split values). Preserve the existing pool mapping
and metadata for every deployment without inflating aggregate TVL.

Comment on lines +138 to 142
async function main() {
const pools = await Promise.all(PRODUCTS.map(getPools));

return pools.filter((p) => p.tvlUsd > 0);
return pools.flat().filter((p) => p.tvlUsd > 0);
}

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.

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Promise.all couples all 4 products' success together.

If any single product's getTvlUsd/getApy7d call fails (RPC error, oracle revert, etc.), Promise.all rejects and main() throws, dropping pools for all 4 products instead of just the failing one. Consider Promise.allSettled (or per-product try/catch) so one product's failure doesn't take down the other three.

♻️ Proposed fix
 async function main() {
-  const pools = await Promise.all(PRODUCTS.map(getPools));
+  const results = await Promise.allSettled(PRODUCTS.map(getPools));
+  const pools = results
+    .filter((r) => r.status === 'fulfilled')
+    .map((r) => r.value);

   return pools.flat().filter((p) => p.tvlUsd > 0);
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async function main() {
const pools = await Promise.all(PRODUCTS.map(getPools));
return pools.filter((p) => p.tvlUsd > 0);
return pools.flat().filter((p) => p.tvlUsd > 0);
}
async function main() {
const results = await Promise.allSettled(PRODUCTS.map(getPools));
const pools = results
.filter((r) => r.status === 'fulfilled')
.map((r) => r.value);
return pools.flat().filter((p) => p.tvlUsd > 0);
}
🤖 Prompt for 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.

In `@src/adaptors/liminal-basis/index.js` around lines 138 - 142, Update main’s
concurrent product loading to isolate failures per product by replacing
Promise.all with Promise.allSettled or equivalent per-product error handling.
Retain fulfilled pool results, discard rejected getPools results, and preserve
the existing flattening and tvlUsd > 0 filtering for successful products.

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