Skip to content

fix(portfolio): filter soft-deleted vaults from user portfolio aggregation (#1438) - #1509

Open
Awosdot wants to merge 1 commit into
Junirezz:mainfrom
Awosdot:feature/issue-1438-exclude-soft-deleted-vaults
Open

Awosdot wants to merge 1 commit into
Junirezz:mainfrom
Awosdot:feature/issue-1438-exclude-soft-deleted-vaults

Conversation

@Awosdot

@Awosdot Awosdot commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Updated vaultPosition queries in backend/src/routes/portfolio.ts to apply where: { vault: { deletedAt: null } } by default[cite: 11].
  • Added support for includeDeleted?: boolean query parameter (defaulting to false) to allow optional inclusion of soft-deleted vaults[cite: 11].
  • Updated OpenAPI spec documentation and generated schema snapshots to reflect the new includeDeleted parameter on GET /users/:id/portfolio[cite: 11].
  • Added integration tests validating default exclusion of soft-deleted vaults and explicit inclusion when ?includeDeleted=true is set[cite: 11].

Why

Soft-deleted vaults resulting from deprecated strategies were previously included in GET /users/:id/portfolio calculations, showing inflated TVL/PNL gains and causing total value mismatches against GET /vaults[cite: 11].

How tested

  • Executed integration tests covering vault creation, soft-deletion, and default vs. includeDeleted=true response validation[cite: 11].
  • Verified existing portfolio happy-path test suite passes cleanly[cite: 11].

Closes

Closes #1438

feat: Renovate or Dependabot config is missing, so transitive lodash …

This branch has not been deployed

No deployments
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.

GET /users/:id/portfolio includes soft-deleted vaults in totals inflating user PNL

1 participant