# In some situations the liquidation can become unprofitable for liquidators, keeping unhealthy positions

Aloe computes liquidation incentive from Uniswap position composition at lagging average price, so a position fully one asset at average but other at current price yields zero bonus, making liquidation unprofitable.

- Payout: Contest reward
- Severity: medium
- Program: Aloe
- Credited: panprog
- Disclosed: 2023-10-11
- Write-up quality: 6/10
- Original: https://github.com/sherlock-audit/2023-10-aloe-judging/issues/43
- Library page: https://bugbountylibrary.com/r/sherlock%3A2023-10-aloe%3AM-4
- Tags: domain:web3 impact:dos impact:funds-loss kind:contest platform:sherlock sev:medium tech:evm tech:solidity technique:source-review vuln:business-logic vuln:liquidation vuln:oracle-manipulation

**Target:** Borrower liquidation / BalanceSheet.computeLiquidationIncentive
**Root cause:** Liquidation incentive is computed from Uniswap position asset composition at the lagging average price, but _getAssets withdraws at current price, so the two compositions can differ and incentive can be zero while a swap is still required.
**Steps:**
1. Set current ETH price 1000 USDT, average price 1010 USDT.
2. Alice holds 1 ETH in Uniswap range [1000,1006] with 9990 USDT debt, unhealthy.
3. At average price 1010, position composition is 0 ETH + 1003 USDT, covering debt, so computeLiquidationIncentive returns 0.
4. At current price 1000, _getAssets withdraws 1 ETH + 0 USDT, forcing liquidator to swap 1 ETH at unfavorable 1010 average with no bonus.
5. Liquidator loses ~10 USDT, so rationally declines to liquidate.
**How found:** Code reading: noticed computeLiquidationIncentive is called with average-price composition while _getAssets withdraws at current price, then constructed a price/range scenario where the two compositions diverge.
**Exploitation:** Liquidator must swap the withdrawn asset at the lagging average price without receiving LIQUIDATION_INCENTIVE, incurring a loss; alternatively the unhealthy position persists, potentially accruing bad debt.
**Insight:** When a protocol prices collateral or incentives using a TWAP/average but settles at spot, check whether the same position can be 100% one asset under one price and 100% the other under the other price, zeroing the incentive while still forcing a swap.
