Underwriting accuracy
These cases are regression locks for the Dre1mery underwriting engine. Each expected value is computed by hand from the inputs shown. CI runs every case against the engine on each change; a failure means the engine is producing a wrong answer, not a rounding difference. Percentages are decimals (0.08 = 8 percent). Tolerance is 1e-6 unless stated.
Machine-readable: /underwriting-accuracy.json. Source test: tests/underwrite/golden/knownAccuracyBugs.test.js.
Operating expenses
8 percent management on $2,500 of income
Function: calculateVariableExpenses
Inputs
monthlyIncome: 2500ops: {"management":0.08}
Expected
monthlyVariableExpenses: 200
2,500 x 0.08 = 200 (not 2, which is the double-divided value).
Operating expenses
Management 8 + maintenance 5 + capEx 5 percent on $2,000 rent, all cash
Function: calculateBasicMetrics
Inputs
propertyType: Single FamilyoperationType: Buy & HoldofferType: CashpurchasePrice: 200000monthlyRent: 2000fixedMonthlyExpenses: {"taxes":200,"insurance":100}debtService: 0vacancy: 0ops: {"management":0.08,"maintenance":0.05,"capEx":0.05}
Expected
monthlyVariableOps: 360monthlyCashFlow: 1340
Variable: 2,000 x (0.08 + 0.05 + 0.05) = 360. Cash flow: 2,000 - 300 fixed - 360 = 1,340.
Operating expenses
At-a-Glance variable ops percentage
Function: computeVariableMonthlyOpsPct
Inputs
ops: {"management":0.08,"maintenance":0.05,"utilitiesPct":0.02,"capEx":0.05,"opEx":0.01}
Expected
variableOpsPct: 0.21
0.08 + 0.05 + 0.02 + 0.05 + 0.01 = 0.21. Decimals are summed, not divided by 100 again.
STR break-even
Short-term rental break-even occupancy and ADR
Function: calculateBreakEvenAnalysisSTR
Inputs
adr: 200avgNightsPerMonth: 15fixedMonthly: {"taxes":150}ops: {"management":0.1,"maintenance":0.05,"capEx":0.05}
Expected
breakEvenOccupancy: 0.03125breakEvenADR: 6.25
Fixed 150/mo = 5/day. Variable 20 percent of 200 ADR = 40/night. Occupancy = 5 / (200 - 40) = 0.03125. ADR at full occupancy = 5 / (1 - 0.20) = 6.25.
Vacancy
5 percent vacancy on $2,000 gross rent, all cash
Function: calculateBasicMetrics
Inputs
propertyType: Single FamilyoperationType: Buy & HoldofferType: CashpurchasePrice: 200000monthlyRent: 2000fixedMonthlyExpenses: {"taxes":200,"insurance":100}debtService: 0vacancy: 0.05ops: {}
Expected
grossPotentialIncome: 2000monthlyIncome: 1900vacancyLoss: 100monthlyCashFlow: 1600annualCashFlow: 19200
Vacancy loss 2,000 x 0.05 = 100. EGI 1,900. Cash flow 1,900 - 300 = 1,600/mo, 19,200/yr.
Vacancy
Variable expenses charged on post-vacancy income
Function: calculateBasicMetrics
Inputs
propertyType: Single FamilyoperationType: Buy & HoldofferType: CashpurchasePrice: 200000monthlyRent: 2000fixedMonthlyExpenses: {"taxes":200,"insurance":100}debtService: 0vacancy: 0.05ops: {"management":0.1}
Expected
monthlyVariableOps: 190monthlyCashFlow: 1410
EGI 1,900 x 0.10 = 190. Cash flow 1,900 - 300 - 190 = 1,410.
IRR period
Buy 1,000, receive 100/yr for 5 years, sell for 1,000 at year 5
Function: calculateIRR
Inputs
initialInvestment: -1000cashFlows: [100,100,100,100,100]saleProceeds: 1000
Expected
irr: 0.1
Par bond identity: a 10 percent coupon redeemed at par yields exactly 10 percent. Discounting the sale one period late gave 8.66 percent.
IRR period
Buy 1,000, no interim cash flow, sell for 1,210 after 2 years
Function: calculateIRR
Inputs
initialInvestment: -1000cashFlows: [0,0]saleProceeds: 1210
Expected
irr: 0.1
1,000 x 1.1^2 = 1,210, so IRR = 10 percent.