25 min

Repo: a loan dressed as a sale

A repo is a secured overnight loan disguised as a sale and buy-back; the price gap is the interest and the bond is collateral the lender keeps if the borrower fails.

Where you are. Lesson 11 toured the places a cash pile sleeps at night: the T-bill in the safest corner, setting the benchmark everything else is measured against, and - named on the way out but never opened - the repo. This lesson opens it. You will run both legs of an overnight repo with your own hands, price one night of interest, and meet the haircut, the small deliberate gap between what the collateral is worth and what the lender actually hands over. By the end you can say exactly who that gap protects, and from what.

The market that runs while you sleep

Every evening, two kinds of firm meet. One owns a warehouse of government bonds and is short of cash; the other sits on a pile of cash that must be somewhere safe by morning. They swap: cash one way, bonds the other. At breakfast they swap back, the cash slightly grown. Measured by the money that moves, this nightly exchange is among the largest lending markets in existence; measured by recognition, it barely exists - no ticker on the evening news, no branch, no app. Strangest of all is the fuel it runs on: not trust. The two firms need not trust each other at all, because each spends the night holding the other’s property, and that, it turns out, is all the reassurance either side requires.

The idea in one paragraph

A repo is two trades agreed in one breath and split across a day boundary. Tonight the bond-rich firm sells a bond to the cash-rich firm and the cash moves; tomorrow it buys the same bond back at a price fixed tonight, slightly higher. Read as paperwork, it is a sale and a repurchase, the two words the name squashes together. Read as economics, it is a secured overnight loan: the price gap is the interest, the bond is collateral - the thing the lender holds so the promise does not have to be trusted - and the cash lent is a little less than the bond is worth, a deliberate shortfall called the haircut, the lender’s seatbelt. The disguise is the point. Because the opening leg is a true sale, the bond already belongs to the lender; if the borrower never returns, there is no lawsuit to win and no queue of creditors to join, only the keeping of what is already held. Default here is not a process. It is possession.

Two legs, one agreement

Give the two firms from the hook their market names. The cash-rich one, call it the fund: lesson 11’s cash pile wearing a nameplate, a firm whose whole job tonight is to park other people’s money where it cannot be lost. The bond-rich one is the dealer, a word worth defining plainly: a dealer is a firm that earns its living by holding an inventory of bonds and standing ready to trade them, and an inventory that size cannot be paid for out of pocket. It is financed night by night, by borrowing against the very bonds it consists of.

The numbers from here on are stylised: round figures chosen so the arithmetic stays visible, and the same figures the exercise asserts. One bond, worth 1,000. A haircut of 2%. A rate of 4% annualised.

Tonight, the opening leg: the fund wires 980 of cash to the dealer and the dealer delivers the bond to the fund. Tomorrow, the closing leg: the dealer pays back the 980 plus one night of interest, and the fund sends the bond home. What makes this a repo rather than two ordinary trades is that both legs are agreed tonight, prices included. Tomorrow executes the agreement; it does not reopen it. Nobody wakes up and negotiates. The whole of tomorrow’s business was decided before anyone slept, which is precisely what lets both firms sleep.

Tonight: the opening leg Fund the lender of cash Dealer the borrower of cash cash 980 collateral: a bond worth 1,000 The haircut: 1,000 of collateral, 980 of cash the 20 gap is the lender's cushion for the night the day boundary; one night passes, one night of interest accrues Tomorrow: the closing leg Fund Dealer cash 980 + 0.1089 interest the bond goes home
The two legs of a repo across the day boundary: tonight 980 of cash crosses to the dealer while a bond worth 1,000 crosses to the fund; tomorrow the cash returns with 0.1089 of interest and the bond goes home, with the 20 gap between collateral value and cash lent annotated as the haircut

Wider than the screen; scroll it sideways.

The haircut is the lender’s seatbelt

Look at the opening leg’s numbers again. The fund does not lend 1,000 against a bond worth 1,000. It lends 1,000 × (1 - 0.02) = 980, and the missing 20 is the haircut: the lender hands over slightly less cash than the collateral is worth, so the loan is over-collateralised from its first second.

What is the 20 for? Name the scenario precisely, because the haircut prices exactly one. Not the dealer defaulting: default alone leaves the fund holding a 1,000 bond against 980 lent, and it can sell at its leisure. Not the bond’s price falling: a fall alone costs the fund nothing, because tomorrow the dealer buys the bond back at the agreed price regardless. The haircut prices the two together: the dealer gone and the bond falling on the same night. Then the fund sells the bond itself, and it stays whole so long as the sale fetches at least 980 - so long, that is, as the overnight fall stays inside 2%.

That is why haircuts vary with the collateral. A government bond rarely moves much between dusk and breakfast, so its haircut is small; the wilder the collateral, the wider the cut. And one honest edge to the arithmetic: if the fund’s sale fetches more than it was owed, the surplus goes back to the dealer’s estate. The haircut protects; it does not enrich.

The rate is the price of overnight cash

The closing price is higher than the opening price, and the gap is interest wearing its costume. The exercise computes one night of it the way this corner of lending does: interest = 980 × 0.04 / 360 = 0.1089. The 360 is not a typo; short-term lending counts the year as 360 days by convention, and the code divides by 360 for that reason, not by mistake. In words: take the cash actually lent, charge the annualised rate on it, and keep one 360th of the result, because the loan lasts one day.

That 4% is the price of overnight cash, secured. Two consequences follow. Because a bond stands behind every unit lent, most of the credit question has been removed, and the rate settles near the very bottom of the parking map lesson 11 drew, down in T-bill country. And because it is the price at which cash itself changes hands for a night, it is exactly the kind of rate lesson 10’s corridor exists to steer: when a central bank sets the price of money, overnight rates like this one are where the setting shows up.

Trust in neither direction

Run the failure in both directions and the design shows itself. The dealer vanishes: the fund keeps a 1,000 bond against 980 lent - protected, with room to spare. The fund vanishes: the dealer keeps 980 of cash against a 1,000 bond it will not see again - exposed, 20 short. The arrangement is not symmetric, and the asymmetry is the message. The haircut is protection taken from one side of the trade and handed to the other, and its direction tells you which loss this market bothers to price every single night: the cash lender’s, not the cash borrower’s. Neither firm trusted the other. Neither needed to; possession did the work trust would otherwise have to do.

Check yourself

1. The contract says sale and repurchase; the economics say loan. What single feature makes the loan reading the honest one?

The buy-back price is fixed at open. Whatever the bond’s market price does overnight, the fund’s return is the agreed interest and nothing more: a rise in the bond is the dealer’s gain, because the buy-back happens at the agreed price anyway, and a fall is the dealer’s loss for the same reason. A fixed return with no share in the asset’s fortunes is a lender’s payoff. The sale is costume; the payoff is the tell.

2. A 2% haircut on a 1,000 bond: who is protected, against what event, and up to what size?

The fund, the lender of cash. Not against default alone: default alone leaves it holding a bond worth more than it lent. The haircut prices the joint event, the dealer defaulting and the bond falling on the same night. Sell the bond at 980 or better, a fall of 2% or less, and the fund is whole; beyond that the seatbelt has done all it can. And if the sale brings in more than the fund was owed, the surplus goes back to the dealer’s estate; the haircut protects, it does not enrich.

3. Why does a repo default involve no lawsuit?

Because the opening leg was a genuine sale: title to the bond passed to the fund the moment the cash moved. When the dealer fails to buy it back, the fund is not a creditor petitioning a court for an asset; it is the owner of one, already in possession. Keeping what you hold requires no legal process, and removing the courtroom from the failure path is most of what the sale costume buys.

4. If the fund vanished overnight instead, what is the dealer left holding, and what does that asymmetry tell you?

The dealer keeps the 980 of cash and loses a 1,000 bond: 20 worse off, the haircut’s width exactly. The asymmetry is the design speaking: protection was deliberately moved from the borrower’s side of the trade to the lender’s, which tells you whose loss this market considers worth pricing every night. The party parting with cash gets the seatbelt; the party parting with the bond pays for it.

Do this

Work from module-01-money-at-rest. Open code/repo.py: the two firms are two dicts, the fund starting with 1,000 of cash and no bonds, the dealer with one bond and no cash. The closing leg, repo_close, is already written: it returns the cash with one night’s interest and sends the bond home. The opening leg, repo_open, is the TODO(you): lend collateral_value * (1 - haircut), move that much cash from lender to borrower, move one unit of collateral the other way, and return the amount lent.

python code/repo.py

Run unmodified, the starter dies on NotImplementedError inside repo_open; the closing leg has nothing to close until you have opened. Completed, the asserts confirm that a 2% haircut on 1,000 lends exactly 980 and that the bond spends the night with the fund, and the script ends with the line

overnight: lent 980 against 1000 of collateral, earned 0.1089; the haircut was the lender's seatbelt

One honest wrinkle to notice before you close the file: the dealer ends the run with its cash 0.1089 below zero, because the toy gives it no trading day to earn the interest from. That sliver is the nightly cost of financing an inventory, and it is why a rate that looks like crumbs per night is a number dealers watch closely. The completed version is in solutions/repo.py.

What you can now do. You can open a repo and close it: lend the collateral’s value less the haircut, charge one night of the annualised rate on a 360-day year, and reverse everything at breakfast. You can say who the haircut protects and from what, precisely: the lender of cash, against a default that lands on the same night as a fall in the collateral’s price, and only up to the haircut’s width. And you can explain the costume: the loan is dressed as a sale so that its failure path is possession rather than litigation. The next lesson leaves this secured corner for the unsecured one - commercial paper, and bank deposits above the insurance cap lesson 4 flagged - where nothing stands behind the claim but the issuer’s name, and asks what parking there earns and what it risks.

What you can now do

You can open and close a repo with a haircut and say who is protected from what.