Claiming liquidationAccountant will reduce vault y-intercept by more than the correct amount
When `claim()` is called on the Liquidation Accountant, it decreases the y-intercept based on the balance of the contract after funds have been distributed, rather than before. The result is that the y-intercept will be decreased more than it should be, siphoning funds from all users.\\nWhen `LiquidationAccountant.sol:claim()` is called, it uses its `withdrawRatio` to send some portion of its earnings to the `WITHDRAW_PROXY` and the rest to the vault.\\nAfter performing these transfers, it updates the vault's y-intercept, decreasing it by the gap between the expected return from the auction, and the reality of how much was sent back to the vault:\\n```\\nPublicVault(VAULT()).decreaseYIntercept(\\n  (expected - ERC20(underlying()).balanceOf(address(this))).mulDivDown(\\n    1e18 - withdrawRatio,\\n    1e18\\n  )\\n);\\n```\\n\\nThis rebalancing uses the balance of the `liquidationAccountant` to perform its calculation, but it is done after the balance has already been distributed, so it will always be 0.\\nLooking at an example:\\n`expected = 1 ether` (meaning the y-intercept is currently based on this value)\\n`withdrawRatio = 0` (meaning all funds will go back to the vault)\\nThe auction sells for exactly 1 ether\\n1 ether is therefore sent directly to the vault\\nIn this case, the y-intercept should not be updated, as the outcome was equal to the `expected` outcome\\nHowever, because the calculation above happens after the funds are distributed, the decrease equals `(expected - 0) * 1e18 / 1e18`, which equals `expected`\\nThat decrease should not happen, and causing problems for the protocol's accounting. For example, when `withdraw()` is called, it uses the y-intercept in its calculation of the `totalAssets()` held by the vault, creating artificially low asset values for a given number of shares.
The amount of assets sent to the vault has already been calculated, as we've already sent it. Therefore, rather than the full existing formula, we can simply call:\\n```\\nPublicVault(VAULT()).decreaseYIntercept(expected - balance)\\n```\\n\\nAlternatively, we can move the current code above the block of code that transfers funds out (L73).
Every time the liquidation accountant is used, the vault's math will be thrown off and user shares will be falsely diluted.
```\\nPublicVault(VAULT()).decreaseYIntercept(\\n  (expected - ERC20(underlying()).balanceOf(address(this))).mulDivDown(\\n    1e18 - withdrawRatio,\\n    1e18\\n  )\\n);\\n```\\n