```\n        if (balance >= borrows) {\n            collateral += min(balance - borrows, info.maxCollateralAmount).mul(info.collateralWeight).mul(price);\n        } else {\n            debt += (borrows - balance).mul(info.debtWeight).mul(price);\n        }\n```\n