ExpectedLiquidity is not increasement in the V3pool when a user repays is debt eventhough treasury is minted shares thereby affecting the _baseInterestRate and total asset
Audit: 2024-07-loopfi-findings
Severity: HIGH

# Lines of code

https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/PoolV3.sol#L567
https://github.com/code-423n4/2024-07-loopfi/blob/57871f64bdea450c1f04c9a53dc1a78223719164/src/PoolV3.sol#L549


# Vulnerability details

## Impact
When a user repays their debt, the profit (interest) generated is supposed to be added to the total available assets in the `V3Pool`. This profit is critical for correctly updating the protocol's financial status and calculating the base interest rate. However, due to a bug in the implementation, the profit is not added to the total available assets. This omission causes several issues:

1. **Incorrect Interest Rate Calculation:** The base interest rate, which relies on the total available assets, will be miscalculated. This miscalculation can lead to suboptimal interest rates, either too high or too low, affecting the borrowing and lending dynamics.

2. **Financial Losses:** When the protocol incurs a loss, shares minted to the treasury are burned. However, since the profit was not added to the total assets, burning shares reduces from the overall total asset pool rather than the specific profit added. This results in financial losses for the protocol.


## Proof of Concept

1. **Profit Not Added to Total Assets:**
   - When a user repays their debt, the following code is intended to update the protocol's assets and base interest rate:
    
 ```solidity
 function repayCreditAccount(
        uint256 repaidAmount,
        uint256 profit,
        uint256 loss
    ) external
        override
        creditManagerOnly // U:[LP-2C]
        whenNotPaused // U:[LP-2A]
        nonReentrant // U:[LP-2B]
    {

------------------------------------------
     _updateBaseInterest({

@audit>>> profit is ommited>>        expectedLiquidityDelta: -loss.toInt256(),
      
         availableLiquidityDelta: 0,
         checkOptimalBorrowing: false
     });
```

   
- However, the profit generated from the repayment is not being added to `expectedLiquidityDelta` , leading to an inaccurate calculation of the total available assets.

    
 ```solidity
 /// @notice Total amount of underlying tokens managed by the pool, same as `expectedLiquidity`
    /// @dev Since `totalAssets` doesn't depend on underlying balance, pool is not vulnerable to the inflation attack
    function totalAssets() public view override(ERC4626, IERC4626) returns (uint256 assets) {
        return expectedLiquidity();
    }

 ```


2. **Impact on Interest Rate Calculation:**

   - The base interest rate (`_baseInterestRate`) relies on accurate data regarding total available assets. If profits are not correctly added, the interest rate will be calculated based on incomplete data, leading to potentially incorrect rates:


 ```solidity
     function _updateBaseInterest({
         expectedLiquidityDelta: -loss.toInt256(),
         availableLiquidityDelta: 0,
         checkOptimalBorrowing: false
     });
  ```
 ```solidity
  funct