Skip to content

Fix portfolio vault suggestion ranking#1105

Merged
0xeye merged 1 commit intorelease/03-16-26from
fix/reported-issue-regressions-release-031626
Mar 12, 2026
Merged

Fix portfolio vault suggestion ranking#1105
0xeye merged 1 commit intorelease/03-16-26from
fix/reported-issue-regressions-release-031626

Conversation

@rossgalloway
Copy link
Collaborator

@rossgalloway rossgalloway commented Mar 12, 2026

Description

Fix the remaining portfolio suggestion regressions on top of release/03-16-26.

related to this: #1093 (comment)

Related Issue

  • [P2] Select the largest qualifying vault, not the smallest
  • [P3] Deduplicate external matches before truncating to two items

Motivation and Context

Two confirmed regressions remained on release/03-16-26:

  • selectPreferredVault() used < in the qualifying path, so it preferred the smallest qualifying TVL instead of the most liquid option.
  • useVaultSuggestions() truncated external suggestions before deduping, so multiple wrappers of the same underlying could consume both external slots and hide distinct matches.

This branch fixes both by:

  • choosing the highest-TVL vault among qualifying candidates
  • deduping vault suggestions before applying the two-item external cap
  • extracting the suggestion builder into a pure helper so the behavior is covered by focused tests

The separate token RPC failure report was revalidated on this release branch and was already addressed here, so it is intentionally not part of this PR.

How Has This Been Tested?

  • bun run lint:fix
  • bun run tslint
  • bunx vitest run src/components/pages/portfolio/hooks/getEligibleVaults.test.ts src/components/pages/portfolio/hooks/buildVaultSuggestions.test.ts

Screenshots (if appropriate):

N/A

Correct the preferred vault selection and external suggestion\ndeduplication on the release branch.\n\n- choose the highest-TVL qualifying vault instead of the smallest\n- dedupe external matches before truncating to two suggestions\n- add focused tests for both regression paths\n\nThis restores the intended ranking behavior for portfolio suggestions\nand avoids wasting external slots on duplicate vault matches.
@vercel
Copy link

vercel bot commented Mar 12, 2026

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

Project Deployment Actions Updated (UTC)
yearnfi Ready Ready Preview, Comment Mar 12, 2026 3:43pm

Request Review

@github-actions
Copy link

Dependency Review

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

Scanned Files

None

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.

LGTM

@0xeye 0xeye merged commit a1c981c into release/03-16-26 Mar 12, 2026
7 checks passed
@0xeye 0xeye deleted the fix/reported-issue-regressions-release-031626 branch March 12, 2026 16:00
rossgalloway added a commit that referenced this pull request Mar 12, 2026
* init

* feat: soft migration prompt (#1068)

* chore: partial migration feature

* feat: cleanup

* feat: adjust location of text

* chore: rebase fixes

* chore: cleanup on aisle 3

* feat: refine selection for user

* chore: rename hooks to clarify use

* chore: remove allocator suggestions, filter low yield

* chore: fix bad error catch (#1074)

* update strategy card text and number styling (#1101)

* Feat  add individual zap gate flag (#1096)

* chore: update scpectra markets (#1094)

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

* Feat: Add zap gate to disable zaps by vault address

* chore: update readme

* fix eye review comments

---------

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

* Feat/check is significant loss (#1097)

* feat: add isSignificantLoss

* chore: comments

* feat: add accept price impact label

* fix: flashes

* update language

* Fix quote impact consent resets (#1102)

Reset deposit and withdraw high-price-impact acknowledgements when the active quote changes, including route toggles such as auto-stake and withdrawal source.

- key deposit consent to the amount, route, destination, and quoted output
- key withdraw consent to the amount, source, route, and quoted output

This keeps each acknowledgement tied to the currently displayed quote without changing the staked-share price-impact logic.

---------

Co-authored-by: Ross <therossgalloway@gmail.com>
Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>

* yvUSD mockup (#1006)

* Squashed commit of the following:

commit 137bcbe
Merge: 79df46e 967d76f
Author: Ross <therossgalloway@gmail.com>
Date:   Wed Mar 11 09:24:05 2026 -0400

    Merge commit '967d76f37043d24434a74918768a09fd3db8d9bb' into yvUSD-mockup-2

commit 79df46e
Author: Ross <therossgalloway@gmail.com>
Date:   Wed Mar 11 09:23:17 2026 -0400

    update risk score

commit 967d76f
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 23:30:04 2026 -0400

    add zaps and improve locked withdraw flow

commit 9021139
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 22:34:42 2026 -0400

    fix token icon on locked withdraw

commit ca6f663
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 21:59:32 2026 -0400

    more review fixes and mobile updates

commit 7540c8d
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 21:05:14 2026 -0400

    fixes from reviews

commit 4a59930
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 18:55:48 2026 -0400

    simplify

commit 1255d1a
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 17:41:18 2026 -0400

    compress deposit and withdraw modal spacing

commit 8e12af7
Merge: 4f3e0d5 fc89bc0
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 17:16:55 2026 -0400

    Merge branch 'update-logo' into yvUSD-mockup-2

commit 4f3e0d5
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 17:12:47 2026 -0400

    update risk score

commit e0c0b5c
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 15:09:20 2026 -0400

    fix spectra svgs

commit e2199ea
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 14:40:46 2026 -0400

    remove "zap-ready-tokens" section from my info panel

commit f083cdd
Merge: 5e33510 b9175f4
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 14:29:14 2026 -0400

    Merge branch 'yvUSD-mockup-2' of https://github.com/yearn/yearn.fi into yvUSD-mockup-2

commit 5e33510
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 14:29:05 2026 -0400

    fix MT reported issues

commit b9175f4
Author: 0xeye <97349378+0xeye@users.noreply.github.com>
Date:   Tue Mar 10 18:21:23 2026 +0000

    chore: fix padding

commit ddf478f
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 13:45:23 2026 -0400

    port compressed widget details to yvUSD widgets

commit a7c3cdc
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 13:35:55 2026 -0400

    simplify widget column sizing

commit ba49e01
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 13:10:09 2026 -0400

    fix portfolio overview calcs for yvUSD

commit 60a4bc3
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 12:07:44 2026 -0400

    fix holdings not showing up

commit fc89bc0
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 11:29:33 2026 -0400

    change to yearn seal logo

commit 93294b9
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 11:22:20 2026 -0400

    update logo and add options

commit d80d40b
Merge: 6b894a4 53c38b0
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Mar 10 11:21:01 2026 -0400

    Merge branch 'main' into yvUSD-mockup-2

commit 6b894a4
Author: Ross <therossgalloway@gmail.com>
Date:   Fri Mar 6 15:09:43 2026 -0500

    fix(vault): show infinifi points note in both yvUSD APY tooltips

commit aad36f5
Author: Ross <therossgalloway@gmail.com>
Date:   Fri Mar 6 14:38:55 2026 -0500

    fix(vault): standardize yvUSD withdrawal window to 7 days

commit 341320d
Author: Ross <therossgalloway@gmail.com>
Date:   Fri Mar 6 14:38:33 2026 -0500

    fix(vault): use yvUSD API asset address for unlocked withdraw

commit 4d8975a
Author: Ross <therossgalloway@gmail.com>
Date:   Fri Mar 6 14:37:39 2026 -0500

    feat(vault): show yvUSD infinifi points note in APY tooltips

commit afa534d
Author: Ross <therossgalloway@gmail.com>
Date:   Fri Mar 6 14:36:22 2026 -0500

    feat(vault): surface cooldown info in withdraw and My Info

commit 2827be2
Author: Ross <therossgalloway@gmail.com>
Date:   Fri Mar 6 14:33:40 2026 -0500

    feat(vault): add yvUSD APY lock toggle in header metrics

commit e430e13
Author: Ross <ross@yearn.finance>
Date:   Wed Feb 25 14:07:33 2026 -0700

    improve toggle styling

commit 5ad215a
Author: Ross <ross@yearn.finance>
Date:   Wed Feb 25 13:40:19 2026 -0700

    fix styling/spacing

commit f77fe7f
Author: Ross <ross@yearn.finance>
Date:   Wed Feb 25 13:19:37 2026 -0700

    remove overrides

commit f88c033
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 19:31:03 2026 -0700

    improve deposit and withdraw flow

commit 7c2e286
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 18:01:07 2026 -0700

    add cooldown logic to withdraw

commit 4d7dff6
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 17:04:45 2026 -0700

    improve

commit 3717369
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 15:34:02 2026 -0700

    improve vault info section

commit 3c89e0a
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 14:35:28 2026 -0700

    chore: clean up placeholders

commit b265ab1
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 14:04:57 2026 -0700

    fix cors issues

commit 549837c
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 13:42:31 2026 -0700

    update yvUSD API calls

commit 10244b9
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 09:41:12 2026 -0700

    fix bun.lock

commit 22361b1
Merge: 462218b 9b0f547
Author: Ross <ross@yearn.finance>
Date:   Tue Feb 24 09:37:40 2026 -0700

    Merge branch 'main' into yvUSD-mockup-2

commit 462218b
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 22:01:08 2026 -0500

    misc widget improvements

commit 998c02c
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 17:35:02 2026 -0500

    lint

commit a15cec0
Merge: e2f1cf4 7045cb7
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 17:20:27 2026 -0500

    Merge remote-tracking branch 'origin/chore--remove-kong-to-ydaemon-mapping' into yvUSD-mockup-2

commit e2f1cf4
Merge: 5bbbbe9 223ff7e
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 17:12:38 2026 -0500

    Merge remote-tracking branch 'origin/dev' into yvUSD-mockup-2

commit 5bbbbe9
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 17:09:07 2026 -0500

    removed most hardcoded things and misc other updates

commit 7045cb7
Merge: 641a018 223ff7e
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 16:39:32 2026 -0500

    Merge branch 'dev' into chore--remove-kong-to-ydaemon-mapping

commit 641a018
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 15:23:28 2026 -0500

    remove kong to ydaemon shape mapping

commit 2309e22
Author: Ross <therossgalloway@gmail.com>
Date:   Thu Feb 12 10:40:24 2026 -0500

    fix: adapt yvUSD cherry-picks to current main APIs

commit ff4d290
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Jan 27 19:13:01 2026 -0500

    improve widget styling

commit 8c657e3
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Jan 27 16:29:06 2026 -0500

    special deposits

commit 24cf143
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Jan 27 13:54:49 2026 -0500

    update logo and APY display

commit b3650a4
Author: Ross <therossgalloway@gmail.com>
Date:   Tue Jan 27 10:58:38 2026 -0500

    yvUSD mockup

commit 223ff7e
Author: rossgalloway <58150151+rossgalloway@users.noreply.github.com>
Date:   Tue Feb 10 11:25:33 2026 -0500

    feat: add automatic deposit pop-up (#1061)

    * 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>

commit 71adc6e
Author: 0xeye <97349378+0xeye@users.noreply.github.com>
Date:   Tue Feb 10 10:34:26 2026 +0000

    chore: cleanup (#1053)

    * feat: dedupe reused code

    * chore: remove deadcode

    * chore: lock and loaded

    * chore: bump

commit fcda410
Author: 0xeye <97349378+0xeye@users.noreply.github.com>
Date:   Tue Feb 10 10:32:30 2026 +0000

    chore: init

* lint

* fix yvUSD list row APY formatting

* fix missing usdc token on locked deposit without wallet connection

* update vault and risk descriptions

* add infinifi points icon and other misc tweaks

* improvements around withdrawal time

* add marketing banner

* update banner text

* add mobile banner

* feat: integrate staking withdraw path with yvUSD (#1104)

* feat: integrate staking withdraw path with yvUSD

* test: sync yvUSD expectations on integration branch

* fix locked withdraw flow issues

* style: format merged withdraw widget

* chore: fix portfolio vault suggestion ranking (#1105)

Correct the preferred vault selection and external suggestion\ndeduplication on the release branch.\n\n- choose the highest-TVL qualifying vault instead of the smallest\n- dedupe external matches before truncating to two suggestions\n- add focused tests for both regression paths\n\nThis restores the intended ranking behavior for portfolio suggestions\nand avoids wasting external slots on duplicate vault matches.

---------

Co-authored-by: rossgalloway <58150151+rossgalloway@users.noreply.github.com>
Co-authored-by: Ross <ross@yearn.finance>
Co-authored-by: w84april <32621609+w84april@users.noreply.github.com>
Co-authored-by: Ross <therossgalloway@gmail.com>
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