Mortgage interest rates are set by mortgage lenders. The higher the interest rate, the more money the mortgage lender makes for loaning a mortgage borrower the funds she needs to buy a home. Rates change daily, sometimes hourly (which is why mortgage lenders offer rate locks during the mortgage application process.)

Mortgage lenders set their own interest rates. But lenders don’t set mortgage interest rates by pulling a random number out of a hat. So how do they do it? There are several factors that go into determining the mortgage interest rate lenders charge.

Federal Funds Rate

When you read financial headlines about interest rates being raised or lowered, most of the time the rate you’re hearing about is the Federal Reserve’s benchmark federal funds rate.

Banks are required to keep a minimum amount of cash on the balance sheet. If a bank finds themselves a little bit short of the minimum at the end of the day? The bank can take out a short term overnight loan to make up the difference. The federal funds rate is the interest rate banks are charged on those overnight loans.

Basically, the federal funds interest rate is the absolute minimum amount of interest a lender will accept for loaning out money. It’s the rate a bank would charge another bank for borrowing money overnight.

Now, a mortgage isn’t an overnight loan. Even if you have the world’s best credit score, lending money to you, an individual person, is much riskier than lending money to a bank with millions of dollars on the books.

But the federal funds rate sets a benchmark for all of the other interest rates a lender charges. When the federal funds rate goes up, banks and lenders incur higher costs to borrow from one another. A hike the in the federal funds rate doesn’t immediately impact mortgage interest rates. Mortgages are a long-term investment, and the federal funds rate is for very short-term loans. But lenders do find ways to pass those additional costs along to consumers.

Treasury Bond Yields

Mortgage lenders also keep tabs on other financial instruments. For example, the yield on 10-year treasury bonds usually tracks with mortgage interest rates. Treasury bonds allow investors to receive a minimal rate of return in exchange for buying bonds directly from the US Treasury. And when more people choose to invest in treasury bonds over riskier stocks? The rate of return on those treasury bonds goes down.

Just like the federal funds rate is basically the lowest interest rate a bank would use for a short term loan, the treasury bond rate is seen as a bare-minimum potential return a lender could expect on a longer-term investment. Mortgages take a long time to pay back the lender. And even the most credit-worthy individual is still a bigger lending risk than Uncle Sam. So if the rate of return on treasury bonds starts going up, mortgage rates rise, too.