Funding and the fixed charge
A long receives realized variance and pays a time-based variance charge. A short has the opposite payment. The contract nets the two legs at each accepted observation. Trading fees and profit from changes in the book mark are separate.
Source: contracts/src/Market.sol, especially _observe, _project, and _sync.
New to the product? Read How variance perpetuals work first.
Formula
Use these quantities in ordinary decimal units:
| Symbol | Meaning |
|---|---|
| Positive number of contracts subject to funding | |
| Contract multiplier: 100 USDC | |
| Annualized variance mark saved at the prior observation | |
| Elapsed source time in seconds | |
| Horizon: 604800 seconds, or 7 days | |
| Year: 31536000 seconds, or 365 days | |
| Log return of the oracle price | |
| Squared-return cap: 0.0025 |
The log return of one interval is:
The fixed charge paid by the long is:
The realized-variance leg received by the long is:
The net funding payment to the long is:
A positive result credits the long and debits the short. A negative result debits the long and credits the short. Both upward and downward price moves contribute positive squared returns. With no price move, only the fixed charge remains.
These formulas explain the arithmetic before integer rounding. Solidity uses 18-decimal fixed-point values and integer divisions at intermediate steps.
Why the mark is a variance forecast
Assume that the oracle price has a constant annual volatility
Put this value into the realized leg, without the cap:
This is the fixed charge with
A long gains on average when the realized variance is above the mark. A short gains when it is below. A mark of 1.573 is equal to an annual volatility of
For one interval, the long gains when the move is larger than the break-even return:
For
This calculation is an explanation, not a contract rule. The cap, the jumps of a real price, and missed observations change the result.
Meaning of fixed
K stays fixed for the interval being settled. It is not fixed for the life of a position. After the observation, the current book mark becomes the next interval's charge. If no new valid mark can be formed, the stored mark remains in use.
K is variance, not volatility. For example, K = 1.57 is not a 1.57% interest rate or a 157% volatility quote. This charge is also not an exchange trading fee.
Example
Assume 41 funded contracts, K = 1.57, and no price move:
| Elapsed time | Long pays, USDC |
|---|---|
| 60 seconds | 0.64 |
| 1 hour | 38.32 |
| 1 day | 919.57 |
The one-day value is a projection with an unchanged charge and continuous valid observations. The contract does not accept a single one-day funding gap.
For a log return of -0.04 over 60 seconds:
This example excludes trading fees and changes in mark value. The deployment scripts start MON at a mark of 1.573 and ETH at 0.36, so the charge of a live market differs from this example.
The cap
The realized leg uses
Delayed funding activation
The book position and the funding position are separate. A fill changes the book position. At the next accepted observation, the previous funding position receives the interval payment; the current book position then becomes the funding position.
For example:
- An account has no position and buys 41 contracts between observations.
- The next observation settles the prior zero funding position and activates 41.
- The following observation settles funding on 41 contracts, if no later change affects the applicable checkpoint.
A close does not erase the prior funding obligation. The account keeps the funding position and its margin requirement until the next accepted observation. Thus the first shock immediately after a new fill can produce no funding payment for that new position. Establish the funding position before a hedge demonstration.
A new position gets funding from the second observation after the fill
The first observation after the fill only activates the funding position. The Hedging demo starts its test pool at that first observation, so that the LP loss and the hedge funding cover the same observations.
Index and cash
Each observation adds a signed per-contract payment to fundingIndex. Accounts store a funding checkpoint. Account reads project the payment without a write; account access stores it in cash and cumulative funding. Observations do not loop over every account.
The contract has no separate settlement clock. The Python reference uses pending cash in some paths. Compare total equity, not just one intermediate cash field.
Missing observations
The gap limit of a market is three observation intervals. It is 180 seconds for a 60-second market and 900 seconds for a 300-second market.
A permitted gap up to that limit uses one capped endpoint return and the fixed charge for the actual elapsed time. It does not reconstruct the missing path. A longer gap or a prior oracle halt skips both funding legs and rebases. The mark then stays frozen until the book gives a valid mark again. Recovery can therefore remove a payment that a continuous price path would have produced.
Do not treat a recovered test path as evidence of continuous real-market hedging. See Oracle and observations for the acceptance rules.