Are you an LLM? Read llms.txt for a summary of the docs, or llms-full.txt for the full context.
Skip to content

Funding

Perpetual contracts use funding rates to keep the mark price anchored to the oracle price. Funding is a periodic payment between longs and shorts, settled once per hour.

How the rate is calculated

At each hourly interval, the validator computes:

avg_premium    = sum(premium_samples) / count(premium_samples)
premium_rate   = avg_premium / 8
interest_adj   = clamp(interest_rate - premium_rate, -0.05%, +0.05%)
funding_rate   = premium_rate + interest_adj

Where each premium sample is: (impact_mid - oracle_price) / oracle_price

The premium is sampled every 5 seconds throughout the hour and averaged at settlement (TWAP). This prevents a single manipulated orderbook state at the exact settlement timestamp from influencing the entire hour's rate. Over a 1-hour interval, approximately 720 samples are averaged.

The input is the impact mid (depth-weighted orderbook midpoint), not the displayed mark price. The division by 8 normalizes to an 8-hour equivalent period. The rate is capped at ±6.25% per interval (625 bps).

Interest rate component

The interest rate is a fixed baseline that flows from longs to shorts regardless of the premium. It models the cost of carry: a long perp position is economically similar to borrowing USD to buy the asset. Shorts earn this rate for providing the other side.

When the premium is near zero, the funding rate converges to the interest rate. When the premium is large, the interest rate has minimal effect. The clamp in the formula prevents the interest component from adjusting the final rate by more than ±0.05% relative to the premium alone — it's a safety rail, not an additional cost.

The interest rate is configurable per market. Real estate markets use a rate calibrated to approximate current mortgage rates. The rate can be set to 0 for pure premium-based funding.

Who pays whom

  • Positive rate (impact mid > oracle): longs pay shorts
  • Negative rate (impact mid < oracle): shorts pay longs

If the mark is trading above the oracle, being long is expensive. This creates an incentive for longs to sell, pushing the mark back toward the oracle.

Payment

Funding is applied directly to your collateral balance. If you are paying, your collateral decreases. If you are receiving, your collateral increases. This affects your margin and liquidation price immediately.

The payment per position:

funding_payment = funding_rate * oracle_price * position_size

Each position settles independently against the cumulative funding index. The exchange is the counterparty: when open interest is imbalanced, the heavy side's aggregate payment exceeds the light side's aggregate receipt, and the difference accrues to the Parcl Treasury. Rounding residuals (sub-lamport amounts) accrue there too.

Timing

Funding settles once per hour. The displayed funding rate in the UI and API updates continuously throughout the hour, reflecting the running TWAP estimate so far. When the hourly crank fires, the current estimate becomes the actual rate applied to all positions.

The displayed rate is "what the rate would be if settlement happened right now." As more samples accumulate over the hour, the estimate stabilizes.

API

Current funding rate per market: GET /v1/markets (see fundingRate field)

Funding rate history per market: GET /v1/markets/{id}/funding

Your funding payment history: GET /v1/accounts/{id}/funding (requires authentication)

WebSocket: subscribe to the funding channel for real-time rate updates.