Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@u-dev/unison-calculators

Package Overview
Dependencies
Maintainers
11
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@u-dev/unison-calculators

Node.js module for Unison calculators

  • 1.0.10
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
11
Weekly downloads
 
Created
Source

unison-calculators

Scenario Calculator

HomeBuyerScenarioCalculator

The HomeBuyer scenario calculator can be used to calculate the outcome of a homebuyer deal.

To get started initialize a HomeBuyerCalculator instance and run the #calculate function.

For instance, I could run:

let calculator = new HomeBuyerScenarioCalculator()
calculator.calculate(500000,50000,100000,{
  isNewConstruction: false
})

And expect

{
  finalPriceChange: 100000,
  initialHomeValue: 500000,
  unisonInvestment: 50000,
  unisonLeverage: 4,
  unisonSharingPercentage: 0.4,
  unisonInvestmentPercentage: 0.1,
  futureSalePrice: 600000,
  unisonPayment: 90000,
  unisonShareInChange: 40000
}

API documentation:

// .initialize
new HomeBuyerScenarioCalculator()

// #calculate()
// @param {number} initialHomeValue - The initial home value
// @param {number} unisonInvestment - The amount unison has invested
// @param {number} finalPriceChange - The change in value you want to calculate for
// @param {object} [options={}] - optional modifiers for calculations
// @param {boolean} [options.isNewConstruction=false] - toggles pricing (non-new construction homes have better pricing)
calculator.calculate(500000, 50000, 100000, {
  isNewConstruction: false
})
HomeOwnerScenarioCalculator

The HomeOwner scenario calculator can be used to calculate the outcome of a homebuyer deal.

To get started initialize a HomeBuyerCalculator instance and run the #calculate function.

For instance, I could run:

let calculator = new HomeOwnerScenarioCalculator()
calculator.calculate(500000, 50000, 100000, {
  qualifiesForNewPricing: false
})

And expect

{
  finalPriceChange: 100000,
  initialHomeValue: 500000,
  unisonInvestment: 50000,
  unisonLeverage: 4,
  unisonSharingPercentage: 0.4,
  unisonInvestmentPercentage: 0.1,
  futureSalePrice: 600000,
  unisonPayment: 90000,
  unisonShareInChange: 40000
}

API documentation:

// .initialize
new HomeOwnerScenarioCalculator()

// #calculate()
// @param {number} initialHomeValue - The initial home value
// @param {number} unisonInvestment - The amount unison has invested
// @param {number} finalPriceChange - The change in value you want to calculate for
// @param {object} [options={}] - optional modifiers for calculations
// @param {boolean} [options.qualifiesForNewPricing=false] - toggles pricing (this is new pricing A.K.A. purchased in last year, which has better pricing)
calculator.calculate(500000, 50000, 100000, {
  qualifiesForNewPricing: false
})

Mortgage Calculators

HomeBuyerMortgageCalculator

The homebuyer mortgage calculator can be used to calculate mortgage payments with and without Unison.

To get started, initialize a new calculator with (optionally) an object containing any assumptions you want to overwrite.

You can then use the #calculate function to see payment outcomes for various combinations.

For instance, I could run:

var calculator = new HomeBuyerMortgageCalculator({assumptions: {mortgageYears: 30}})
calculator.calculate(500000,.1,.1)

And expect:

{
  assumptions: {
    mortgageYears: 30,
    annualMortgageInsurancePremium: 0.0074,
    annualMortgageInterestRate: 0.04,
    annualPropertyInsuranceRate: 0.003,
    annualPropertyTaxRate: 0.0125,
  },
  monthlyMortgagePayment: -1910,
  monthlyPMIPayment: 0,
  monthlyPropertyTaxPayment: -521,
  monthlyPropertyInsurancePayment: -125,
  totalMonthlyPayments: -2556,
  clientDownPaymentAmount: 50000,
  unisonDownPaymentAmount: 50000,
  downPaymentAmount: 100000,
  hasPMI: false,
}

Here are the default assumptions for any new calculator:

const DEFAULT_ASSUMPTIONS = {
  mortgageYears: 30,
  annualMortgageInterestRate: .04,
  annualPropertyTaxRate: .0125,
  annualPropertyInsuranceRate: .003,
  annualMortgageInsurancePremium: .0074,
}

API documentation:

// @param {object} [options={assumptions={}}] - The default set of options
// @param {number} [options.assumptions.mortgageYears] - Length of mortgage in years
// @param {number} [options.assumptions.annualMortgageInterestRate] - Annual loan interest rate
// @param {number} [options.assumptions.annualPropertyTaxRate] - Annual property tax rate
// @param {number} [options.assumptions.annualPropertyInsuranceRate] - Annual property insurance rate
// @param {number} [options.assumptions.annualMortgageInsurancePremium] - PMI rate
new HomeBuyerMortgageCalculator(options)

// @param {number} homePrice - The initial home value
// @param {number} clientDownPaymentPercentage - The percent of the loan, expressed as a decimal, that the client paid down
// @param {number} unisonDownPaymentPercentage - The percent of the loan, expressed as a decimal, that unison paid down
calculator.calculate(500000,.1,.1)

FAQs

Package last updated on 13 Feb 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc