Skip to content

Fix missing strategies#1056

Closed
rossgalloway wants to merge 25 commits intomainfrom
fix--missing-strategies
Closed

Fix missing strategies#1056
rossgalloway wants to merge 25 commits intomainfrom
fix--missing-strategies

Conversation

@rossgalloway
Copy link
Collaborator

Summary

This branch improves vault ingestion, holdings detection, and holdings valuation consistency across portfolio and vault list flows.

Key outcome: user-held vault positions are now reliably surfaced even when they are not in the main catalog or not tagged as Yearn (including retired/migrated/staking-edge cases), and USD holdings values are computed from a single shared path.

Commits Included

  • b37abe0 chore(audit): add kong vault inclusion audit script
  • 12ed3e8 feat(vaults): fetch full kong list and expose catalog/all vault maps
  • 3a9ee99 feat(vault-filters): include user-held vaults from allVaults
  • f0c394d feat(holdings): unify vault holdings usd calculation and consumers
  • 7b50665 fix(balances): restrict enso missing-token fallback to vault position tokens
  • 77e3187 fix(format): make toBigInt robust to scientific notation
  • e1f8816 fix: staking holdings detection for non-zero staking addresses
  1. Added audit:kong-vault-inclusion script (scripts/audit-kong-vault-inclusion.ts) to inspect why specific vaults are/aren’t included.
    • allVaults (full mapped set by chain filter)
    • vaults (catalog set where origin=yearn or inclusion.isYearn=true)
  2. Extended Kong schema/mapping:
    • normalized/mapped PPS into vault.apr.pricePerShare.today
  3. Updated V2/V3 vault filters to include user-held vaults from allVaults via raw balance checks (vault share or staking token).
  4. Adjusted filter behavior so user-held positions are not hidden by chain/type/category/aggressiveness/underlying/minTVL filters.
  5. Centralized USD holdings computation in getVaultHoldingsUsdValue and reused it in:
    • portfolio model
    • wallet cumulative V2/V3 totals
    • vault list holdings chip
    • deposited sorting
  6. Marked yearn token entries with for: 'vault-share' | 'vault-staking' and included staking tokens by non-zero address.
  7. Restricted Enso missing-token multicall fallback to vault position tokens only, with deduped fallback token list.
  8. Final consistency fix: staking holdings now use non-zero staking address checks (not staking.available) in portfolio lookup and raw-holdings checks.

How To Test

Automated

  1. bun run lint
  2. bun run tslint
  3. bun run audit:kong-vault-inclusion -- --chain 1 0x7A26C6c1628c86788526eFB81f37a2ffac243A98 0xf91a9A1C782a1C11B627f6E576d92C7d72CDd4AF. These do not show in the old branch but should in the new.

Manual

  1. Use a wallet with holdings in a vault that is not in the active catalog (retired/migrated/non-catalog).
  2. Confirm holdings appear in portfolio and vault lists (V2/V3), and are not dropped by filters.
  3. Apply strict filters (chain/type/category/aggressiveness/underlying/minTVL) and verify held positions remain visible.
  4. Verify “deposited” sort order and holdings chip value match portfolio totals for the same vault.
  5. Test a staked-only position where staking.available=false but staking address is non-zero:
    • position is included in holdings
    • value is included in totals

@vercel
Copy link

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Feb 19, 2026 3:59pm

Request Review

@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

1 similar comment
@github-actions
Copy link

github-actions bot commented Feb 7, 2026

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

Copy link
Collaborator

@murderteeth murderteeth left a comment

Choose a reason for hiding this comment

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

unless urgent lets chat on this during standup

@rossgalloway
Copy link
Collaborator Author

Some additional fixes:

To fix an issue where any ERC4626 vault was included in the portfolio list, PR 1056 now separates Yearn vault identity into two explicit buckets:

  • Catalog list (vaults): only origin === 'yearn'.
  • Holdings fallback (inclusionYearnVaults): only inclusion.isYearn === true.

All user holdings paths (V2/V3 held vault inclusion, portfolio holdings lookup, and wallet cumulative holdings totals)
now use the union of those two sets, so holdings are included when origin === 'yearn' || inclusion.isYearn === true,
while non-Yearn ERC4626 vaults are excluded.

Also included: a staking edge-case fix so staked-only positions are detected by non-zero staking address (not
staking.available). Lint and typecheck pass.

Copy link
Collaborator

@0xeye 0xeye left a comment

Choose a reason for hiding this comment

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

Just a couple styling/use-case comments, otherwise LGTM

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this needed often in future use-cases? If not, maybe remove. Can always pull back script from PR if needed at a later date?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yep, can remove

Comment on lines 131 to 134
for (const [vaultAddress, vault] of Object.entries(yearnHoldingsVaults)) {
if (vault.staking?.address && !isZeroAddress(toAddress(vault.staking.address))) {
stakingToVault.set(toAddress(vault.staking.address), vaultAddress)
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Would prefer for the for and let on the files this PR touches to be swapped to functional use cases (know it wasn't beforehand, but it caught my attention hah). Generally makes it easier to understand state changes & why they're happening

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

will do

@rossgalloway
Copy link
Collaborator Author

rossgalloway commented Feb 9, 2026

unless urgent lets chat on this during standup

I think we should include this change AND make sure Kong is correctly classifying vaults and strategies as yearn when they should be.

Doing the fetch as this PR proposes will allow us to also allow deposits and withdrawals to any ERC-4626 vault be navigating directly to that address. Although I am realizing I should add a warning if a vault is not a yearn vault. Warning added for non yearn vaults.
image

0xeye and others added 3 commits February 10, 2026 10:32
* feat: dedupe reused code

* chore: remove deadcode

* chore: lock and loaded

* chore: bump
* Fix: incorrect route error on factory vault deposit (#1055)

* fix error with factory vault showing unavailable route on deposit

* fix issue in review

---------

Co-authored-by: Ross <ross@yearn.finance>

* add automatic deposit pop-up

---------

Co-authored-by: Ross <ross@yearn.finance>
@rossgalloway rossgalloway changed the base branch from main to dev February 10, 2026 18:01
0xeye and others added 4 commits February 19, 2026 06:09
* fix breadcrumbs

* styling and lint

* fix spacing

---------

Co-authored-by: Ross <ross@yearn.finance>
* Fix: improve number display

* chore: fix linting

---------

Co-authored-by: 0xeye <97349378+0xeye@users.noreply.github.com>
@BlinkyStitt
Copy link

I'm really looking forward to having this!

@rossgalloway
Copy link
Collaborator Author

this is incorporated in #1093

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.

4 participants