Vulnerability: Pending keeper and position fees are not accounted for in vault collateral calculation which can be abused to liquidate vault when it's small
Severity: medium

Description:
Vault opens positions in the underlying markets trying to keep leverage at the level set for each market by the owner. However, it uses sum of market collaterals which exclude keeper and position fees. But pending fees are included in account health calculations in the `Market` itself.\\nWhen vault TVL is high, this difference is mostly unnoticable. However, if vault is small and keeper fee is high enough, it's possible to intentionally add keeper fees by depositing minimum amounts from different accounts in the same oracle version. This keeps/increases vault calculated collateral, but its pending collateral in underlying markets reduces due to fees, which increases actual vault leverage, so it's possible to increase vault leverage up to maximum leverage possible and even intentionally liquidate the vault.\\nEven when the vault TVL is not low but keeper fee is large enough, the other issue reported allows to set vault leverage to max (according to margined amount) and then this issue allows to reduce vault collateral even further down to maintained amount and then commit slightly worse price and liquidate the vault.\\nWhen vault leverage is calculated, it uses collateral equal to sum of collaterals of all markets, loaded as following:\\n```\\n// local\\nLocal memory local = registration.market.locals(address(this));\\ncontext.latestIds.update(marketId, local.latestId);\\ncontext.currentIds.update(marketId, local.currentId);\\ncontext.collaterals[marketId] = local.collateral;\\n```\\n\\nHowever, market's `local.collateral` excludes pending keeper and position fees. But pending fees are included in account health calculations in the `Market` itself (when loading pending positions):\\n```\\n    context.pendingCollateral = context.pendingCollateral\\n        .sub(newPendingPosition.fee)\\n        .sub(Fixed6Lib.from(newPendingPosition.keeper));\\n// rest of code\\n    if (protected && (\\n        !context.closable.isZero() || // @audit-issue even if closable is 0, position can still increase\\n        context.latestPosition.local.maintained(\\n            context.latestVersion,\\n            context.riskParameter,\\n@@@         context.pendingCollateral.sub(collateral)\\n        ) ||\\n        collateral.lt(Fixed6Lib.from(-1, _liquidationFee(context, newOrder)))\\n    )) revert MarketInvalidProtectionError();\\n// rest of code\\n    if (\\n@@@     !context.currentPosition.local.margined(context.latestVersion, context.riskParameter, context.pendingCollateral)\\n    ) revert MarketInsufficientMarginError();\\n\\n    if (\\n@@@     !PositionLib.maintained(context.maxPendingMagnitude, context.latestVersion, context.riskParameter, context.pendingCollateral)\\n    ) revert MarketInsufficientMaintenanceError();\\n```\\n\\nThis means that small vault deposits from different accounts will be used for fees, but these fees will not be counted in vault underlying markets leverage calculations, allowing to increase vault's actual leverage.

Impact:
When vault TVL is small and keeper fees are high enough, it's possible to intentionally increase actual vault leverage and liquidate the vault by creating many small deposits from different user accounts, making the vault users lose their funds.

Recommended mitigation:
Consider subtracting pending fees when loading underlying markets data context in the vault.