Last week, I wrote about what I consider to be a key driver in the recent uptick in long-dated contracts: rising interest rates. It was a math-y and abstract article, and I wouldn’t blame you for getting a few paragraphs in, noting the sheer volume of numbers and calculations, and moving on with your life. But if you didn’t do that, hold onto your butts, because it’s time to take the financial angle up a notch.

The main takeaway of that previous article was that when interest rates are high, money in the future is worth less in present value, so teams that look at their books in terms of net present value will perceive long-term contracts as a smaller liability. The easy way of thinking about this is by imagining a team funding a contract upfront by buying bonds and holding them to pay out each future year of a player’s contract. You have to spend much less money today to fund future obligations than you would’ve had to spend if interest rates were much lower, as they were for the entire previous decade.

That’s not realistic, though, because teams don’t pre-fund contracts with treasury bonds. They have better stuff to do with any money sitting around, like buying real estate developments or lobbying senators. Most teams have debt outstanding, too; if they had a huge chunk of change sitting around, they’d look for new investments first, then think about retiring debt, then think about buying out minority owners, and probably prioritize buying treasury bonds only slightly higher than lighting the money on fire.

That presents a problem, because a change in interest rates can erode some or all of the value in signing long-term deals. Let’s use the same examples from last week’s article. At current risk-free discounting, Carlos Correa‘s deal with the Giants is worth $285.4 million in present-day dollars. If rates were instead at last year’s levels, it would be worth $320.9 million in present-day dollars. That’s a $35.5 million hit to San Francisco’s books if rates ticked back down to a year ago’s levels tomorrow – and interest rates have spent a lot more time in the 1-2% range than the 3-4% range in the past 15 years.

You can see the issue here: are these “savings” really worthy of the name if they can evaporate thanks to uncontrollable and unpredictable fluctuations in interest rates? A long-term contract signed two years ago would look just as good on the books now as Correa’s deal, and if rates plummet back towards zero tomorrow, they’ll both look equally onerous in present value terms.

But fear not, Giants balance sheet fans: there’s a way around this bind. It’s called an interest rate swap, and to explain it, I’m going to start with a bond. One useful characteristic of bonds is that their price changes in an inverse relationship with interest rates. If interest rates decline, the price of bonds goes up, and vice versa. If the Giants own enough bonds to pay off Correa’s contract and interest rates decline, the increase in value of those bonds will offset the increased present value cost of his contract.

Think of it this way: if you bought a 10-year bond today that paid you 3.5% interest, that would be roughly market rate; you’d probably have to pay roughly $100 for it, get $100 when it matured, and receive 3.5% interest every year. But if overall rates declined by quite a bit, your bond would be worth more, because that 3.5% interest is higher than what you’d be able to get on new bonds. If prevailing interest rates are 1.5%, something that pays 3.5% will command a premium. You can also think of it in a discounted cashflow framework if you want; the present value of receiving a string of $3.50 payments is much higher if those payments get discounted at 1.5% instead of 3.5%.

One way to take advantage of this would be to buy bonds using borrowed money. Imagine, for the sake of this example, that you wanted to buy $100 of a 10-year treasury note but don’t have $100. You come to me and ask to borrow $100 for a year. In one year, you ask to borrow $100 for another year, repeating this process until the bond matures and you pay me back.

What interest rate would I charge you? If you were just Joe FanGraphsReader, I’d charge you more than the risk-free rate, so this trade wouldn’t work out for you. You’d be paying more money to me than you’d get from the bond. But ah! You’re a clever financial professional, and you offer me the bond as collateral. It’s a lot easier for me – or a financial institution, in real life – to lend money at risk-free rates if they can hold risk-free collateral against it.

Suppose, then, that you manage to borrow this money from me for 10 years, with each one-year loan bearing the market risk-free rate. We can calculate how much money you’d make or lose on this deal fairly easily. On day one, you borrow $100 and spend $100 buying the bond – no profit or loss there. In 10 years, you receive $100 from the bond and pay me back $100 – again, no profit or loss. The in-between interest payments are where the money is made.

I’m doing a lot of simplification here to make the math easier, so this isn’t quite how it works in the real world, but imagine that interest rates decline and you pay me an average of 2% on your 10 one-year loans. Let’s further say that your bond pays 3.5% interest. Every year, you’d pay $2 to me, receive $3.50 from the bond, and make $1.50 in profit. If the average interest rate on those loans was $3.50, you’d end up flat, paying me the money you made from the bond every year. If interest rates ballooned to an average of 5% over the next 10 years, you’d lose $1.50 a year.

The expected value of this exchange of cash flows – the cost of borrowing against the return on the bond – works out to zero if you make some fairly boring assumptions. Just to put a name on them, that’s no risk premium, no specialness, flat compounding, no transaction costs, and no haircuts. The exact meaning of those terms isn’t important for now. The point is, for a first approximation, borrowing money to buy a bond, pledging that bond as collateral, and rolling short-term funding until maturity won’t cost or make you any money if interest rates don’t change. If they decline, you’ll make money, and if they go up, you’ll lose.

If you think about it that way, it makes a great hedge for a future cash flow. Worried that interest rates will decline and make the $26.92 million you owe your shortstop in 12 years more expensive in today’s dollars? You could theoretically buy some bonds with borrowed money to hedge that risk. If rates go back to the lows, the present value of that payment would increase, costing you some expected value; your liabilities would have more present value than you thought they would. On the other hand, you’d make some money on your bond hedge; you’d make more in coupon payments than you’d owe in interest payments.

Conveniently, the reverse is also true. If interest rates continued to rise, the present value of that future liability would decline – hooray! On the other hand, you’d lose money on your bond hedge; the coupon payments wouldn’t offset the interest payments on your short-term borrowing. Carefully weight your hedge, and you could be completely indifferent to the change in interest rates; you could make enough money in the case where rates decline to offset any losses in contract present value, and lose enough money in the case where rates increase to offset any gains.

Just one problem: that laundry list of assumptions I made doesn’t hold in real life. Just to name an obvious problem, no lender would do this without what’s known as a haircut – in other words, if you wanted to borrow $100 dollars, they’d ask for $102 worth of collateral. It’s like buying a house and taking out a mortgage; it’s hard to do with no money down. Banks, the lenders in question, also charge for the use of their balance sheet. There are payments to handle, and there probably aren’t perfectly-dated bonds with the exactly correct coupons and maturities to match Correa’s contract; there are all kinds of small problems that would both make your hedge cost more and make it less effective.

Luckily, some intrepid bankers came up with a solution to this problem a long time ago. The general end goal – some exchange of cash flows that could hedge interest rate risk – is something companies have always wanted. The solution, as it turns out, was obvious: just sign a contract where both parties agree to do the coupon-versus-lending-part of the deal, without any bonds actually being involved. That contract is called an interest rate swap.

Let’s go back to our previous example. If you wanted to receive a 3.5% coupon every year for 10 years, I’d simply agree to pay it to you. In exchange, you’d agree to pay me a floating one-year rate each year. No messy use of bonds as collateral, no need to have a loan outstanding and a bond purchased, no need to deal with a mismatch between when the bond matures and when your payment is due. We don’t even have to exchange the $100 upfront or at the end of the deal. It’s just a simple contract: I pay you a fixed rate, and you pay me a floating rate. In practice, it’s even simpler than that; we simply exchange the difference in rates each time rather than each paying the other.

How do we figure out which floating rate to use? It’s easy: we agree on what’s called a reference rate upfront. They’re published rates that reflect general funding conditions. The old standard was LIBOR, but SOFR, the Secured Overnight Funding Rate, is now prevalent. It’s a rate that the Federal Reserve publishes every day, reflecting the average interest rate at which people borrow money when they post treasury notes and bonds as collateral.

It’s magical, really. If you’re a big enough counterparty, with a prime broker that gives you access to the world of exchange-cleared interest rate swaps, you can enter into one of these contracts at the snap of a finger. You can hedge whatever interest rate risk you’d like, removing the risk of a long-term contract looking more costly if inflation snaps back down next year. You could do the opposite, too. If you were planning on *receiving* a big pile of money in 10 years and were worried about high inflation and high interest rates, you could enter into the opposite transaction: pay a fixed rate and receive a floating rate in exchange.

I’m finding it hard to hold back here, because my first instinct whenever I start talking about rates is to babble. I want to tell you about DV01, or the dollar value of a one basis point move in rates, the standard measure of risk used across fixed income. I want to tell you about the beautiful concept of convexity, which blew my mind the first time someone explained it to me. When you discount future cash flows to the present, lower rates mean that money receivable in the future is worth more now. If you bet on low rates and win, your winnings are worth more because they’re discounted at a lower rate. If you bet on higher rates and win, your winnings are worth less, because they’re discounted at a higher rate. What a mathematical trip. I want to tell you about cross-currency basis swaps and bond future basket roll-in trades and the competing theories on how best to hedge as a swaps market maker.

But even for me, that’s too far away. I’ve rambled on long enough here already. If you take away only one thing from this article, let it be this: if teams are worried about the changing interest rate environment ruining their clever long-term contract schemes, they can make that worry disappear in a heartbeat, at very low cost to them. I don’t know for certain which teams are using swaps to hedge rate risk, but I’m willing to bet that some are, perhaps even all. These are big complex companies, with complex finances. They plan for the future and make investments whose returns vary based on interest rates. If there’s an edge to be found by issuing long contracts, they’ll find it. If there’s a risk to that edge based on interest rate volatility, they’ll hedge that risk.

It’s really cool, if you ask me: a hidden game of baseball well beyond what happens in plain sight every day. It doesn’t really affect who wins or loses in a given game. It’s at best peripherally linked to that, in fact. But if you’re like me, you love knowing how things work, love pulling apart machines to see what makes them tick. I love baseball first and foremost for what happens on the field. But that doesn’t mean I can’t appreciate all the wonderful complexity that surrounds those 10 men playing a child’s game in pajamas.