Skip to content

Update sumTokens.js#20077

Closed
williamspatrick3353-droid wants to merge 1 commit into
DefiLlama:mainfrom
williamspatrick3353-droid:patch-61
Closed

Update sumTokens.js#20077
williamspatrick3353-droid wants to merge 1 commit into
DefiLlama:mainfrom
williamspatrick3353-droid:patch-61

Conversation

@williamspatrick3353-droid

@williamspatrick3353-droid williamspatrick3353-droid commented Jul 16, 2026

Copy link
Copy Markdown

NOTE

Please enable "Allow edits by maintainers" while putting up the PR.


  1. If you would like to add a volume/fees/revenue adapter please submit the PR here.

  2. Once your adapter has been merged, it takes time to show on the UI. If more than 24 hours have passed, please let us know in Discord.

  3. Sorry, We no longer accept fetch adapter for new projects, we prefer the tvl to computed from blockchain data, if you have trouble with creating a the adapter, please hop onto our discord, we are happy to assist you.

  4. For updating listing info Please send a mail to metadata@defillama.com

  5. Please do not add new npm dependencies, do not edit/push pnpm-lock.yaml file as part of your changes


(Needs to be filled only for new listings)

Name (to be shown on DefiLlama):
Twitter Link:
List of audit links if any:
Website Link:
Logo (High resolution, will be shown with rounded borders):
Current TVL:
Treasury Addresses (if the protocol has treasury)
Chain:
Coingecko ID (so your TVL can appear on Coingecko, leave empty if not listed): (https://api.coingecko.com/api/v3/coins/list)
Coinmarketcap ID (so your TVL can appear on Coinmarketcap, leave empty if not listed): (https://api.coinmarketcap.com/data-api/v3/map/all?listing_status=active,inactive,untracked&start=1&limit=10000)
Short Description (to be shown on DefiLlama):
Token address and ticker if any:
Category (full list at https://defillama.com/categories) *Please choose only one:
Oracle Provider(s): Specify the oracle(s) used (e.g., Chainlink, Band, API3, TWAP, etc.):
Implementation Details: Briefly describe how the oracle is integrated into your project:
Documentation/Proof: Provide links to documentation or any other resources that verify the oracle's usage:
forkedFrom (Does your project originate from another project):
methodology (what is being counted as tvl, how is tvl being calculated):
Github org/user (Optional, if your code is open source, we can track activity):
Does this project have a referral program?

Summary by CodeRabbit

  • Data Updates
    • Updated protocol TVL and staking tracking configurations across multiple networks.
    • Revised token and ownership mappings, including support for additional tokens and liquidity pools.
    • Expanded ownership entries for several protocol modules.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Updates registries/sumTokens.js ownership configuration across many protocols and chains, replacing existing owner, token, LP, staking, pool, and blacklist address mappings with shared hardcoded addresses.

Registry ownership normalization

Layer / File(s) Summary
Base owner and staking updates
registries/sumTokens.js
Updates direct owner fields and related staking ownership entries.
Token ownership mapping updates
registries/sumTokens.js
Rewrites owners arrays, tokensAndOwners, and staking or pool2 token associations.
Chain-specific and blacklist configurations
registries/sumTokens.js
Updates later chain modules, including Blast and BSC token, LP, staking, and blacklist configurations.
Final registry and NFT entries
registries/sumTokens.js
Updates remaining Ethereum, NFT, and protocol-specific mappings while retaining NFT resolution behavior.

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

Possibly related PRs

Suggested reviewers: rohannero, g1nt0ki, edmundbased

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is only boilerplate template text and does not explain the actual sumTokens.js changes. Add a brief summary of the registry/address changes, affected protocols/chains, and any notable risks or testing.
Title check ❓ Inconclusive The title is related to the changes, but it is too generic to convey the main update. Rename it to summarize the address/configuration updates in sumTokens.js, not just the file name.
✅ Passed checks (3 passed)
Check name Status Explanation
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

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

registries/sumTokens.js

Parsing error: Unexpected token "0x46531ea0E7cec64b14181d45F8C6798a1cE45da1"

🔧 ast-grep (0.44.1)
registries/sumTokens.js

ast-grep timed out on this file


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.

Warning

⚠️ This pull request has been flagged as potential spam (vandalism) by CodeRabbit slop detection and should be reviewed carefully.

@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 `@registries/sumTokens.js`:
- Line 607: Fix the malformed address entries in registries/sumTokens.js: at
lines 607-607, quote the address and restore the array terminator; at lines
2219-2219, remove the stray unquoted address before the string literal so the
registry parses and loads correctly.
- Around line 2384-2394: The pool2 configuration in sumTokens has duplicated
token addresses that are also blacklisted, causing the entire token set to be
filtered out. Restore the intended distinct LP addresses in pool2.tokens and
remove or correct the erroneous matching entry in pool2.blacklistedTokens, while
preserving the pool owners and resolveLP settings.
- Around line 1831-1852: Restore the original distinct contract addresses in the
affected sumTokens registry block, replacing the repeated 0x46531... address
entries in both owners and tokens with their intended clearinghouse/vault
addresses. Preserve the one-to-one slot alignment so sumTokens does not
deduplicate the entries and omit balances.
🪄 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: d4bdc88c-07e7-40c3-9263-d2300fe7727c

📥 Commits

Reviewing files that changed from the base of the PR and between a74acd2 and 2a735a3.

📒 Files selected for processing (1)
  • registries/sumTokens.js

Comment thread registries/sumTokens.js
]
"0x3211d27a1A1B8E40C7974F6951935303e6e56DBE",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
0x46531ea0E7cec64b14181d45F8C6798a1cE45da1 ]

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.

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Malformed address insertions prevent the registry from loading.

  • registries/sumTokens.js#L607-L607: quote the address and restore the array terminator.
  • registries/sumTokens.js#L2219-L2219: remove the stray unquoted address before the string literal.
📍 Affects 1 file
  • registries/sumTokens.js#L607-L607 (this comment)
  • registries/sumTokens.js#L2219-L2219
🤖 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 `@registries/sumTokens.js` at line 607, Fix the malformed address entries in
registries/sumTokens.js: at lines 607-607, quote the address and restore the
array terminator; at lines 2219-2219, remove the stray unquoted address before
the string literal so the registry parses and loads correctly.

Comment thread registries/sumTokens.js
Comment on lines +1831 to +1852
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1"
],
"tokens": [
ADDRESSES.base.USDC,
"0x7BfA7C4f149E7415b73bdeDfe609237e29CBF34A",
"0xbeef0e0834849aCC03f0089F01f4F1Eeb06873C9"
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1"

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 | 🏗️ Heavy lift

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== File context =="
sed -n '1800,1875p' registries/sumTokens.js

echo
echo "== sumTokens implementation references =="
rg -n "function sumTokens|const sumTokens|sumTokens\(" -S . --glob '!node_modules' --glob '!dist' --glob '!build'

Repository: DefiLlama/DefiLlama-Adapters

Length of output: 50384


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== helper/sumTokens.js outline =="
ast-grep outline projects/helper/sumTokens.js --view expanded

echo
echo "== relevant implementation slices =="
sed -n '1,220p' projects/helper/sumTokens.js

echo
echo "== unwrapLPs sumTokens implementation slices =="
sed -n '688,780p' projects/helper/unwrapLPs.js

echo
echo "== search for dedupe helpers in sumTokens path =="
rg -n "uniq\\(|Set\\(|dedup|duplicate|ownerTokens|tokensAndOwners2|tokensAndOwners" projects/helper/sumTokens.js projects/helper/unwrapLPs.js projects/helper/chain/*.js

Repository: DefiLlama/DefiLlama-Adapters

Length of output: 20596


Restore the distinct contract addresses here.
sumTokens dedupes owners and tokens, so this block collapses to a single balance query. If these slots are meant to cover separate clearinghouse/vault contracts, their balances are dropped.

🤖 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 `@registries/sumTokens.js` around lines 1831 - 1852, Restore the original
distinct contract addresses in the affected sumTokens registry block, replacing
the repeated 0x46531... address entries in both owners and tokens with their
intended clearinghouse/vault addresses. Preserve the one-to-one slot alignment
so sumTokens does not deduplicate the entries and omit balances.

Comment thread registries/sumTokens.js
Comment on lines 2384 to +2394
"pool2": {
"owners": [
"0xC2d2D7eB9cbF2985714E3310bFDB8eEcC3E96992"
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1"
],
"tokens": [
"0x149b55D78f6380Af73FFe57e9aDb7F1963BC251a",
"0xeb7fE075B7677c98C75E105d4f5ACE0e19505567"
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1",
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1"
],
"resolveLP": true,
"blacklistedTokens": [
"0xa90298e5B1203A2DD0006A75EABE158989C406Fb"
"0x46531ea0E7cec64b14181d45F8C6798a1cE45da1"

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

The blacklist removes the complete pool2 token set.

Both entries in tokens are the same address listed under blacklistedTokens. sumTokens deduplicates and filters them, leaving no pool2 tokens to query. Restore the intended LP addresses or remove the erroneous blacklist entry.

🤖 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 `@registries/sumTokens.js` around lines 2384 - 2394, The pool2 configuration in
sumTokens has duplicated token addresses that are also blacklisted, causing the
entire token set to be filtered out. Restore the intended distinct LP addresses
in pool2.tokens and remove or correct the erroneous matching entry in
pool2.blacklistedTokens, while preserving the pool owners and resolveLP
settings.

@RohanNero RohanNero closed this Jul 16, 2026
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