# Dust threshold boundary misaccounts

Dust or minimum-size checks placed before fee subtraction or after partial burn, flipping full vs partial outcomes

_Area: DeFi accounting and math bugs. Seen in 3 disclosed reports; latest 2026-08-20. Updated 2026-11-16._

## How it works
A dust or minimum-size guard is meant to keep amounts above a floor. The bug is that the guard runs on the wrong value: the pre-fee amount, the requested amount, or a balance that another path can shrink. The final amount that actually moves can then fall below the floor, go negative, or get promoted into a full wipe. The broken assumption is that "the value I checked is the value that lands." When a later subtraction, rounding branch, or cross-pool action changes the amount, the guard no longer covers it.

## Where it shows up
- A dust/minimum check on `outputValue` before `estimatedFee` is subtracted, or before `addOutput` adjusts it [E3](https://bugbountylibrary.com/r/cantina%3Ababylon_may2024%3A3.2.11.md).
- Burn/mint functions with a rounding or dust-cleanup branch (`new_scaled <= 1` promotes a partial burn to a full wipe) whose callers use the requested amount, not the return value [E1](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-14.md).
- Deposit caps computed as a percentage of current balance, where another path (sell from any vault) can drain that balance below the minimum [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md).
- Any guard followed by a fee, burn, or partial adjustment on the same value.

## How to review
For each dust/minimum guard, find the value that finally moves and confirm the guard applies to it, not an earlier version. The invariant: the checked amount equals the final settled amount, and the final amount is >= floor (and non-negative).
- For burn/mint: does every caller reconcile to the function's return value rather than the requested amount? [E1](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-14.md)
- For fees: is the dust check after fee subtraction? [E3](https://bugbountylibrary.com/r/cantina%3Ababylon_may2024%3A3.2.11.md)
- For ratio caps: can any other path shrink the balance below the minimum? [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md)

## How finders spotted it
- Read `burn_scaled` rounding, then traced its return value through `execute_repay`, `repay`, and `add_reserve_deficit` to see the gap between requested and actual burn [E1](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-14.md).
- Read `buy`'s MAX check against vault balance and noticed `sell` lacks a check that burned Numa came from the same vault [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md).
- Read `withdrawalTransaction`: the dust check used `outputValue` before `estimatedFee` was subtracted later in `addOutput` [E3](https://bugbountylibrary.com/r/cantina%3Ababylon_may2024%3A3.2.11.md).

## Variants seen
- Partial burn promoted to full dust wipe; caller transfers only the requested amount [E1](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-14.md).
- Cross-vault sell drains balance to dust so MAX < MIN, soft-DoSing deposits [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md).
- Dust check on pre-fee value; final output below dust or negative [E3](https://bugbountylibrary.com/r/cantina%3Ababylon_may2024%3A3.2.11.md).

## Impact and severity
E1: borrowers cancel more debt than they pay; repeated cycles leak reserve value, phantom borrow slots exhaust per-user limits, understated deficits become withdrawable [E1](https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-14.md). E2: deposits bricked, liquidity concentrated in preferred vaults [E2](https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md). E3: invalid withdrawal outputs below dust or negative [E3](https://bugbountylibrary.com/r/cantina%3Ababylon_may2024%3A3.2.11.md). Severity rises with repeatability and reach across pools or users.

## Evidence
- E1: https://bugbountylibrary.com/r/c4%3A2026-04-k2%3AH-14.md
- E2: https://bugbountylibrary.com/r/sherlock%3A2024-12-numa-audit%3AM-14.md
- E3: https://bugbountylibrary.com/r/cantina%3Ababylon_may2024%3A3.2.11.md
