dscrratio

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 1 Imported by: 0

README

dscr-ratio

Go Reference

Debt service coverage ratio (DSCR) — the number that decides most rental-property loans. DSCR = net operating income ÷ annual debt service. Pure, dependency-free Go math — the same engine behind the DSCRRadar DSCR loan calculator.

Install

go get github.com/theluckystrike/dscr-ratio

Quick example

package main

import (
	"fmt"

	dscrratio "github.com/theluckystrike/dscr-ratio"
)

func main() {
	ratio := dscrratio.DSCR(24_000.0, 20_000.0) // NOI / annual debt service
	fmt.Println(ratio)                          // 1.2
	fmt.Println(dscrratio.Verdict(ratio))       // "tight"

	// Monthly P&I on a $100k, 7%, 30-year loan
	fmt.Println(dscrratio.MonthlyPayment(100_000.0, 0.07, 360)) // ~665.30
}

API

Function Description
DSCR(noi, annualDebtService float64) float64 NOI ÷ annual debt service (0 if debt <= 0).
MonthlyPayment(principal, annualRate float64, months uint32) float64 Fully-amortizing fixed-rate payment.
AnnualDebtService(monthly float64) float64 monthly × 12.
Verdict(ratio float64) string fail / marginal / tight / good / strong by common DSCR lender thresholds.

License

MIT.

Documentation

Overview

Package dscrratio implements debt service coverage ratio (DSCR) math — the number that decides most rental-property loans. DSCR = net operating income / annual debt service. It is the same math behind the DSCRRadar DSCR loan calculator at https://dscrradar.com/dscr-loan-calculator/.

Quick example:

ratio := dscrratio.DSCR(24_000.0, 20_000.0) // NOI / annual debt service
// ratio ~= 1.2
_ = dscrratio.Verdict(ratio) // "tight" — 1.20-1.25 is tight for most DSCR lenders

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnnualDebtService

func AnnualDebtService(monthly float64) float64

AnnualDebtService returns the annual debt service from a monthly payment.

func DSCR

func DSCR(noi, annualDebtService float64) float64

DSCR returns noi / annualDebtService. It returns 0.0 if debt service is non-positive.

func MonthlyPayment

func MonthlyPayment(principal, annualRate float64, months uint32) float64

MonthlyPayment returns the monthly payment on a fully-amortizing fixed-rate loan (standard amortization formula).

func Verdict

func Verdict(ratio float64) string

Verdict returns a plain-language verdict for a DSCR value, matching common DSCR lender thresholds.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL