Funding rates
Why the contract tracks the oracle, and the two corrections that make it work.
A perpetual has no expiry, so nothing forces its price to converge on the underlying. Funding does that job instead: once an hour, whichever side is holding the contract away from the oracle pays the other side, in proportion to position size. If the contract trades above the oracle, longs pay shorts, which makes being long more expensive and being short more attractive until the gap closes.
Numbers below are illustrative, with an oracle TWAP of $100 and illustrative market settings.
Paying the full gap
Start from the plainest rule: charge the whole divergence, as a fraction of the oracle, divided by 24 to turn a daily rate into an hourly one.
hourly_rate = (1/24) * (market_twap - oracle_twap) / oracle_twapBoth inputs are time-weighted averages rather than spot prices, so a single print cannot move the payment; the market TWAP is the midpoint of the bid and ask TWAPs. That rule converges, and it breaks in two specific ways.
What breaks
Small gaps are not information. A few bps of divergence between a book's midpoint and an oracle is tick size, spread, and sampling, not a premium anybody will pay to be long. Charging on it bills every open position, hour after hour, for noise.
A market sitting exactly on the oracle pays nothing. At zero divergence the rule pays zero in both directions, so nothing rewards the side keeping the contract pinned there.
The two problems pull in opposite directions. The dead zone answers the first; the offset floor answers the second.
The dead zone
Each market carries a band around zero divergence inside which the premium is treated as noise and dropped, leaving only the floor. The band is an admin-set per-market value in basis points of the oracle TWAP; at a band of 5 bps and a $100 oracle TWAP that is plus or minus $0.05.
Past the band the excess is shrunk toward zero by the threshold rather than measured from it, then scaled by a per-market ramp slope, so the premium leaves the band continuously rather than stepping. Both values are admin-set per market, so read them off the live market account.
The offset floor
Underneath the premium, funding always carries a baseline offset, so a market sitting exactly on its oracle still pays something in a fixed direction. The offset is the oracle TWAP divided by 3333, added to the premium before the hourly conversion, which works out to 10.95% annualized.
Because it is added before that division it is a price-sized amount rather than a rate, which is what lets it compose with the dead zone: inside the band the premium collapses to the floor alone, and outside it the ramped excess sits on top.
Worked examples, inside and outside the band
Take an oracle TWAP of $100 with illustrative settings: a 5 bps dead zone, a 1.0x ramp slope, and a floor of 10.95% annualized, about 0.00125% per hour.
Inside the band, at a market TWAP of $100.03, the premium is dropped and the hourly rate is 0.00125%, the same as if the market matched the oracle to the cent.
Outside the band, at a market TWAP of $100.20, the divergence is $0.20, which is $0.15 past the band.
- Shrink the excess by the threshold:
$0.20 - $0.05 = $0.15 - Scale by the ramp slope:
$0.15 * 1.0 = $0.15 - Add the floor:
$0.15 + $0.03 = $0.18 - Convert to an hourly rate:
$0.18 / $100 / 24 = 0.0075%
Charging the full gap would have cost 0.00833% an hour. The dead zone shaves the first 5 bps off as noise before the floor is added back.
Boundaries
The premium is capped at 3% of the oracle TWAP for contract tier A or B, 5% for tier C, and 10% below that, which stops a dislocated hour from producing an unbounded payment. See Contract tiers.
Funding is lazy, and it is hourly. The rate updates when someone opens or closes a position, and independently when enough time has passed, so it does not depend on a bot firing precisely on the hour. An update later than 20 minutes past the hour pushes the next one into the following period.
A quiet market may not pay at all. Funding accrues against a market's cumulative rates, and a market that neither trades nor gets cranked does not advance them. Between updates, what an account owes or is owed shows as unrealized P&L and settles at its next action in that market: a trade, a deposit, a withdrawal, or an explicit settle. See Profit and loss.
Extreme oracle divergence delays the whole thing. The market TWAP updates on trades and through permissionless cranks that fold in the oracle's confidence interval, and a single sample after a long silence is weight-capped, so one crank cannot on its own set the funding input. See Oracles.
When funding cannot be symmetric
Velocity aims to charge longs and shorts the same rate, which is only possible when the two sides are balanced. The AMM is the counterparty to whatever imbalance is left over, so an imbalanced market means the AMM owes more than it is owed, or the reverse.
It covers that difference out of its own retained equity: accumulated fees and trading P&L net of what it has already paid out. Each funding period it can spend at most one third of that equity on asymmetric funding. Beyond that the paying side's rate is capped so the AMM's equity cannot go negative, and receipts on the other side are capped to what is available. The insurance fund is never drawn on to cover a funding shortfall.
Widening the quote on the paying side
While the AMM is on the paying side of funding, a market can widen the AMM's quote on that side, making it costlier to trade further into it. The sensitivity is a per-market admin value: at zero the widening is inert, and above zero the paying side's quote widens in proportion. Read the live market account for it.
Reference
| Field | Value |
|---|---|
| Premium | (1/24) * (market_twap - oracle_twap) / oracle_twap, with the floor and dead zone applied first |
| Floor | oracle TWAP / 3333, giving 10.95% annualized |
| Dead zone | A per-market band around zero divergence, in bps of the oracle TWAP |
| Ramp slope | A per-market multiplier on the part of the spread that clears the dead zone |
| Premium cap | 3% of the oracle TWAP for tier A and B, 5% for tier C, 10% below |
| TWAP | EMA, one hour span; market TWAP is the midpoint of the bid and ask TWAPs |
| Period | One hour, rounded back onto the hour when the last update was inside the first 20 minutes |
Funding is often quoted annualized for comparison. APR is rate * 24 * 365.25; APY is (1 + rate) ^ (24 * 365.25) - 1, which approximately tracks allocating funding receipts back into the position, before fees and rebates.