Liquidation reward is calculated incorrectly and will always be very low which presents no incentive for liquidators to liquidate underwater/overdue positions
Audit: 2024-06-size-findings
Severity: HIGH

# Lines of code

https://github.com/code-423n4/2024-06-size/blob/8850e25fb088898e9cf86f9be1c401ad155bea86/src/libraries/actions/Liquidate.sol#L96-L99


# Vulnerability details

## Impact
The liquidator reward/incentive is determined as the amount which is smaller between the difference of the `assignedCollateral` and the `debtInCollateralToken` OR a percentage of the futureValue of the debt position. The problem is that the latter is in a 6-decimal denomination and will always be the smaller value and when added to the overall collateral its a very insignificant amount, which presents no incentive for liquidators to actually liquidate the positions. 

## Proof of Concept
When `executeLiquidate()` is called:

```

    function executeLiquidate(State storage state, LiquidateParams calldata params)
        external
        returns (uint256 liquidatorProfitCollateralToken)
    {
        DebtPosition storage debtPosition = state.getDebtPosition(params.debtPositionId);
        LoanStatus loanStatus = state.getLoanStatus(params.debtPositionId);
        uint256 collateralRatio = state.collateralRatio(debtPosition.borrower);


        emit Events.Liquidate(params.debtPositionId, params.minimumCollateralProfit, collateralRatio, loanStatus);


        // if the loan is both underwater and overdue, the protocol fee related to underwater liquidations takes precedence
        uint256 collateralProtocolPercent = state.isUserUnderwater(debtPosition.borrower)
            ? state.feeConfig.collateralProtocolPercent
            : state.feeConfig.overdueCollateralProtocolPercent;


        uint256 assignedCollateral = state.getDebtPositionAssignedCollateral(debtPosition);
        uint256 debtInCollateralToken = state.debtTokenAmountToCollateralTokenAmount(debtPosition.futureValue);
        uint256 protocolProfitCollateralToken = 0;


        // profitable liquidation
        if (assignedCollateral > debtInCollateralToken) {
            uint256 liquidatorReward = Math.min(
                assignedCollateral - debtInCollateralToken,
                Math.mulDivUp(debtPosition.futureValue, state.feeConfig.liquidationRewardPercent, PERCENT)
            );
            liquidatorProfitCollateralToken = debtInCollateralToken + liquidatorReward;

```

As we can see from the last part which refers to a "profitable liquidation" in which the assigned collateral is larger than the debt, the liquidator reward is determined as the smaller amount between the `assignedCollateral - debtInCollateralToken` or a percentage of the `debtPosition.futureValue`.

Let's first see how `assignedCollateral` and `debtInCollateralToken` are determined:

```
 function getDebtPositionAssignedCollateral(State storage state, DebtPosition memory debtPosition)
        public
        view
        returns (uint256)
    {
        uint256 debt = state.data.debtToken.balanceOf(debtPosition.borrower);
        uint256 collateral = state.data.collateralToken.balanceOf(debtPosition.borrower);

        if (debt !