Skip to content

fix(snowbl-capital): migrate to new vaults (USDC/ETH/BTC)#2744

Open
estebgonza wants to merge 1 commit into
DefiLlama:masterfrom
snowbl-capital:fix/snowbl-capital-vault-migration
Open

fix(snowbl-capital): migrate to new vaults (USDC/ETH/BTC)#2744
estebgonza wants to merge 1 commit into
DefiLlama:masterfrom
snowbl-capital:fix/snowbl-capital-vault-migration

Conversation

@estebgonza

@estebgonza estebgonza commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Snowbl Capital migrated its on-chain contracts. The previous single USDC vault sSnowbl (0xd61b…06e8) is retired.

This returns one pool per new Base ERC-4626 vault, each with its own underlying decimals and USD price:

Pool Vault Underlying Decimals
USDC 0x0e1a8354e10057092ecb7218b784c0c21710db91 USDC 6
ETH 0xffa67bd20e656f1c7873525df81728e9d26c8ee2 WETH 18
BTC 0xf423393e84ca810e1955a7806d1cd84d18099809 cbBTC 8

Verified locally against Base mainnet — the adapter returns 3 pools with correct TVL and price-per-share.

Summary by CodeRabbit

  • New Features

    • Added support for multiple Snowbl Capital ERC-4626 vaults (USDC, WETH, cbBTC) on the Base chain.
  • Improvements

    • Updated APY and TVL calculations to use live underlying token pricing and return accurate per-vault metrics.
    • Added validation to surface an error when required underlying token prices are missing or invalid.

@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@estebgonza, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 1 minute and 40 seconds. Learn how PR review limits work.

Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file).

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits.

🚦 How do rate limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a5c7b765-999d-4103-a266-9db9a3b2f1f4

📥 Commits

Reviewing files that changed from the base of the PR and between 2b5e875 and 84fae34.

📒 Files selected for processing (1)
  • src/adaptors/snowbl-capital/index.js
📝 Walkthrough

Walkthrough

The Snowbl Capital adaptor is expanded from a single hardcoded USDC vault to three ERC-4626 vaults (USDC, WETH, cbBTC) on Base. A vaults array replaces the single vault config, and apy() now fetches underlying token prices via utils.getPrices and computes per-vault tvlUsd using each vault's specific decimals and token price.

Changes

Snowbl Capital Multi-Vault Expansion

Layer / File(s) Summary
Vault config array and apy computation rework
src/adaptors/snowbl-capital/index.js
Adds CHAIN constant and a vaults array with USDC, WETH, and cbBTC vault metadata (address, symbol, underlying token, decimals, poolMeta). Reworks apy(timestamp) to fetch underlying token prices once via utils.getPrices, then iterates over vaults to fetch ERC-4626 info and compute tvlUsd as (tvl / 10**decimals) * price per vault, replacing the previous single-vault fixed-decimals approach.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested reviewers

  • 0xkr3p

Poem

🐰 Three vaults now bloom where one once grew,
USDC, WETH, cbBTC too!
With prices fetched and decimals right,
The TVL shines in accurate light.
Hop hop hooray for Base chain gains! 🎉

🚥 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 and accurately describes the main change: migrating the Snowbl Capital adapter from a single vault to three new vaults supporting different assets (USDC, ETH, BTC).
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.

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

🤖 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/snowbl-capital/index.js`:
- Around line 42-49: Add a validation check immediately after retrieving the
price from pricesByAddress using the lowercase underlyingToken address. If the
price is undefined or null, either skip processing the current vault (continue
to next iteration) or return early from the function. Only proceed to compute
the tvlUsd value if the price is confirmed to exist and is a valid number,
preventing NaN values from being calculated and propagated downstream.
🪄 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: 78887a21-2fdd-4969-966e-8966d3c938c0

📥 Commits

Reviewing files that changed from the base of the PR and between da7d26f and c221684.

📒 Files selected for processing (1)
  • src/adaptors/snowbl-capital/index.js

Comment thread src/adaptors/snowbl-capital/index.js
@estebgonza estebgonza force-pushed the fix/snowbl-capital-vault-migration branch 2 times, most recently from 4cc10c9 to 9eae7d5 Compare June 17, 2026 18:15
@estebgonza

Copy link
Copy Markdown
Contributor Author

hey
I don't think the tests failures are from the adapter
the first CI RPC (base.publicnode.com) isn't an archive node, so the 24h-ago convertToAssets call returns empty data and the sdk throws that fragment.format error. Vaults respond fine on archive RPCs on my side

@estebgonza estebgonza force-pushed the fix/snowbl-capital-vault-migration branch from 9eae7d5 to 2b5e875 Compare June 17, 2026 18:38
The previous single USDC vault (sSnowbl, 0xd61b…06e8) was retired after a
contract migration. Return one pool per new Base ERC-4626 vault, each with
its own underlying decimals and USD price:

- sUSD  -> USDC  (6 decimals)
- sETH  -> WETH  (18 decimals)
- sBTC  -> cbBTC (8 decimals)
@estebgonza estebgonza force-pushed the fix/snowbl-capital-vault-migration branch from 2b5e875 to 84fae34 Compare June 17, 2026 18:49
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