Rufineer v0.48.0
Account
Browse the docs

Start here

Guide

Sign in, start your first model in the browser, grow it from a blank model into a project with its statements, learn the project layout, and export an Excel workbook.

Getting started

Rufineer is to a project finance model what Rails is to a web application: a project layout every model shares, generators that add a piece where it belongs, and conventions that write the plumbing. You write what the project earns, costs, builds and borrows, and say what each line is; Rufineer writes the sources and uses, depreciation, tax, the income statement, the cash flow and its debt waterfall, the balance sheet, the returns and the checks, and exports it all as a FAST-standard Excel workbook with live formulas.

A model is a folder of text files, and you write it in your browser, in the app at /app. Nothing needs installing: the compiler and the calculations run in the page, so the model compiles and solves as you type, a preview beside the editor shows the results and the sheets, and every value can be audited. Your models are kept with your account. With Pro, Export to Excel gives the workbook.

  1. Sign up, or sign in, on this website (your account). Writing, checking and previewing models is free.
  2. New model… in your models: give it a name and Create model. It starts blank, for you to write line by line (Tutorial 1).
  3. Write the model's .rfn files in the editor, and watch the preview beside it: it recompiles and solves as you type (below).
  4. Export to Excel (with Pro): the solved, FAST-standard workbook, downloaded by your browser.

What Rufineer does for you

  • The statements, written for you. Say what each line is (revenue, cost, capex, a loan) and Rufineer writes sources and uses, tax, the statements, a waterfall in the order of the loans, the returns and the checks. Change any line by writing your own.
  • What a lender's model needs. Costs in several currencies, converted each period (convert) at rates bought forward (fx); a loan's rate swapped (swap); VAT capitalised, refunded or paid by a VAT facility; tax holidays, losses that lapse, an interest cap, a minimum tax and withholding tax; accelerated allowances (VAT, tax, currencies). The example Kariba Solar has all of it.
  • Units, checked. USD, MWh, %/y, USD/kWh. Per-year figures are converted to each period for you, and sums that make no sense don't compile.
  • No iterative calculation. solve splits a circular reference into calculated, pasted and difference rows. A macro written into the workbook settles it.
  • FAST layout, every time. Every number on the Inputs sheet, a Timing sheet, one sheet per module with its imports at the top, and no cross-sheet references inside calculations.
  • Lenders' cases in one click. Sensitivities run case by case in the workbook, with the loan kept at its base-case size. A case that changes nothing is flagged.
  • An editor that knows finance. The app underlines errors as you type, shows each line's formula in names when you hover, goes to a line's definition (F12) and its readers (⇧F12), completes names after a dot, each function's arguments and the values they take, units and modifiers, and formats every file the same way (The workspace).

The workspace

1. Your models

Your models lists the models in your account, the last changed first. New model… asks for a Name and makes a blank model: model.rfn, one small module in ops.rfn and checks.rfn. Import a .zip… makes a model from a .zip of a model's folder: its .rfn files, data workbooks (.xlsx) and notes (.md). Each model can be opened, renamed, downloaded (a .zip of its files) or deleted. Models are saved as you type and kept with your account.

2. The editor and the preview

Opening a model opens its workspace. The model's files are in the file tree on the left: a click opens a file, a double click keeps it open in a tab. + makes a new file, XL+ imports an Excel workbook (or drop one on the page), and right-clicking a file offers Open, Download, Copy path, Rename… and Delete…. Code, Split and Preview at the top (⌘1, ⌘2, ⌘3; Ctrl+1, 2, 3) show the editor, both side by side, or the preview; ⌘B shows or hides the files. The model recompiles and solves as you type, in your browser.

The status at the top says whether the model compiles and its checks pass; the preview's tabs show the Overview (results and charts), the Inputs (to try values and switches without changing the files), the Sheets as Excel will lay them out, the Sensitivities (Run sensitivities), the Checks, the Problems and what the Conventions wrote. Click any value to audit it. In the editor, problems are underlined as you type; hover a name to see its formula, F12 goes to where it is declared and ⇧F12 lists what reads it, ⇧⌥F (Shift+Alt+F) formats the file and ⌘P goes to a file. It saves by itself; ⌘S saves at once, and ⌥W (Alt+W) closes the tab.

The commands that add to a model (generate, conventions, explain, data) run in the Console (⌘K; Ctrl+K), under the editor, with or without rfn in front (The console). + Generate beside it adds a module or a line from a form.

3. Free, and Pro for the export

Writing, checking and previewing a model is free: the editor, the preview, the audit, the sensitivities, the console, and your models kept with your account and downloadable any time. Export to Excel, the solved, lender-grade workbook with its macros, is part of Pro, a monthly subscription (pricing). The workbook is built by Rufineer's service: choose Export to Excel at the top right of the workspace, or type build in the console, and your browser downloads it.

Your first model

Every model starts blank: New model… writes a small model that already builds, with one module of revenue and costs. This section grows it into a project with construction, a loan, tax and its three statements, in a few edits and two console commands. The files shown are exactly what the app writes, and the test suite replays every step: the model compiles, and every check passes.

1. Create the model

In your models, choose New model…, name it My model and choose Create model. The model opens, with these files in the file tree:

Output
my_model/
├── model.rfn        the model: currency, timeline, sheet order
├── ops.rfn          Operations: revenue and costs (its inputs), then its lines
├── checks.rfn       your own checks and alerts
└── README.md

Each module is one file, and one sheet in the workbook: its inputs first, which go on the Inputs sheet under the module's title, then its calculations. Project layout has the rules.

2. The model and its timeline

model.rfn
// model.rfn: what the model is, and its timeline.
//
// Each module is one file, its inputs then its calculations, and one sheet
// in the workbook (ops.rfn: Operations). A module that grows can be a
// folder of files instead (debt/senior.rfn, debt/reserves.rfn).
//
// Add a module with + Generate, or `generate module <name>` in the Console.

model "My model" {
  currency  USD
  display   thousands
  day_count act/365
  sheets    [ops]
}

timeline {
  start        2027-01-01
  step         quarter
  construction 12m
  operations   20y
}

The timeline is quarterly: twelve months of construction from January 2027, then twenty years of operations. sheets sets the order of your calculation sheets; the ones Rufineer writes follow them.

3. A module

A module is one file: its numbers first, in inputs blocks, then its workings, in the module block.

ops.rfn
// ops.rfn: the ops module: its inputs (on the Inputs sheet), then its
// calculations (one sheet in the workbook).

inputs "Operations" {
  revenue = 1_000_000 USD/y | grow 2.0 %/y from operations.start
  costs   = 400_000 USD/y | grow 2.5 %/y from operations.start
}

module ops "Operations" {
  revenue: USD = inputs.revenue | during operations
  costs:   USD = inputs.costs   | during operations
  ebitda:  USD = revenue - costs
}

The inputs are amounts a year, growing each year from the start of operations. Each line says its unit: revenue is declared in USD and its input in USD a year, so the compiler takes each quarter's share of the year and shows that term in the formula. | during operations keeps a line at zero while the plant is built. The preview beside the editor calculates as you type: change revenue to 1_200_000 USD/y and the Operations sheet in the preview's Sheets tab changes with it.

4. The checks

checks.rfn
// checks.rfn: checks fail the master check; alerts only warn.

alert "Operating loss" ops.ebitda >= 0 | during operations

Checks fail the master check; alerts only warn. This one warns in any quarter of operations where the costs are more than the revenue.

5. Say what the lines are

So far Rufineer knows each line's unit, not what it is. Say it, and Rufineer writes the statements. In ops.rfn, replace the three lines of the module block with:

ops.rfn
  revenue sales = inputs.revenue | during operations
  cost opex     = inputs.costs   | during operations

revenue sales is a line named sales that is revenue, cost opex one that is a cost: that is all Rufineer needs to put them in the income statement and the cash flow. EBITDA needn't be written any more: Rufineer writes it in the income statement, so the alert reads it from there. In checks.rfn:

checks.rfn
alert "Operating loss" income.ebitda >= 0 | during operations

The model builds again, now with an income statement, a cash flow and a balance sheet. The preview's Conventions tab shows what Rufineer wrote, as Rufineer; conventions income in the console prints the income statement.

6. Construction and a loan

Add a capex line named plant, then a loan named senior, in the console (⌘K; the rfn is optional):

Terminal
$ rfn generate capex plant
  create  capex.rfn
  update  model.rfn (sheets: ops, capex)
  insert  capex.rfn
  insert  capex.rfn
$ rfn generate loan senior
  create  debt.rfn
  update  model.rfn (sheets: ops, capex, debt)
  insert  debt.rfn
  insert  debt.rfn

Each generator adds a line of its kind at the end of the module it belongs in (--in another), making the module's file and adding it to sheets when there's none, and its inputs in a block above the module, with placeholder numbers: a plant costing 1,000,000 USD, spread over construction and depreciated over 25 years once it runs, and a loan that pays for 10% of the uses (the construction costs and the interest while building) at 10% a year, repaid in equal instalments over 10 years from the start of operations (share capital pays the rest). Replace them with your project's. + Generate does the same without the console. Revenue, cost, cost of sales, other income, capex, loan and reserve can be generated; Conventions has everything a loan and a reserve can say.

7. Tax

Rufineer charges tax on the profit once the model has a rate. In model.rfn, add it to the model block:

model.rfn
  tax       25 %

To have the rate on the Inputs sheet instead, write tax inputs.tax_rate and put tax_rate = 25 % in an inputs block.

8. What Rufineer writes

From those lines, Rufineer writes the sources and uses of funds, the fixed assets and their depreciation, the tax, the income statement, cash flow and balance sheet (by quarter and by year), the returns (the project and equity IRRs, and the senior loan's DSCR) and the checks every such model needs: sources equal uses, the balance sheet balances, cash never goes negative. It writes a dashboard too, because the project has none of its own.

To change any of it, write it yourself: a line in a module named cashflow replaces the line of that name, your own dashboard replaces Rufineer's (Conventions has the list).

9. Export

The status says Compiles · checks OK, and the Overview shows the results as you change the files. With Pro, choose Export to Excel at the top right (or type build in the console); your browser downloads the workbook:

Output
my_model.xlsm
  Dashboard       master check, alerts, key results
  Navigator       a link to every sheet and input group; every sheet's Navigate button comes back here
  Inputs          every number
  Input tables  Timing  Indexation
  Ops  Capex  Debt                                  your modules
  Sources and uses  Fixed assets  Tax               what Rufineer writes …
  Income statement  Cash flow  Balance sheet  Returns
  Annual income  Annual cash flow  Annual balance sheet   … and the statements by year
  Checks

Open the file in Excel: it opens solved, with live formulas. The Solve macro settles the model again after you change an input in Excel (enable macros when Excel asks).

Next

Tutorial 1 builds a wind farm this way, from a blank model to a lender's model, explaining each line as it goes.

Project layout

Every Rufineer project has the same shape, so you always know where a line goes and where to find it.

Output
my_model/
├── model.rfn          what the model is: name, currency, tax, timeline, sheet order
├── ops.rfn            a module: its inputs blocks first, then module ops "Operations" { … }
├── capex.rfn
├── debt.rfn
├── reports.rfn        statements, dashboard, sensitivities (when you want them)
├── checks.rfn         your own checks and alerts
└── data/tables.xlsx   tables too long to type, when there are any

Three rules

  1. One module, one file, one sheet. debt.rfn holds its inputs blocks, then module debt, and becomes the Debt sheet. Its inputs go on the Inputs sheet, under the module's title.
  2. A number is an input. Calculations only combine inputs and other lines. A number typed into a calculation is moved to the Inputs sheet anyway.
  3. sheets in model.rfn sets the order of the calculation sheets. The Inputs sheet follows the same order.

A module that grows can be a folder instead: debt/senior.rfn, debt/mezzanine.rfn and debt/reserves.rfn each write module debt { … }, with inputs blocks of their own if they need them, and the parts make one module and one sheet, in the order sheets lists them (sheets [ops, capex, debt/senior, debt/mezzanine, debt/reserves]). See The shape of a model.

The first layout, each module's numbers in inputs/ops.rfn beside its workings in calculations/ops.rfn, and outputs/ for the rest, still compiles exactly as before. In the app, the menu (☰) of a model laid out that way has Use one file per module…, which moves the files: inputs/x.rfn and calculations/x.rfn become x.rfn, outputs/checks.rfn becomes checks.rfn and the other outputs reports.rfn. Nothing changes in the workbook: the same sheets, and every number the same.

Generators

A module named reserves, with the title Debt service reserve:

Terminal
$ rfn generate module reserves "Debt service reserve"
  create  reserves.rfn
  update  model.rfn (sheets: ops, capex, debt, reserves)

The new file starts with a commented-out inputs block to fill in, then an empty module reserves "Debt service reserve" { }. A line of a kind goes where it belongs, with its inputs in the inputs block above the module: a revenue into ops, capex into capex, loan and reserve into debt (making the module if it isn't there; --in to choose another). generate dashboard and generate case write into reports.rfn. Names are lower case (letters, digits and _); keywords, sheet names and the timeline's phases are refused. g is short for generate. In a model in the first layout, the generators write there, as before.

How the files are read

All the files make one model: any line can use any other by its full name (debt.senior, cashflow.cfads), whichever file it is in, and whether you wrote it or Rufineer did. The compiler reads model.rfn first, then the modules' files and folders in the order of sheets, then the rest by name. A model is a plain folder: Download the model's files (.zip) in the menu (☰) gives it to you as it is, to keep in git or send to a reviewer, and Import a .zip… brings a folder with a model.rfn back in.