```\nfunction updateYield(uint256 vault) internal {\n    AppStorage storage s = appStorage();\n    STypes.Vault storage Vault = s.vault[vault];\n    STypes.VaultUser storage TAPP = s.vaultUser[vault][address(this)];\n    // Retrieve vault variables\n    uint88 zethTotalNew = uint88(getZethTotal(vault)); // @dev(safe-cast)\n    uint88 zethTotal = Vault.zethTotal;\n    uint88 zethCollateral = Vault.zethCollateral;\n    uint88 zethTreasury = TAPP.ethEscrowed;\n    // Calculate vault yield and overwrite previous total\n    if (zethTotalNew <= zethTotal) return;\n    uint88 yield = zethTotalNew - zethTotal;\n    Vault.zethTotal = zethTotalNew;\n    // If no short records, yield goes to treasury\n    if (zethCollateral == 0) {\n        TAPP.ethEscrowed += yield;\n        return;\n    }\n    // Assign yield to zethTreasury\n    uint88 zethTreasuryReward = yield.mul(zethTreasury).divU88(zethTotal);\n    yield -= zethTreasuryReward;\n    // Assign tithe of the remaining yield to treasuryF\n    uint88 tithe = yield.mulU88(vault.zethTithePercent());\n    yield -= tithe;\n    // Realize assigned yields\n    TAPP.ethEscrowed += zethTreasuryReward + tithe;\n❌  Vault.zethYieldRate += yield.divU80(zethCollateral);\n    Vault.zethCollateralReward += yield;\n}\n```\n