Sub topic 7
Revolving credit facility: draws, repayments, and availability
What you need before this chapter
This chapter assumes you can build a balance roll-forward (opening balance, movements, closing balance) and calculate interest on a balance. You should also know how the cash flow statement produces a cash figure before financing. The chapter uses Python, but every step maps directly to spreadsheet formulas.
What a revolver is
A revolving credit facility (a "revolver") is a committed borrowing line. The lender agrees to lend up to a maximum amount, called the commitment. The borrower can draw, repay, and draw again, as long as the drawn balance stays at or below the commitment.
A term loan differs in three ways:
- Term loan: repaid on a fixed schedule, and repaid amounts cannot be borrowed again.
- Revolver: repaid and redrawn freely, with no required schedule during the commitment period.
- Purpose: a term loan funds long-lived assets or acquisitions. A revolver covers short-term swings in cash.
In a model, the revolver is the plug. It is the balancing item that stops cash from falling below a floor you set. If the business burns cash, the revolver draws. If the business generates surplus cash, the revolver repays first.
The terms the model needs
| Input | Meaning | Example |
|---|---|---|
| Commitment | Maximum drawn balance | 100 |
| Minimum cash | Cash the company wants to keep on hand | 20 |
| Opening drawn balance | Amount already borrowed | 0 |
| Interest rate | Charged on the drawn balance | 6% |
| Commitment fee | Charged on the undrawn amount | Covered in the next chapter |
Availability is the amount that can still be drawn:
If availability reaches zero and cash is still short, the model has a funding gap. The revolver cannot cover it, and cash falls below the minimum. A good model shows this visibly instead of hiding it.
The core logic
Each period, the model works in four steps.
- Start with opening cash.
- Add the period's cash flow before any revolver movement. This includes operating cash flow, investing cash flow, and mandatory debt repayments.
- Subtract the minimum cash balance. The result is the surplus or shortfall.
- If there is a shortfall, draw. If there is a surplus, repay.
Written as formulas, with surplus = opening cash + cash flow - minimum cash:
- If
surplus < 0, the draw ismin(-surplus, commitment - opening revolver). - If
surplus >= 0, the repayment ismin(surplus, opening revolver).
Both cases combine into one signed number, the revolver change. A positive change is a draw. A negative change is a repayment.
The function
This function implements the logic. It takes opening cash, the period's cash flow before the revolver, the minimum cash, the opening revolver balance, and the commitment.
def revolver_step(cash_open, cash_flow, min_cash, rev_open, commitment):
# cash_flow is the period's cash flow before any revolver movement
surplus = cash_open + cash_flow - min_cash
if surplus < 0:
change = min(-surplus, commitment - rev_open) # draw, capped by availability
else:
change = -min(surplus, rev_open) # repay, capped by the drawn balance
rev_close = rev_open + change
cash_close = cash_open + cash_flow + change
return rev_close, cash_close
print(revolver_step(50, -80, 20, 0, 100)) # (50, 20): draws 50 to hold minimum cash
print(revolver_step(20, 30, 20, 50, 100)) # (20, 20): repays 30 from surplus cashWorked example: a draw
Opening cash is 50, cash flow is -80, minimum cash is 20, and the revolver is undrawn with a commitment of 100.
- Surplus = 50 + (-80) - 20 = -50.
- Availability = 100 - 0 = 100.
- Draw = min(50, 100) = 50.
- Closing revolver = 0 + 50 = 50.
- Closing cash = 50 - 80 + 50 = 20.
Cash lands exactly on the minimum, which is the intended behavior.
Worked example: a repayment
Opening cash is 20, cash flow is +30, minimum cash is 20, and the revolver has 50 drawn.
- Surplus = 20 + 30 - 20 = 30.
- Repayment = min(30, 50) = 30.
- Closing revolver = 50 - 30 = 20.
- Closing cash = 20 + 30 - 30 = 20.
The company has 30 of extra cash, and all of it goes to the revolver. Cash stays at the minimum, and 20 remains drawn.
Running several periods
A single step is easy to check. The real test is a chain of periods, where each closing balance becomes the next opening balance. This loop runs the same function over a sequence of cash flows.
def revolver_step(cash_open, cash_flow, min_cash, rev_open, commitment):
surplus = cash_open + cash_flow - min_cash
if surplus < 0:
change = min(-surplus, commitment - rev_open)
else:
change = -min(surplus, rev_open)
rev_close = rev_open + change
cash_close = cash_open + cash_flow + change
return rev_close, cash_close
cash, rev = 50.0, 0.0
commitment, min_cash = 100.0, 20.0
flows = [-80, -30, 10, 60, 90]
print("t flow revolver cash")
for t, flow in enumerate(flows, start=1):
rev, cash = revolver_step(cash, flow, min_cash, rev, commitment)
print(t, flow, round(rev, 2), round(cash, 2))Tracing it by hand:
| Period | Cash flow | Revolver closing | Cash closing | What happened |
|---|---|---|---|---|
| 1 | -80 | 50 | 20 | Draw 50 |
| 2 | -30 | 80 | 20 | Draw 30 |
| 3 | 10 | 70 | 20 | Repay 10 |
| 4 | 60 | 10 | 20 | Repay 60 |
| 5 | 90 | 0 | 80 | Repay 10, then cash builds |
In period 5 the surplus is 70 (20 + 90 - 20). Only 10 is drawn, so only 10 is repaid. The remaining 60 stays as cash, which lifts cash from 20 to 80.
Edge cases
The commitment is exhausted
Suppose the revolver is drawn at 90 of a 100 commitment, and the shortfall is 40. The draw is min(40, 10) = 10. Closing cash is then 30 below the target, so it ends at 10 if it started at the minimum of 20. The model should flag this, for example with a check cell that tests cash_close >= min_cash. Never let a capped draw pass silently.
The opening cash is below the minimum
If opening cash is already under the minimum and cash flow is positive, the surplus can still be negative. The revolver draws to restore the minimum, even in a period with positive cash flow. This is correct behavior.
Negative opening revolver
A negative revolver balance means a sign error somewhere. The repayment cap min(surplus, rev_open) prevents this. If you remove the cap, surplus cash can "repay" more than was borrowed, and the revolver becomes an asset.
Mandatory repayments belong in the cash flow
The revolver step must see the cash flow after mandatory term loan repayments. If you leave them out, the revolver draws too little. Order matters: mandatory repayments come first, then the revolver adjusts for what is left.
Interest on the revolver
For now, charge interest on the opening drawn balance:
def revolver_interest(rev_open, annual_rate, periods_per_year=1):
return rev_open * annual_rate / periods_per_year
print(revolver_interest(80, 0.06)) # 4.8 per year
print(revolver_interest(80, 0.06, 12)) # 0.4 per monthUsing the opening balance keeps the model non-circular, because the opening balance is already known when the period starts. The cost is accuracy: a draw during the period earns no interest until the next period.
How the revolver ties into the rest of the model
- Balance sheet: the closing revolver balance appears as a liability, usually under current or long-term debt depending on the facility's maturity.
- Cash flow statement: the revolver change appears in financing activities, as a draw (positive) or a repayment (negative).
- Income statement: revolver interest is an expense, and the commitment fee is added in the next chapter.
- Cash: closing cash from the revolver step feeds the balance sheet cash line.
If the balance sheet does not balance after you add the revolver, check the cash flow link first. The most common error is a revolver change that updates the debt balance but never reaches the cash flow statement.
Common errors
- Computing availability from the closing balance instead of the opening balance, which double-counts the draw.
- Forgetting the minimum cash, so the revolver draws only when cash goes negative.
- Letting repayments exceed the drawn balance.
- Mixing signs, for example storing draws as negative in one place and positive in another. Pick one convention and state it in a header.
- Hardcoding the commitment inside formulas instead of putting it in an input cell.
Exercise
Opening cash is 30, cash flow before the revolver is -45, minimum cash is 25, the opening revolver balance is 70, and the commitment is 100. What are the closing revolver balance and closing cash?
Show answer
Surplus = 30 - 45 - 25 = -40, so the model needs 40. Availability = 100 - 70 = 30, so the draw is min(40, 30) = 30. Closing revolver = 70 + 30 = 100. Closing cash = 30 - 45 + 30 = 15. Cash ends 10 below the minimum of 25 because the commitment is exhausted, so the model should flag a funding gap.
Exercise
Why does the repayment formula use min(surplus, rev_open) rather than just surplus?
Show answer
Without the cap, a large surplus would repay more than the drawn balance and push the revolver negative, which would turn it into an asset. The cap limits repayment to what is owed, and the leftover surplus stays in cash.
Exercise
With the function revolver_step, a company has opening cash 20, cash flow +15, minimum cash 20, revolver 0, commitment 100. What happens?
Show answer
Surplus = 20 + 15 - 20 = 15, which is not negative, so the model repays min(15, 0) = 0. The revolver stays at 0 and closing cash is 35. Nothing is drawn because there is no shortfall, and nothing is repaid because nothing is owed.