Ethereal Docs
  • Introduction
    • What is Ethereal?
  • Public Testnet
  • Trading
    • Perpetual Futures
      • Margining
      • Order Types
      • Positions
      • Funding Rates
      • Market Specifications
      • Liquidations
      • Auto Deleveraging
      • Subaccounts
      • Price Oracles
  • Points
    • Staking sENA
    • Season Zero
  • developer-guides
    • Trading API
      • Quick Start
      • Message Signing
      • Accounts & Signers
      • Order Placement
      • System Limits
      • Products
      • Token Transfers
      • Supported Tokens
      • Websocket Gateway
    • Python SDK
  • Protocol Reference
    • API Hosts
    • Contracts
    • Audits
Powered by GitBook
On this page
  1. Trading
  2. Perpetual Futures

Funding Rates

PreviousPositionsNextMarket Specifications

Last updated 3 days ago

Funding rates are a critical mechanism in perpetual futures markets that ensures the convergence of perpetual contract prices with their underlying spot market prices. This document explains the purpose, implementation, and technical details of how funding rates work on the Ethereal exchange.

Perpetual markets use hourly funding to keep prices aligned with spot. When funding is positive, longs pay shorts; when negative, shorts pay longs. Payments occur every hour on the hour, with rates calculated based on the premium or discount to the index price. Current funding rates are displayed at the top of each market in hourly, daily, and annualized formats, alongside a dedicated chart displaying the historical funding rates.

Implementation

Ethereal's funding mechanism charges hourly, with the calculation period spanning the full hour and settlement occurring at the end of each hour.

Throughout each hour, we calculate the basis (premium or discount) by comparing the market's mid-price (average of best bid and ask) with the underlying spot price provided by Pyth Lazer:

basis=mid_price−spot_pricespot_price\text{basis} = \frac{\text{mid\_price} - \text{spot\_price}}{\text{spot\_price}}basis=spot_pricemid_price−spot_price​

This calculation is performed at fixed intervals throughout the hour to capture market conditions.

At the end of each hour, the collected basis measurements are averaged to form the hourly rate. The averaged basis is clamped within approximately ~0.01bps (hourly) from zero, a baseline rate is added, and the overall rate is capped at approximately ~25bps (hourly).

For positive rates:

rate=min⁡(clamp(average_basis)+baseline_rate,cap)\text{rate} = \min(\text{clamp}(\text{average\_basis}) + \text{baseline\_rate}, \text{cap})rate=min(clamp(average_basis)+baseline_rate,cap)

For negative rates:

rate=max⁡(clamp(average_basis)+baseline_rate,−cap)\text{rate} = \max(\text{clamp}(\text{average\_basis}) + \text{baseline\_rate}, -\text{cap})rate=max(clamp(average_basis)+baseline_rate,−cap)

The baseline APR serves as a minimum funding cost that helps maintain market stability. Currently, all markets are configured with a 15% APR baseline funding.

Using the determined rate and current spot price, we calculate the charge per unit in USD:

chargeper_unit_usd=position_size×spot_price×rate\text{chargeper\_unit\_usd} = \text{position\_size} \times \text{spot\_price} \times \text{rate}chargeper_unit_usd=position_size×spot_price×rate

This charge is then applied to each position based on its size and direction. Once calculated and applied, funding charges are relayed and settled sequentially onchain. Processing is sequential; If a funding charge occurred at 13:00:00 and a trade at 13:00:01, the funding will always be relayed before the trade.

Charge Retries and Edge Cases

Funding charges may occasionally fail to apply due to technical reasons. While rare, the exchange will retry the funding charge application for the first 15 seconds of the current hour. If all retry attempts fail, that hour's funding is discarded and not applied retroactively. This ensures the system can handle transient failures while maintaining operational integrity.