Funding
Funding keeps a perpetual trading near its index. When the perp trades above the index longs pay shorts, and below, shorts pay longs. AGORA uses the Hyperliquid formulation.
The 8-hour rate is premium + clamp(interest − premium, ±0.05%) and the hourly rate is that divided by 8, where premium is the difference between the perp's impact price and the index expressed as a fraction and posted by the oracle quorum, and interest is fixed at 0.01% per 8 hours. The hourly rate is additionally capped at ±0.1% by the contract, so funding cannot be driven to an arbitrary value even by a compromised oracle.
Premium is measured off-chain as the volume-weighted impact bid and ask over a fixed notional depth of the resting book, with a deadband so an empty book reports zero rather than noise. It is posted through the oracle under the same quorum, deviation cap and rate limit as prices.
Funding accrues continuously through a cumulative index rather than at discrete intervals. A position records the index at entry and pays notional × (cumulativeIndex_now − cumulativeIndex_entry) at settlement.
Example
The index is 100 and the perp's impact price is 100.6, so the premium is 0.6%. Then interest − premium = −0.59%, which clamps to −0.05%, giving an 8-hour rate of 0.6% − 0.05% = 0.55% and an hourly rate of 0.06875%.
A long holding 10,000 notional pays 10,000 × 0.0006875 = 6.875 USDG for that hour, to the short. At a premium of zero the 8-hour rate is 0.01% and longs pay shorts a small carry.