dscrcalc 0.1.0

dscrcalc is a small D library for the underwriting arithmetic on income-producing commercial property. Lenders size these loans off the debt-service-coverage ratio, and the rest of the metrics follow from the same few numbers on a rent roll. Nine public functions. monthlyPayment and annualDebtService give the payment on a fully amortizing mortgage. dscr divides net operating income by annual debt service, and dscrVerdict buckets the result against the thresholds lenders commonly quote. breakEvenOccupancy finds the occupancy at which coverage is exactly 1.0. maxLoanFromDscr inverts the payment formula to find the largest loan a given NOI supports at a target coverage, and maxLoanFromCapRate does the same from value and an LTV cap. valueFromCapRate capitalizes NOI at a cap rate. cashOnCash divides annual pre-tax cash flow by cash invested. Every function is @safe pure with input contracts on the arguments that must not be negative. Eight unittest blocks, no dependencies, MIT licensed.

Tags d dlang library finance real-estate lending
License MITL
State initial

Recent Releases

0.1.008 Aug 2026 17:20 minor feature: Initial release. DSCR with a bucketed verdict, amortizing debt service, break-even occupancy, maximum loan from a target DSCR or an LTV cap, value from a cap rate and cash-on-cash return. Nine public functions, eight unittest blocks, no dependencies.