Liquidation bonus scales exponentially instead of linearly.
Liquidation bonus scales exponentially instead of linearly.\\nLet's look at the code of `getLiquidationBonus`\\n```\\n    function getLiquidationBonus(\\n        address token,\\n        uint256 borrowedAmount,\\n        uint256 times\\n    ) public view returns (uint256 liquidationBonus) {\\n        // Retrieve liquidation bonus for the given token\\n        Liquidation memory liq = liquidationBonusForToken[token];\\n        unchecked {\\n            if (liq.bonusBP == 0) {\\n                // If there is no specific bonus for the token\\n                // Use default bonus\\n                liq.minBonusAmount = Constants.MINIMUM_AMOUNT;\\n                liq.bonusBP = dafaultLiquidationBonusBP;\\n            }\\n            liquidationBonus = (borrowedAmount * liq.bonusBP) / Constants.BP;\\n\\n            if (liquidationBonus < liq.minBonusAmount) {\\n                liquidationBonus = liq.minBonusAmount;\\n            }\\n            liquidationBonus *= (times > 0 ? times : 1);\\n        }\\n    }\\n```\\n\\nAs we can see, the liquidation bonus is based on the entire `borrowAmount` and multiplied by the number of new loans added. The problem is that it is unfair when the user makes a borrow against multiple lenders.\\nIf a user takes a borrow for X against 1 lender, they'll have to pay a liquidation bonus of Y. However, if they take a borrow for 3X against 3 lenders, they'll have to pay 9Y, meaning that taking a borrow against N lenders leads to overpaying liquidation bonus by N times.\\nFurthermore, if the user simply does it in multiple transactions, they can avoid these extra fees (as they can simply call `borrow` for X 3 times and pay 3Y in Liquidation bonuses)
make liquidation bonus simply a % of totalBorrowed
Loss of funds
```\\n    function getLiquidationBonus(\\n        address token,\\n        uint256 borrowedAmount,\\n        uint256 times\\n    ) public view returns (uint256 liquidationBonus) {\\n        // Retrieve liquidation bonus for the given token\\n        Liquidation memory liq = liquidationBonusForToken[token];\\n        unchecked {\\n            if (liq.bonusBP == 0) {\\n                // If there is no specific bonus for the token\\n                // Use default bonus\\n                liq.minBonusAmount = Constants.MINIMUM_AMOUNT;\\n                liq.bonusBP = dafaultLiquidationBonusBP;\\n            }\\n            liquidationBonus = (borrowedAmount * liq.bonusBP) / Constants.BP;\\n\\n            if (liquidationBonus < liq.minBonusAmount) {\\n                liquidationBonus = liq.minBonusAmount;\\n            }\\n            liquidationBonus *= (times > 0 ? times : 1);\\n        }\\n    }\\n```\\n