Trading Fees
UniDex implements a sophisticated fee structure designed to maintain market equilibrium, manage risk, and ensure long-term protocol sustainability. This document outlines the various components of our fee system.
Position Fees
Position fees are applied when opening, increasing, or decreasing a position. The fee is calculated based on the position size and an asset-specific trading rate:
Fee percentage is determined by the asset’s historical volatility and market depth. Because of this, fees can vary between assets and are subject to periodic review. These values are dynamic to encourage more balanced markets and reduce costs for traders taking minority positions.
Dynamic Funding Fees
UniDex utilizes an innovative velocity-based funding fee mechanism. This system balances open interest while providing stability for market makers and reducing costs for traders.
Key variables in the funding fee calculation:
- : Equilibrium funding rate
- : Normalized difference between long and short open interest
- : Rate of change towards the target rate
- : Based on 14-day average volatility
Dynamic Funding Rate Mechanism
UniDex employs a sophisticated funding rate system to maintain balance in the market. This mechanism adjusts the funding rate based on the difference between long and short open interest:
-
Long-Dominated Market: When long positions exceed short positions, the funding rate that longs pay to shorts gradually increases. This continues until:
- The imbalance between longs and shorts falls below a set threshold, or
- The funding rate reaches its upper limit
-
Balancing Act: If more short positions open or long positions close, reducing the long-short imbalance, the funding rate begins to decrease. This adjustment continues until the open interest difference falls below the threshold.
-
Short-Dominated Market: If short positions surpass long positions, the funding rate reverses direction:
- Shorts start paying longs
- The rate gradually increases as the imbalance grows
- This continues until the open interest difference falls below the threshold or the rate hits its upper limit
This dynamic system incentivizes traders to balance the market naturally, promoting stability and liquidity in the UniDex ecosystem.
Borrowing Fees
Borrowing fees mitigate the vault’s risk in taking the opposite side of each trade:
The is asset-specific, based on historical volatility, and periodically reviewed.
Spread Mechanism
To simulate order book dynamics, UniDex implements a spread mechanism:
Where the sign is used for LONG positions and the sign for SHORT positions.
The is asset-specific, correlating with historical volatility and market depth.
For assets like BTC/USD and ETH/USD, is 0 due to high liquidity. For less liquid assets, the penalty is higher to encourage more balanced markets and increase the cost of exploitive trading strategies.