Skip to content

feat(lunarbase): sum multiple CurvePMM pools#18678

Open
NebulaNomadPixel wants to merge 2 commits intoDefiLlama:mainfrom
NebulaNomadPixel:codex/lunarbase-second-pool
Open

feat(lunarbase): sum multiple CurvePMM pools#18678
NebulaNomadPixel wants to merge 2 commits intoDefiLlama:mainfrom
NebulaNomadPixel:codex/lunarbase-second-pool

Conversation

@NebulaNomadPixel
Copy link
Copy Markdown
Contributor

@NebulaNomadPixel NebulaNomadPixel commented Apr 7, 2026

Summary

This change updates the LunarBase adapter to include one additional CurvePMM pool in the TVL calculation on Base.

What changed

  • added pool address 0x0716f359B3Bf8d03A3d9d39c60ba9820a1671B99
  • kept the existing pool address 0x6Ccc8223532fff07f47EF4311BEB3647326894Ab
  • TVL now sums balances across both pool contracts

Notes

No other logic was changed.
The existing calculation pattern remains the same, and this PR only extends the pool list with the new address.

Tested

  • node test.js projects/lunarbase

Summary by CodeRabbit

  • New Features

    • TVL calculations now aggregate balances across multiple CurvePMM liquidity pools, providing broader and more accurate total value locked reporting.
    • Concurrent pool scanning improves data completeness and responsiveness of TVL updates.
  • Documentation

    • Methodology updated to describe TVL coverage across all tracked CurvePMM pool contracts.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 7, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 5c2d4026-5229-431d-8328-68d6e5c35ae7

📥 Commits

Reviewing files that changed from the base of the PR and between f963a2e and adbafe1.

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

📝 Walkthrough

Walkthrough

The projects/lunarbase/index.js TVL implementation was refactored to compute TVL across multiple CurvePMM pool contracts by iterating CURVE_PMMS, reading each pool's address:X and address:Y, aggregating owner-token pairs, and summing balances via the shared tvl(api) flow.

Changes

Cohort / File(s) Summary
CurvePMM Multi-Pool TVL Computation
projects/lunarbase/index.js
Replaced single-pool inline TVL with a shared tvl(api) that iterates CURVE_PMMS, concurrently fetches address:X/address:Y for each pool, aggregates ownerTokens, calls api.sumTokens({ ownerTokens }) and api.getBalances(). Updated methodology text.

Sequence Diagram(s)

sequenceDiagram
    participant Caller as Caller
    participant TVL as New TVL(tvl)
    participant PoolA as Pool A (CurvePMM)
    participant PoolB as Pool B (CurvePMM)
    participant API as API

    rect rgba(150,200,150,0.5)
    Caller->>TVL: invoke tvl(api)
    TVL->>PoolA: call address:X / address:Y
    PoolA-->>TVL: token addresses
    TVL->>PoolB: call address:X / address:Y
    PoolB-->>TVL: token addresses
    TVL->>TVL: aggregate ownerTokens
    TVL->>API: sumTokens({ownerTokens})
    API-->>TVL: balances
    TVL->>API: getBalances()
    API-->>TVL: final balances
    TVL-->>Caller: return balances
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through pools, one then many,

Tokens gathered, stacked by any,
I counted X and Y so spry,
Summed the balances, watched them fly,
A rabbit's cheer for TVL sky-high 🥕✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding multiple CurvePMM pools to TVL calculation for LunarBase.
Description check ✅ Passed The description provides relevant implementation details (pool addresses, testing) but does not follow the repository template, which is primarily for new listings rather than updates.

✏️ 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.

@llamabutler
Copy link
Copy Markdown

The adapter at projects/lunarbase exports TVL:

base                      18.89 k

total                    18.89 k 

@llamabutler
Copy link
Copy Markdown

The adapter at projects/lunarbase exports TVL:

base                      19.61 k

total                    19.61 k 

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.

2 participants