<!-- canonical: https://0xsimao.com/findings/morpho-vault-v2-deallocate-successfully-guarantee-morpho -->

# A `deallocateAll()` function could be useful to successfully guarantee market removal in the Morpho market adapter

Low/Info · Blackthorn · Curated yield vaults · 13th August, 2025

Finding L-4 of the Morpho Vault V2 security review.

- Protocol: https://morpho.org/
- Report: /reports/morpho-vault-v2
- Codebase: https://github.com/0xsimao/vault-v2/tree/ce661d820fb29307981f75eb42393db1c6e42758
- Source: https://github.com/morpho-org/vault-v2/blob/main/audits/2025-09-15-blackthorn.pdf

---

## Summary

`MorphoMarketV1Adapter::deallocate()` withdraws the given assets, removing a market in case the allocation is null, but it may be hard to achieve this without using the exact shares amount.

## Vulnerability Detail

`MorphoMarketV1Adapter::updateList()` is called after every deallocation to remove the market from the list if the assets are null there. However, due to interest accrual, leftover dust may be left after deallocation, which may make it annoying to fully remove a market.

## Impact

Removing a market from the list can be delayed, which should just slightly affect gas costs.

## Code Snippet

https://github.com/sherlock-audit/2025-08-morpho-vault-v2-aug-13th/pull/6/files#diff-29a9f0002168ac012f2dbea176776275c39c841f56d6e756b80f663e491f236fR87

## Tool Used

Manual Review

## Recommendation

Add a `deallocateAll()` function to forcefully remove all funds from the market.
