← SAMARIO Field Notes · Quantitative Finance № 003
▲ every symbol on the tape decodes — hover or tap one
An Animated Field Guide to Mortgage Capital Markets

The Convexity
Machine

Every mortgage quote you have ever seen was manufactured — assembled from one deep bond market, a stack of public penalty grids, and a few private margins. This is the assembly line, end to end: from the TBA tape to your rate lock, and the quant desks that hedge what falls off the belt.

Samario Torres · samario.dev · illustrative numbers throughout
0.
First Principles
A five-minute grounding — everything the machine assumes you know

Before the machine makes sense, four ideas have to. None of them needs a finance degree — each is one honest sentence with consequences. Take the five minutes; every chapter after this one stands on them.

0.1A bond is a loan you can sell

Lend someone $100. They promise you fixed interest payments — the coupon — and your $100 back at the end. That promise, written down and tradable, is a bond. The twist that powers everything on this page: the promise is fixed, but the world isn't. If new loans pay 7% and yours pays 6%, nobody will buy yours for the full $100 — the price falls until its return matches the market. Rates up, price down. Rates down, price up. A see-saw, always and exactly:

Bond price
100.0
Market yield
6.2%
PRICE YIELD
Fig. 0 — The only law. A 6.2%-coupon bond, repriced live as you move the market. The promise never changes; the price does all the adjusting. Every chart on this page is a consequence of this see-saw.
0.2A mortgage is a bond in disguise

Your neighbor's mortgage payment doesn't stay at their bank. Lenders bundle thousands of similar loans into a pool, Fannie Mae or Freddie Mac guarantees the payments (for a fee), and the pool is sold to investors as a mortgage-backed security — a bond whose coupons are, quite literally, homeowners' monthly payments. When Chapter II talks about the "TBA market," it means the giant forward market where these pools trade before they even exist: buyers commit to a generic pool — agency, term, coupon, settlement month — with the specifics "to be announced." That market's prices are the raw material every mortgage quote is machined from.

One habit of mind before moving on: an MBS has a quirk no ordinary bond has. The homeowners inside the pool can prepay — refinance whenever rates drop — which means the bond can hand your money back at the worst possible moment. Hold that thought; it becomes Chapter V.

0.3The language of points and par

Everything in this trade is quoted per $100 of loan. Three words unlock every table below:

para price of exactly 100 — the loan changes hands for face value, nobody pays a premium either way.
point1% of the loan amount. A price of 99.25 means the borrower is short 0.75 points — on a $420,000 loan, $3,150 due at closing.
basis pointone hundredth of a percent of rate. "Rates fell 50bp" means 0.50%. Prices move in points; rates move in basis points.
Cheat card. Prices in points, rates in basis points, and par is the water line.
0.4The field dictionary

Eight terms cover the rest of this page. Skim them now, come back when one bites:

Coupon
The fixed interest rate a bond pays. For an MBS, roughly the borrowers' note rate minus the fees stripped out along the way.
Yield
The return a buyer actually earns at today's price. The see-saw's other seat.
TBA
"To-Be-Announced" — the forward market for generic agency MBS pools. The deepest mortgage market on earth, and the machine's Station 1.
LLPA
Loan-level price adjustment. A published penalty grid — credit score × down payment — stamped onto every agency loan's price.
Lock
The lender's promise that your quoted rate holds until closing. A real financial commitment someone now has to hedge.
Hedge
An offsetting trade (here: selling TBA forward) so the lender doesn't lose money if rates move between your lock and your closing.
Servicing
The business of collecting payments. It's carved off the loan and has its own value — the machine credits it back at Station 3.
Prepayment
Paying a mortgage off early, usually by refinancing. The borrower's free option — and the reason this page is named what it is.
I.
The Assembly Line
One loan, five machines, one price

A mortgage "quote" is not discovered — it is computed, nightly and on demand, by a pipeline that starts in the bond market and ends at a loan officer's screen. Watch one loan go through: a $420,000 purchase, 742 credit score, 80% loan-to-value, note rate 6.875%. Prices are in points — percent of the loan amount, where 100 is par.

Example Pricing Run · 6.875% / 742 FICO / 80 LTV
STA · 1
TBA Tape
The agency MBS forward market sets the raw price of mortgage money.
STA · 2
Coupon Map
Strip servicing & guarantee fee; slot the note rate into a coupon bucket.
STA · 3
Base Price
Add servicing value, subtract hedge & delivery costs.
STA · 4
LLPA Press
Stamp on the public FICO × LTV penalty from the agency grid.
STA · 5
Overlay + Margin
Investor overlay, then the lender's own margin.
OUT
Final Price
One point on the rate stack. Repeat for every rate → Chapter IV.
Price ledger — points, per $100 of loan
UMBS 30Y · 6.0 coupon · front-month TBA100.90
map: 6.875% note − 0.25% svc − ~0.60% g-fee → 6.0 cpn
+ servicing released premium (SRP)+1.15
− hedge, delivery & buyup/buydown−0.45
= base price101.60
− LLPA · 740–759 FICO × 80 LTV (grid, Ch. III)−1.000
− investor overlay−0.125
− lender margin (branch + LO comp)−1.225
final borrower price @ 6.875%99.250
running price

99.25 means this rate costs the borrower 0.75 points. Run the same ledger at every note rate and you get the rate stack — the quote is simply the rate where the final price crosses 100. That's Chapter IV. First: where does 100.90 come from?

II.
The Root Market
TBA — the forward market where mortgage money is actually priced

There is exactly one market in this whole machine, and it isn't the one with the open houses. Agency mortgage-backed securities trade To-Be-Announced: a forward contract on a generic pool — agency, term, coupon, settlement month — with the specific pools "to be announced" two days before delivery. It is one of the deepest fixed-income markets on earth, trading over the counter through dealers. Every rate sheet in America hangs off this tape.

A pricing engine's first move is a lookup: which coupon bucket does this loan's note rate map into, and what does that coupon's front-month contract cost?

Station 2 · the coupon map

The borrower's rate, minus the servicing strip, minus the guarantee fee, leaves the security coupon. A 6.875% note becomes cash flow inside a 6.0-coupon pool; odd remainders are handled by interpolating between coupons.

Fig. 1 — The coupon curve. UMBS 30Y front-month TBA price by coupon (illustrative). Note the flattening above par: each extra 0.5 of coupon buys less price. That compression is the machine's namesake — and Chapter V explains it.
III.
The Penalty Grid
LLPAs — public, published, and stamped on every agency loan

Here is the open secret of mortgage pricing: the risk-based part is public. Fannie Mae and Freddie Mac publish their loan-level price adjustment grids — flat matrices of price hits indexed by credit score and loan-to-value, with further tables for cash-out, condos, second homes, high-balance. No model, no mystery: a lookup table anyone can download.

Our loan — 742 score, 80 LTV — takes a 1.000-point stamp. Hover the grid; the outlined cell is ours.

0 pts 2.5 pts
Fig. 2 — The LLPA surface. Purchase-loan grid, points of price by FICO × LTV (illustrative, after the 2023 recast). Darker = bigger penalty. The gradient is the credit model — frozen into a table and published.
IV.
The Rate Stack
Run the ledger at every rate; quote where it crosses par

Now run Chapter I's ledger at every note rate. The result is the artifact loan officers live inside all day: the stack. Below par (left, rust) the borrower pays points; above par (right, teal) the lender pays the borrower — a rebate that can cover closing costs. The quoted "rate" is just the row where the final price first clears 100.

Rate
← points paid · rebate →
Price
borrower pays points lender rebate par rate — the quote
Fig. 3 — One borrower's stack (illustrative). Notice the increments shrink toward the top: 12.5bp of rate buys less and less price. The coupon curve's compression, passed through the whole machine.
This is the entire product of a pricing engine: manufacture this table, correctly, for every borrower × every product × every investor, in milliseconds, all day — and stand behind it when someone locks.
V.
The Quant Room
Where the actual models live: pull-through, hedging, and the option you were given for free

The stack itself is arithmetic. The mathematics lives around it — because a rate lock is a real position. The moment a lender locks your rate, they are short a forward they must hedge with TBA sales. But your lock is optional: if rates fall before closing, you re-shop and vanish. Hedge desks model that vanishing as pull-through — the probability a lock funds, as a function of how rates have moved since.

Fig. 4 — The pull-through curve (illustrative). Rates rise after your lock → you cling to it (~97% fund). Rates fall 100bp → nearly half of locks walk. The hedge is sized on the probability-weighted pipeline, re-estimated continuously.
The hedge, in one line

Short enough TBA to offset the duration of the pipeline — where every lock i is weighted by its estimated probability of actually becoming a loan.

And the namesake. Every fixed-rate borrower holds a free American option: the right to prepay — refinance — whenever rates drop. The investor who owns the mortgage is short that option. So as yields fall and an ordinary bond's price accelerates upward, the mortgage's price compresses: why pay 106 for a pool that will refinance away at 100? The price-yield curve bends the wrong way. Negative convexity.

Fig. 5 — Negative convexity. Ordinary bond (dashed, reference) vs. MBS (rust). The gap is the value of the borrower's prepayment option. This one bend explains the coupon curve's flattening (Fig. 1), the shrinking stack increments (Fig. 3), and half of MBS quant.
The whole asset class, in one identity

An MBS is a bond minus a call option you sold to the homeowner. Valuing that option — prepayment modeling, OAS — is where the real quant headcount sits. One more model rounds out the room: best execution — for each closed loan, maximize the sale price over every exit: which investor, securitize vs. cash window, retain vs. release servicing.

VI.
The Moat
Why Optimal Blue & Polly are hard to rebuild — and what isn't

Two platforms run this machine for most of the industry: Optimal Blue, the incumbent that touches a large share of all rate locks, and Polly, the cloud-native challenger. How hard would a rebuild be? Split the question into what is code, what is content, and what is network:

Layer 1

The Code

Coupon mapping, interpolation, public LLPA grids, a rules engine, margins. Table lookups and arithmetic. Some large lenders run in-house engines. One determined engineer: weeks, not years.

Replicable in the open~90%
Layer 2

The Content

Hundreds of investor rate sheets and guideline overlays, ingested and normalized every morning, correctly, with liability when wrong. An operations franchise built over two decades — not a software problem at all.

Replicable in the open~15%
Layer 3

The Network

Investors price where the lenders lock; lenders lock where the investors price. A two-sided marketplace with binding financial commitments flowing through it. The part money alone can't buy.

Replicable in the open~5%

The asymmetry is the opportunity: the math is reproducible from public inputs — TBA-adjacent indices, published LLPA grids, FRED. What's locked up is distribution and content ops. So don't fight the network; serve the person it ignores.

  This chapter is no longer just a claim — it's a repository: github.com/s7vcengineering/convexity-machine — Layer 1 as a working, zero-dependency, test-covered pricing engine; Layers 2 and 3 as precise specifications; the whole thing run against a SOC 2-style control catalog, with exercises to rebuild each station yourself.

The machine prices you nightly.
Nothing stops us from building one that prices the market back — in the open, for the borrower.

Every input on this page is public, and the build has begun: the open engine is on GitHub — tested, audited, and waiting for your pull request — alongside the rate-sheet machine.