Funding Rate
Perpetual contracts have no expiry date. Without a settlement deadline, there is no natural mechanism forcing the contract price toward the underlying spot price. The funding rate fills this role by providing a mechanism for periodic payments between longs and shorts and incentivizes traders to correct price deviations while keeping the perpetual anchored to the index.
When the perpetual trades above spot, longs pay shorts. When it trades below, shorts pay longs. This continuous incentive structure replaces the settlement cycles of dated futures with a rolling, always-on market.
Why FX Funding Is A Design Topic
FX perpetuals are different from crypto-native perpetuals because interest-rate differentials matter economically in traditional FX pricing. Ollo's near-term funding roadmap reflects that by extending the current formula with an FX carry component.
Current Onchain Formula
The current onchain formula is:
r = α × (P_perp - P_index) / P_index + β × (OI_long - OI_short) / (OI_long + OI_short)
In other words, the onchain formula currently uses:
- A premium component
- A skew component
That is the implemented funding behavior described below.
The Funding Formula
Ollo uses a discrete (oracle-based) approach with two components:
r = α × (P_perp - P_index) / P_index + β × (OI_long - OI_short) / (OI_long + OI_short)
Premium Component
α × (P_perp - P_index) / P_index
Measures the price deviation of the perpetual from the index. When the perp trades above spot, this term is positive, increasing funding for longs. When below, it is negative, increasing funding for shorts. The weight α controls how aggressively the formula responds to mispricing. Default: 0.01% (0.0001).
Skew Component
β × (OI_long - OI_short) / (OI_long + OI_short)
Measures the position imbalance: long open interest minus short, normalized by total open interest. This term penalizes the dominant side of the market, incentivizing positions that balance open interest. The weight β controls the sensitivity to imbalance. Default: 0.005% (0.00005). Returns 0 when total open interest is zero.
Rate Bounds
If a maximum funding rate is configured (maxFundingRate > 0), the final calculated rate is clamped to [-maxFundingRate, +maxFundingRate].
Parameters
| Parameter | Description | Behavior |
|---|---|---|
| α (alpha) | Premium weight | Higher → tighter price tracking, more volatile funding |
| β (beta) | Skew weight | Higher → stronger rebalancing incentive |
| maxFundingRate | Rate cap | Bounds the total funding rate to prevent extremes |
Alpha and beta can be configured globally with per-market overrides, allowing the protocol to calibrate funding behavior to each pair's characteristics. A high-carry pair like AUD/JPY may need different tuning than a low-spread pair like EUR/USD.
The protocol design leaves room for an interest-rate-differential term. That work is in near-term scope, but it should still be treated as planned enhancement work rather than the current onchain formula.
Planned IR-Aware Extension
The intended next step is not to replace premium-plus-skew funding, but to extend it with a carry component derived from the base-versus-quote rate differential.
In practical terms, the design direction is:
- Keep the current premium component
- Keep the current skew component
- Add an FX carry component so funding better reflects traditional FX economics
Any carry term would be clamped and smoothed before it is applied. The goal is to reflect interest-rate differentials without creating abrupt funding jumps from noisy data or sudden policy moves.
Until that ships, the onchain funding formula remains the premium-plus-skew model described below.
Funding Direction
| Condition | Who Pays | Who Receives |
|---|---|---|
| Positive funding rate | Longs | Shorts |
| Negative funding rate | Shorts | Longs |
The funding rate is expressed as a per-hour rate with 18-decimal precision and applied to the full notional value of the position.
Funding Settlement
Ollo uses lazy funding settlement. Funding is not settled on a fixed schedule for all positions simultaneously. Instead, cumulative funding is updated on each market whenever an interaction occurs (order placement, fill, or liquidation), and each account settles its own funding delta on its next interaction.
How It Works
-
The protocol maintains a cumulative funding value per market, a running total that accumulates funding deltas over time.
-
Each position records the cumulative funding value at the time of its last settlement.
-
When the position is next touched (new order, fill, or liquidation), the protocol calculates the difference:
fundingPayment = positionSize × (cumulativeFunding_now - cumulativeFunding_last) / 1e18
- The payment is applied to the account's margin:
- If the position owes funding: deducted from available margin first, then from committed margin (which pushes the position closer to liquidation).
- If the position receives funding: added to available margin.
Why Lazy Settlement?
Settling funding for every position at fixed intervals would require iterating over all open positions, an operation that scales linearly with the number of traders and is impractical onchain. Lazy settlement achieves the same economic result with constant gas cost per interaction, regardless of how many positions exist in the market.
The trade-off is that a position's funding is not reflected in its margin until the next interaction. This is accounted for during liquidation checks, where pending funding is settled before evaluating whether the position is underwater.
Price Oracles
The funding formula depends on two external price inputs:
- Perpetual price (
P_perp): the current trading price on the Ollo order book. - Index price (
P_index): the spot FX rate sourced from external oracles.
Prices are pushed to the onchain FundingRateOracle by authorized price updaters at regular intervals. A staleness threshold ensures that funding calculations never use outdated price data. If prices are stale, funding rate updates revert until fresh data is available.
Funding rate calculation is triggered by authorized keepers. The calculated rate is then consumed by the FxEngine when updating cumulative funding.