Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Dependency ReviewThe following issues were found:
Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. License Issuespackage.json
OpenSSF Scorecard
Scanned Files
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
0xeye
requested changes
Feb 17, 2026
Comment on lines
+188
to
+192
| ### DELETE `/api/v1/holdings/cache` | ||
| Clear cached data (useful for forcing recalculation). | ||
|
|
||
| ```bash | ||
| curl -X DELETE "http://localhost:3001/api/v1/holdings/cache?address=0x..." |
Collaborator
There was a problem hiding this comment.
Is this permissioned access? We shouldn't have DELETE api endpoints exposed publicly
Also, can we merge in feat/portfolio-history-adjustments - it just replaces let/for to const/maps, something I've expanded the CLAUDE.md doc to include in future
Collaborator
Author
There was a problem hiding this comment.
Oh! Sure, this was added for simpler testing purposes only. Thanks for pointing it out
Collaborator
* feat: init pnl * feat: consider staking * feat: omit migrate * chore: support migrate * feat: 3 calc types * feat: add totalEconomicGainUsd * chore: docs * chore: refactor * feat: actually consider price at deposit time * chore: optimize price fetch * fix: cache * chore: make fetching more aggressive * feat: test params * feat: improve totalCurrentValueUsd * feat: share events & kong * feat: fe + history fix * fix: defillama batching * feat: tooltips * feat: handle cow * feat: tune defillama * chore: tune a bit more * feat: add missing prices cache * feat: docs * fix: timeout * chore: copy * feat: stable vs volatile * Feat/portfolio pnl excessive (#1148) * feat: init excessive * chore: naming * feat: actually add drilldown * fix: v2/v3 filter * fix: version * fix: env * feat: cover crvusd rewards * feat: vault to vault migrate via enso * feat: init katana rewards * chore: upd receiver address * feat: fix bold * feat: add fetchType + paginationMode * feat: support fetchtype + pagination on vercel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Description
This branch expands the portfolio backend from a historical balance chart API into a broader holdings platform with:
It also adds operational support for lazy cache invalidation when new vaults are indexed, plus cleanup chores for stale cache rows.
What Was Added
Public API surfaces
GET /api/holdings/historyversion,refresh,fetchType, andpaginationModeGET /api/holdings/pnlstrict,zero_basis, andwindfallhandling for unknown-basis transfer-instotalPnlUsdandtotalEconomicGainUsdGET /api/holdings/pnl/drilldown/pnl, but expanded with lots, realized consumption, unknown-basis receipts/withdrawals, and journal-style inspection dataPOST /api/admin/invalidate-cachePOST /api/holdings/choresAccounting Model
The PnL engine now models Yearn positions as vault-family FIFO lots rather than simple balance snapshots.
It:
vaultvsstaked) instead of treating staking as a new investmentPortfolio PnLfromEconomic Gainstrict: exclude ambiguous lots from PnLzero_basis: treat ambiguous receipts as zero-cost basiswindfall: split receipt-time value from later market PnLProcessing Flow
History flow
PnL flow
Data Sources
The holdings and PnL pipeline now combines:
Pricing / Performance Improvements
This branch also hardens price fetching significantly:
fetchType=parallelandpaginationMode=allon both history and PnL surfacesFrontend Integration
The Portfolio page now consumes the new APIs and surfaces:
/api/holdings/history/api/holdings/pnlOperational Changes
This branch adds lazy cache invalidation for newly indexed vaults:
POST /api/admin/invalidate-cache.It also adds a chores endpoint for stale cache cleanup.
Documentation
This branch ships with dedicated docs for both the high-level holdings system and the accounting model:
api/lib/holdings/README.mdapi/lib/holdings/PNL.mdTesting
The work includes substantial coverage across:
Screenshots