Skip to content

Comments

Extract active protocols dynamically rather than statically for Nolus Protocol#2321

Open
metodi96 wants to merge 3 commits intoDefiLlama:masterfrom
metodi96:master
Open

Extract active protocols dynamically rather than statically for Nolus Protocol#2321
metodi96 wants to merge 3 commits intoDefiLlama:masterfrom
metodi96:master

Conversation

@metodi96
Copy link
Contributor

@metodi96 metodi96 commented Jan 30, 2026

Summary by CodeRabbit

  • Refactor
    • Replaced hard-coded protocol data and static lists with dynamic retrieval from ETL.
    • APY and price calculations now use live protocol, pool, and currency data for more accurate reporting.
    • Replaced per-symbol static decimal fixes with consistent, ETL-driven decimal normalization (including a stable-quote reference) to improve token price and APY accuracy.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link

coderabbitai bot commented Jan 30, 2026

📝 Walkthrough

Walkthrough

The Nolus Protocol adaptor now sources active protocols and currency decimals from the ETL API instead of hard-coded definitions; getApy was refactored to use ETL-driven protocol/pool data and dynamic decimal adjustments for price/TVL calculations.

Changes

Cohort / File(s) Summary
Dynamic Protocol & Currency Integration
src/adaptors/nolus-protocol/index.js
Removed static protocol/contract list and hard-coded per-symbol decimal adjustments. Added fetchActiveProtocols, fetchCurrencyDecimals, getDecimalAdjustment, STABLE_QUOTE_DECIMALS, and refactored getApy to fetch protocols and currency decimals from ETL, query pools dynamically, and apply decimal normalization during APY/TVL computation.

Sequence Diagram

sequenceDiagram
    participant getApy as getApy()
    participant ETL as ETL API
    participant Pool as Pool Data Source
    participant Calc as Calc Logic

    getApy->>ETL: fetchActiveProtocols()
    ETL-->>getApy: active protocol descriptors (lpp, oracle, symbol, protocolName)

    getApy->>ETL: fetchCurrencyDecimals()
    ETL-->>getApy: ticker → decimals map

    loop for each protocol
        getApy->>Pool: request pool data (using lpp/oracle)
        Pool-->>getApy: pool balances, rates

        getApy->>Calc: compute price & TVL (use decimals map & getDecimalAdjustment)
        Calc-->>getApy: adjusted price & APY
    end

    getApy->>getApy: aggregate results and return APY list
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested reviewers

  • 0xkr3p

Poem

🐰 Hopping through ETL fields so wide,

I fetch protocols with a proud little stride.
Decimals aligned, no hardcoded snare,
APYs dance light with tidy, careful care.
A carrot of data — fresh, clean, and fair. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: replacing static protocol contracts with dynamic ETL-driven data for active protocols in the Nolus Protocol adapter.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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.

@llamatester
Copy link

The nolus-protocol adapter exports pools:

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

Nb of pools: 8
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────────────────────┬─────────┬──────────────────┬──────────────┬────────────────────┬──────────────────────┬───────────────┬─────────────────┬────────────────┬────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┐
│ (index) │ pool                                                               │ chain   │ project          │ symbol       │ tvlUsd             │ apyBase              │ apyBaseBorrow │ apyRewardBorrow │ totalSupplyUsd │ totalBorrowUsd │ underlyingTokens                                                                                                                                                     │ poolMeta │
├─────────┼────────────────────────────────────────────────────────────────────┼─────────┼──────────────────┼──────────────┼────────────────────┼──────────────────────┼───────────────┼─────────────────┼────────────────┼────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┤
│ 0       │ 'nolus1ueytzwqyadm6r0z8ajse7g6gzum4w3vv04qazctf8ugqrrej6n4sq027cf' │ 'Nolus' │ 'nolus-protocol' │ 'USDC_NOBLE' │ 645147.346132      │ 7.541530823106897    │ 17.4          │ 0               │ 1251765.870933 │ 605239.89221   │ [ 'ibc/F5FABF52B54E65064B57BF6DBD8E5FAD22CEE9F4B8A57ADBB20CCD0173AA72A4', 'ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4' ]                   │ ''       │
│ 1       │ 'nolus1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3sqaa3c5' │ 'Nolus' │ 'nolus-protocol' │ 'USDC'       │ 33121.148469       │ 5.114975776151159    │ 17.6          │ 0               │ 53054.674216   │ 19759.541662   │ [ 'ibc/7FBDBEEEBA9C50C4BCDF7BF438EAB99E64360833D240B32655C96E319559E911', 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858' ]                   │ ''       │
│ 2       │ 'nolus1w2yz345pqheuk85f0rj687q6ny79vlj9sd6kxwwex696act6qgkqfz7jy3' │ 'Nolus' │ 'nolus-protocol' │ 'ALL_BTC'    │ 24289.102852293054 │ 0.009215887000524468 │ 3.3           │ 0               │ 24495.22691899 │ 132.7852178    │ [ 'ibc/E45CFCB959F4F6D1065B7033EE49A88E606E6AD82E75725219B3D68B0FA89987', 'factory/osmo1z6r6qdknhgsc0zeracktgpcxf43j6sekq07nw8sxduc9lg0qjjlqfu25e3/alloyed/allBTC' ] │ ''       │
│ 3       │ 'nolus1qufnnuwj0dcerhkhuxefda6h5m24e64v2hfp9pac5lglwclxz9dsva77wm' │ 'Nolus' │ 'nolus-protocol' │ 'ALL_SOL'    │ 5761.129569953059  │ 0                    │ 7.7           │ 0               │ 5785.916204294 │ 0              │ [ 'ibc/762E1E45658845A12E214A91C3C05FDFC5951D60404FAADA225A369A96DCD9A9', 'factory/osmo1n3n75av8awcnw4jl62n3l48e6e4sxqmaf97w5ua6ddu4s475q5qq9udvx4/alloyed/allSOL' ] │ ''       │
│ 4       │ 'nolus1u0zt8x3mkver0447glfupz9lz6wnt62j70p5fhhtu3fr46gcdd9s5dz9l6' │ 'Nolus' │ 'nolus-protocol' │ 'ATOM'       │ 3179.9516576405467 │ 0                    │ 8.6           │ 0               │ 3200.954415    │ 0              │ [ 'ibc/6CDD4663F2F09CD62285E2D45891FC149A3568E316CE3EBBE201A71A78A69388', 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' ]                   │ ''       │
│ 5       │ 'nolus17vsedux675vc44yu7et9m64ndxsy907v7sfgrk7tw3xnjtqemx3q6t3xw6' │ 'Nolus' │ 'nolus-protocol' │ 'USDC_NOBLE' │ 2992.402242        │ 11.54105950001902    │ 16.6          │ 0               │ 15245.26058    │ 12225.185625   │ [ 'ibc/18161D8EFBD00FF5B7683EF8E923B8913453567FBE3FB6672D75712B0DEB6682', 'ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81' ]                   │ ''       │
│ 6       │ 'nolus1lxr7f5xe02jq6cce4puk6540mtu9sg36at2dms5sk69wdtzdrg9qq0t67z' │ 'Nolus' │ 'nolus-protocol' │ 'AKT'        │ 1703.9453664931527 │ 0                    │ 7.2           │ 0               │ 1716.916265    │ 0              │ [ 'ibc/ADC63C00000CA75F909D2BE3ACB5A9980BED3A73B92746E0FCE6C67414055459', 'ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4' ]                   │ ''       │
│ 7       │ 'nolus1py7pxw74qvlgq0n6rfz7mjrhgnls37mh87wasg89n75qt725rams8yr46t' │ 'Nolus' │ 'nolus-protocol' │ 'OSMO'       │ 1240.6338213265108 │ 0                    │ 4.9           │ 0               │ 1247.017135    │ 0              │ [ 'ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518', 'uosmo' ]                                                                                  │ ''       │
└─────────┴────────────────────────────────────────────────────────────────────┴─────────┴──────────────────┴──────────────┴────────────────────┴──────────────────────┴───────────────┴─────────────────┴────────────────┴────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/adaptors/nolus-protocol/index.js`:
- Around line 34-40: The protocols.map projection directly accesses nested
properties p.contracts.lpp and p.contracts.oracle which will throw if contracts
is null/undefined; update the mapping in the protocols.map callback (the code
creating objects with lpp/oracle/symbol/protocolName/meta) to defensively read
contracts (e.g., const c = p.contracts || {}; or use optional chaining) and
assign lpp and oracle from that safe reference so missing contracts produce
undefined (or a sensible default string) instead of throwing.
🧹 Nitpick comments (2)
src/adaptors/nolus-protocol/index.js (2)

71-75: Consider parallelizing independent API calls.

fetchActiveProtocols() and fetchCurrencyDecimals() are independent and could be fetched concurrently to reduce latency.

⚡ Proposed optimization
-  // Fetch active protocols dynamically from ETL
-  const contracts = await fetchActiveProtocols();
-
-  // Fetch currency decimals for dynamic adjustment
-  const currencyDecimals = await fetchCurrencyDecimals();
+  // Fetch active protocols and currency decimals concurrently
+  const [contracts, currencyDecimals] = await Promise.all([
+    fetchActiveProtocols(),
+    fetchCurrencyDecimals(),
+  ]);

94-97: Prefer strict equality operator.

Use === instead of == for type-safe comparison.

♻️ Proposed fix
     let currencyData = _.find(
       oracleCurrenciesData.data,
-      (n) => n.ticker == lppTickerData.data,
+      (n) => n.ticker === lppTickerData.data,
     );

@llamatester
Copy link

The nolus-protocol adapter exports pools:

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

Nb of pools: 8
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────────────────────┬─────────┬──────────────────┬──────────────┬────────────────────┬──────────────────────┬───────────────┬─────────────────┬────────────────┬────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┐
│ (index) │ pool                                                               │ chain   │ project          │ symbol       │ tvlUsd             │ apyBase              │ apyBaseBorrow │ apyRewardBorrow │ totalSupplyUsd │ totalBorrowUsd │ underlyingTokens                                                                                                                                                     │ poolMeta │
├─────────┼────────────────────────────────────────────────────────────────────┼─────────┼──────────────────┼──────────────┼────────────────────┼──────────────────────┼───────────────┼─────────────────┼────────────────┼────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┤
│ 0       │ 'nolus1ueytzwqyadm6r0z8ajse7g6gzum4w3vv04qazctf8ugqrrej6n4sq027cf' │ 'Nolus' │ 'nolus-protocol' │ 'USDC_NOBLE' │ 645147.346132      │ 7.541530823106897    │ 17.4          │ 0               │ 1251765.870933 │ 605239.89221   │ [ 'ibc/F5FABF52B54E65064B57BF6DBD8E5FAD22CEE9F4B8A57ADBB20CCD0173AA72A4', 'ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4' ]                   │ ''       │
│ 1       │ 'nolus1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3sqaa3c5' │ 'Nolus' │ 'nolus-protocol' │ 'USDC'       │ 33121.148469       │ 5.114975776151159    │ 17.6          │ 0               │ 53054.674216   │ 19759.541662   │ [ 'ibc/7FBDBEEEBA9C50C4BCDF7BF438EAB99E64360833D240B32655C96E319559E911', 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858' ]                   │ ''       │
│ 2       │ 'nolus1w2yz345pqheuk85f0rj687q6ny79vlj9sd6kxwwex696act6qgkqfz7jy3' │ 'Nolus' │ 'nolus-protocol' │ 'ALL_BTC'    │ 24356.828022499725 │ 0.009215887000524468 │ 3.3           │ 0               │ 24495.22691899 │ 132.7852178    │ [ 'ibc/E45CFCB959F4F6D1065B7033EE49A88E606E6AD82E75725219B3D68B0FA89987', 'factory/osmo1z6r6qdknhgsc0zeracktgpcxf43j6sekq07nw8sxduc9lg0qjjlqfu25e3/alloyed/allBTC' ] │ ''       │
│ 3       │ 'nolus1qufnnuwj0dcerhkhuxefda6h5m24e64v2hfp9pac5lglwclxz9dsva77wm' │ 'Nolus' │ 'nolus-protocol' │ 'ALL_SOL'    │ 5779.381386353941  │ 0                    │ 7.7           │ 0               │ 5785.916204294 │ 0              │ [ 'ibc/762E1E45658845A12E214A91C3C05FDFC5951D60404FAADA225A369A96DCD9A9', 'factory/osmo1n3n75av8awcnw4jl62n3l48e6e4sxqmaf97w5ua6ddu4s475q5qq9udvx4/alloyed/allSOL' ] │ ''       │
│ 4       │ 'nolus1u0zt8x3mkver0447glfupz9lz6wnt62j70p5fhhtu3fr46gcdd9s5dz9l6' │ 'Nolus' │ 'nolus-protocol' │ 'ATOM'       │ 3178.2943571948417 │ 0                    │ 8.6           │ 0               │ 3200.954415    │ 0              │ [ 'ibc/6CDD4663F2F09CD62285E2D45891FC149A3568E316CE3EBBE201A71A78A69388', 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' ]                   │ ''       │
│ 5       │ 'nolus17vsedux675vc44yu7et9m64ndxsy907v7sfgrk7tw3xnjtqemx3q6t3xw6' │ 'Nolus' │ 'nolus-protocol' │ 'USDC_NOBLE' │ 2992.402242        │ 11.54105950001902    │ 16.6          │ 0               │ 15245.26058    │ 12225.185625   │ [ 'ibc/18161D8EFBD00FF5B7683EF8E923B8913453567FBE3FB6672D75712B0DEB6682', 'ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81' ]                   │ ''       │
│ 6       │ 'nolus1lxr7f5xe02jq6cce4puk6540mtu9sg36at2dms5sk69wdtzdrg9qq0t67z' │ 'Nolus' │ 'nolus-protocol' │ 'AKT'        │ 1718.9430141908617 │ 0                    │ 7.2           │ 0               │ 1716.916265    │ 0              │ [ 'ibc/ADC63C00000CA75F909D2BE3ACB5A9980BED3A73B92746E0FCE6C67414055459', 'ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4' ]                   │ ''       │
│ 7       │ 'nolus1py7pxw74qvlgq0n6rfz7mjrhgnls37mh87wasg89n75qt725rams8yr46t' │ 'Nolus' │ 'nolus-protocol' │ 'OSMO'       │ 1242.8073616237873 │ 0                    │ 4.9           │ 0               │ 1247.017135    │ 0              │ [ 'ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518', 'uosmo' ]                                                                                  │ ''       │
└─────────┴────────────────────────────────────────────────────────────────────┴─────────┴──────────────────┴──────────────┴────────────────────┴──────────────────────┴───────────────┴─────────────────┴────────────────┴────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/adaptors/nolus-protocol/index.js`:
- Around line 62-70: The code currently falls back to stable decimals using the
logical OR operator which treats 0 as falsy; update the decimal fallback to use
nullish coalescing (??) so only null/undefined trigger the default. In practice,
modify getDecimalAdjustment usage and any other places (e.g., the block around
lines referenced 132-134) to compute lpnDecimals = (currency.decimal_digits ??
STABLE_QUOTE_DECIMALS) and then call getDecimalAdjustment(lpnDecimals), and
replace any other patterns like x || STABLE_QUOTE_DECIMALS with x ??
STABLE_QUOTE_DECIMALS to preserve a possible zero value.

@llamatester
Copy link

The nolus-protocol adapter exports pools:

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

Nb of pools: 8
 

Sample pools:
┌─────────┬────────────────────────────────────────────────────────────────────┬─────────┬──────────────────┬──────────────┬────────────────────┬──────────────────────┬───────────────┬─────────────────┬────────────────┬────────────────┬──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┬──────────┐
│ (index) │ pool                                                               │ chain   │ project          │ symbol       │ tvlUsd             │ apyBase              │ apyBaseBorrow │ apyRewardBorrow │ totalSupplyUsd │ totalBorrowUsd │ underlyingTokens                                                                                                                                                     │ poolMeta │
├─────────┼────────────────────────────────────────────────────────────────────┼─────────┼──────────────────┼──────────────┼────────────────────┼──────────────────────┼───────────────┼─────────────────┼────────────────┼────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┼──────────┤
│ 0       │ 'nolus1ueytzwqyadm6r0z8ajse7g6gzum4w3vv04qazctf8ugqrrej6n4sq027cf' │ 'Nolus' │ 'nolus-protocol' │ 'USDC_NOBLE' │ 645147.346132      │ 7.541530823106897    │ 17.4          │ 0               │ 1251765.870933 │ 605239.89221   │ [ 'ibc/F5FABF52B54E65064B57BF6DBD8E5FAD22CEE9F4B8A57ADBB20CCD0173AA72A4', 'ibc/498A0751C798A0D9A389AA3691123DADA57DAA4FE165D5C75894505B876BA6E4' ]                   │ ''       │
│ 1       │ 'nolus1qg5ega6dykkxc307y25pecuufrjkxkaggkkxh7nad0vhyhtuhw3sqaa3c5' │ 'Nolus' │ 'nolus-protocol' │ 'USDC'       │ 33121.148469       │ 5.114975776151159    │ 17.6          │ 0               │ 53054.674216   │ 19759.541662   │ [ 'ibc/7FBDBEEEBA9C50C4BCDF7BF438EAB99E64360833D240B32655C96E319559E911', 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858' ]                   │ ''       │
│ 2       │ 'nolus1w2yz345pqheuk85f0rj687q6ny79vlj9sd6kxwwex696act6qgkqfz7jy3' │ 'Nolus' │ 'nolus-protocol' │ 'ALL_BTC'    │ 24364.484118425513 │ 0.009215887000524468 │ 3.3           │ 0               │ 24495.22691899 │ 132.7852178    │ [ 'ibc/E45CFCB959F4F6D1065B7033EE49A88E606E6AD82E75725219B3D68B0FA89987', 'factory/osmo1z6r6qdknhgsc0zeracktgpcxf43j6sekq07nw8sxduc9lg0qjjlqfu25e3/alloyed/allBTC' ] │ ''       │
│ 3       │ 'nolus1qufnnuwj0dcerhkhuxefda6h5m24e64v2hfp9pac5lglwclxz9dsva77wm' │ 'Nolus' │ 'nolus-protocol' │ 'ALL_SOL'    │ 5781.01662126549   │ 0                    │ 7.7           │ 0               │ 5785.916204294 │ 0              │ [ 'ibc/762E1E45658845A12E214A91C3C05FDFC5951D60404FAADA225A369A96DCD9A9', 'factory/osmo1n3n75av8awcnw4jl62n3l48e6e4sxqmaf97w5ua6ddu4s475q5qq9udvx4/alloyed/allSOL' ] │ ''       │
│ 4       │ 'nolus1u0zt8x3mkver0447glfupz9lz6wnt62j70p5fhhtu3fr46gcdd9s5dz9l6' │ 'Nolus' │ 'nolus-protocol' │ 'ATOM'       │ 3165.265903455149  │ 0                    │ 8.6           │ 0               │ 3200.954415    │ 0              │ [ 'ibc/6CDD4663F2F09CD62285E2D45891FC149A3568E316CE3EBBE201A71A78A69388', 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' ]                   │ ''       │
│ 5       │ 'nolus17vsedux675vc44yu7et9m64ndxsy907v7sfgrk7tw3xnjtqemx3q6t3xw6' │ 'Nolus' │ 'nolus-protocol' │ 'USDC_NOBLE' │ 2992.402242        │ 11.54105950001902    │ 16.6          │ 0               │ 15245.26058    │ 12225.185625   │ [ 'ibc/18161D8EFBD00FF5B7683EF8E923B8913453567FBE3FB6672D75712B0DEB6682', 'ibc/B559A80D62249C8AA07A380E2A2BEA6E5CA9A6F079C912C3A9E9B494105E4F81' ]                   │ ''       │
│ 6       │ 'nolus1lxr7f5xe02jq6cce4puk6540mtu9sg36at2dms5sk69wdtzdrg9qq0t67z' │ 'Nolus' │ 'nolus-protocol' │ 'AKT'        │ 1716.7373550329175 │ 0                    │ 7.2           │ 0               │ 1716.916265    │ 0              │ [ 'ibc/ADC63C00000CA75F909D2BE3ACB5A9980BED3A73B92746E0FCE6C67414055459', 'ibc/1480B8FD20AD5FCAE81EA87584D269547DD4D436843C1D20F15E00EB64743EF4' ]                   │ ''       │
│ 7       │ 'nolus1py7pxw74qvlgq0n6rfz7mjrhgnls37mh87wasg89n75qt725rams8yr46t' │ 'Nolus' │ 'nolus-protocol' │ 'OSMO'       │ 1242.6874578517136 │ 0                    │ 4.9           │ 0               │ 1247.017135    │ 0              │ [ 'ibc/ED07A3391A112B175915CD8FAF43A2DA8E4790EDE12566649D0C2F97716B8518', 'uosmo' ]                                                                                  │ ''       │
└─────────┴────────────────────────────────────────────────────────────────────┴─────────┴──────────────────┴──────────────┴────────────────────┴──────────────────────┴───────────────┴─────────────────┴────────────────┴────────────────┴──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┴──────────┘
This adapter contains some pools with <10k TVL, these pools won't be shown in DefiLlama

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/adaptors/nolus-protocol/index.js`:
- Around line 62-70: getDecimalAdjustment currently returns 1 whenever
lpnDecimals < STABLE_QUOTE_DECIMALS which skips the required downscaling and
inflates price/TVL; update the function (and the duplicate logic at the other
occurrence around lines 131-134) to always return Math.pow(10, decimalDiff)
(where decimalDiff = lpnDecimals - STABLE_QUOTE_DECIMALS) so negative
differences correctly produce fractional adjustment factors, and ensure callers
use that factor for price/TVL scaling.

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