Skip to content

Creating a loan bid

For each loan request the bank receives, a loan bid can be issued.

To issue a loan bid:

  1. Navigate to the loan reuqest
  2. Click on the tab loans

Issuing a loan bid occurs in two stages:

  1. First an agent creates and configures the loan either from a Loan Template or by creating a custom one. Once the agent confirms the loan proposal, this is submitted for approval. The agent can REVOKE a loan bid whilst its still pending.
Important A loan bid can only be submitted for approval only once the loan is assigned to an agent.
  1. The loan bid is then sent for approval to a person with higher role privilages. The agent receives a notification and can either ACCEPT or REJECT the proposal.

Creating a loan bid

Configuring the loan bid

The agent can either utilise a Loan Template which the bank has preconfigured or start from scratch with a custom configuration.

Loan Bid Configuration

The following are the parameters that can be tweaked in the loan configuration

ParameterDescription
CurrencyThe currency of the current loan request
FrequencyThe frequency to use. By default this is monthly
Days In MonthThe mortgage calculator needs to establish the days in the month. Preset values are ACTUAL and 30. A custom value can be used.
Days In YearThe mortgage calculate needs to establish the days in the year. Preset values are ACTUAL or 360. The agent can specify a custom value.

Setting the loan bid

Once the configuration is in place, the agent can define a set of PERIODS. Each period will take into consideration the frequency established in the period and use that to calculate the duration value.

There are three types of PERIODS

PeriodDescription
Interest OnlyThe mortgage calculator will use the Interest Rate established to calculate the interest only period
Fixed RateIn a fixed rate period, the bank establishes a period of time the interest rate is applied.
Variable RateIn a variable rate period, the bank establishes a period of time the interest rate is applied on top of the bank base rate. Note for the purposes of the loan calculation this is worked as fixed with the interest rate calculated as interest rate + base rate

Setting charges

TODO: Coming Soon

Setting collaterals

TODO: Coming Soon

How the Mortgage Repayment Schedule Engine works

  1. The Engine is initialised with the configuration supplied as well as the periods & charges. Variables are used to keep track of the current date, remaining principal, paid interest, and month and year counters.
  2. It iterates over each period in the periods array, which represents the different periods of the mortgage.
  3. For each period, it calculates the actual interest rate based on the period type and base rate. The interest rate is divided by 100 to convert it to a decimal.
  4. Inside the period iteration, it iterates over each month in the duration of the period.
  5. For each month, it increments the current date by one month and updates the month and year counters.
  6. The Months Repayent is than calculated using the following parameters:
  • currentMonth: the month to calculate the payment for
  • loanPeriodType: the type of the loan period (e.g. 'INTEREST_ONLY')
  • interestRate: the interest rate
  • remainingPrincipal: the remaining principal amount of the loan
  • months: the number of months
  • currentDate: the current date

The function first checks if the loanPeriodType is INTEREST_ONLY. If it is, the function returns the monthly payment as the product of the remainingPrincipal and the interest rate calculated using the calculateInterestRate method.

If the loanPeriodType is not INTEREST_ONLY, the function calculates the monthly interest rate using the calculateInterestRate method and then uses the PMT function to calculate the monthly payment.

The PMT function is a financial function that calculates the payment for a loan based on the interest rate, number of periods, and present value. The syntax for the PMT function is:

PMT(rate, nper, pv, [fv], [type])

Where:

  • rate is the interest rate per period
  • nper is the number of periods
  • pv is the present value (the initial amount of the loan)
  • fv is the future value (the amount left over after the loan is paid off)
  • type is the type of payment (0 for end of period, 1 for beginning of period)

In this case, the PMT function is used with the following arguments:

PMT(MonthlyInterestRate,Months,RemainingBalance)

rate: the monthly interest rate calculated using the calculateInterestRate method nper: the number of months pv: the negative of the remainingPrincipal (since the PMT function expects the present value to be negative)

The result of the PMT function is then returned as the monthly payment.

Note that the PMT function is not actually executed as an Excel formula, but rather as a JavaScript implementation of the same formula.

  1. It calculates the interest amount for the current month by getting the product of the remaining principal with the calculated interest rate. The calculated interest rate utilises the configuration to deteremin the days in month and days in year and are used:
x=InterestRate(DaysInMonth/DaysInYear)
  1. It calculates the principal repayment amount. For INTEREST ONLY periods this is zero whilst in the other periods this is calculcated with the difference between the repayment amount and the interest amount

  2. If the period type is not 'INTEREST ONLY', it adjusts the remaining principal by subtracting the interest amount from the repayment amount.

  3. For loan configuration where days in month is set to ACTUAL, the repayment amount is averaged across the year to get it groups the schedule by year using the reduce function and filters out any empty objects. It adjusts the repayment amount for each year to make it equal across the schedule.