Perps Guide
The Funding Rate Mechanism

Anatomy of a Perp · Ch. 06

The Funding Rate Mechanism

Your perp drifts to $200 above spot. Nothing is forcing it back: no expiry, no referee. Yet a few hours later the gap has quietly closed on its own. Somebody paid to make that happen. Here is who, and why.

The Idea

Intuition

Last chapter left us with a loose end. A perpetual never expires, so nothing drags its price back to spot. Funding is the fix.

It’s one simple rule. When the perp trades above spot, the longs (who bet it rises) pay a small fee to the shorts (who bet it falls). When it trades below spot, the shorts pay the longs instead. This runs on a clock, every few hours, whether anyone is watching or not.

That fee makes the expensive side costly to hold and pays you to take the cheap side. So traders lean against the gap, and the perp gets pulled back toward spot. The wider the basis, the bigger the fee, and the harder the pull.

Watch it play out, then push the perp above and below spot yourself.

The Math

How It’s Calculated

In plain terms: the funding rate is just the basis, how far the perp sits from spot, turned into a small fee that the expensive side pays the cheap side.

The premium is how far the perp sits above or below spot, as a fraction of spot. It’s the basis from last chapter:

premium=perpspotspot\text{premium} = \frac{\text{perp} - \text{spot}}{\text{spot}}

Funding is charged once an interval, commonly every 8 hours. The textbook rate is that premium spread across the interval:

funding8h=premium8\text{funding}_{8h} = \frac{\text{premium}}{8}

A positive premium (perp above spot) means longs pay shorts; a negative one flips it. Charged a few times a day, even a small gap becomes expensive to sit on, and that steady cost is what nudges the price home.

8h funding rate
+0.000%
·
Perp on spot. Funding is zero.

Note

Real protocols don’t stop at this clean formula. They also lean the rate toward whichever side is more crowded, the long/short skew, so the cost of an imbalance lands on the crowd that caused it. That’s Chapter 9.

War Story

The first time I built funding, I did it the obvious way: one rate, everyone on the expensive side pays it, everyone on the cheap side receives it. When the two sides didn’t line up, the protocol’s insurance fund, a reserve meant for emergencies, quietly covered the difference.

It worked. Until it didn’t. As one side grew far larger than the other, that “difference” got paid out every single interval, and the fund started draining fast.

The fix was to make funding pro rata: instead of leaning on the insurance fund, the money owed is shared directly between the open positions, in proportion to their size. The fund stops being the payer of last resort, and funding balances itself.

The lesson stuck. A funding rate isn’t a formula you copy off a whiteboard. It’s a policy for who pays whom, and that policy is where the real risk hides.

Field note: building a perp DEX