# RecollateralizationLib: Dust loss for an asset should be capped at it's low value

RecollateralizationLib adds full minTradeVolume as potential dust loss per asset, underestimating assetsLow and basket range bottom, causing under-recollateralization and undervalued RTokenAsset prices.

- Payout: Contest reward
- Severity: medium
- Program: Reserve
- Credited: HollaDieWaldfee
- Disclosed: 2023-04-27
- Write-up quality: 6/10
- Original: https://github.com/code-423n4/2023-01-reserve-findings/issues/106
- Library page: https://bugbountylibrary.com/r/c4%3A2023-01-reserve%3AM-22
- Tags: domain:web3 impact:funds-loss kind:contest platform:code4rena sev:medium tech:solidity technique:source-review vuln:accounting-error vuln:business-logic

**Target:** RecollateralizationLib.basketRange / totalAssetValue (Solidity library)
**Root cause:** potentialDustLoss adds rules.minTradeVolume for every asset in the AssetRegistry regardless of the asset's actual low value, so tiny-balance assets contribute a full minTradeVolume of dust loss.
**Steps:**
1. Read RecollateralizationLib.totalAssetValue loop over AssetRegistry assets.
2. Observe `potentialDustLoss = potentialDustLoss.plus(rules.minTradeVolume)` executed per asset.
3. Construct scenario: minTradeVolume=$50, three assets worth $1 each, one worth $200.
4. Computed assetsLow = $203 - 4*$50 = $3 instead of correct $150 (dust capped at each asset's low value).
5. Trace range.bottom into nextTradePair needed/amtShort and RTokenAsset low/lotLow price.
**How found:** Code reading of the totalAssetValue loop; noticed dust loss was accumulated per asset using a flat minTradeVolume rather than being bounded by each asset's low value, then traced downstream effects on basketRange and RTokenAsset pricing.
**Insight:** When a haircut/penalty is summed per-asset, check whether it is bounded by that asset's actual value; a flat per-asset constant over-penalizes portfolios of many tiny positions and skews derived price ranges.
