5/5
## Understanding Open Interest for Derivatives Trading When analyzing derivatives markets, particularly within decentralized protocols like GMX, understanding "Position Size" is crucial, but it's only part of the picture. Another essential concept is **Open Interest (OI)**. Open Interest provides a vital measure of market activity and participation. In simple terms, Open Interest represents the total value or number of outstanding derivative contracts that have not yet been settled or closed. For perpetual futures or similar contracts, this means tracking all the positions that are currently active in the market. It serves as an indicator of the total amount of money currently committed to that market, reflecting trader conviction and potential future volatility. **Types of Open Interest** Open Interest is typically categorized based on the direction of the open positions: 1. **Long Open Interest:** This metric specifically measures the sum total of the sizes of *all open long positions* in a given market. It quantifies the total value locked in contracts by traders who anticipate the price of the underlying asset will increase. `Long Open Interest = Sum of all open long position sizes in a market` 2. **Short Open Interest:** Conversely, this metric measures the sum total of the sizes of *all open short positions* in that market. It represents the total value locked in contracts by traders betting on a price decrease for the underlying asset. `Short Open Interest = Sum of all open short position sizes in a market` It's important to remember that for every open long position, there must be a corresponding open short position. However, calculating Long OI and Short OI separately provides insights into the directional bias and overall exposure within the market. **Relationship to Position Size** Open Interest is fundamentally derived by aggregating the sizes of individual open positions. Recall that an individual trader's **Position Size** (in USD) is determined when they enter the trade, using the following calculation: `Position Size (USD) = Leverage * USD Value of Collateral (at entry)` Therefore, Long Open Interest is simply the sum of the USD Position Sizes of all currently open long positions, and Short Open Interest is the sum of the USD Position Sizes of all currently open short positions. **Calculating Open Interest** The mathematical process for calculating Open Interest is the same whether you are calculating Long OI or Short OI. The key difference lies in *which* set of positions you are summing (longs or shorts). Let's assume there are `N` currently open positions of the type we are interested in (e.g., `N` open long positions if calculating Long OI). For each individual position `i` (where `1 ≤ i ≤ N`), we define the following based on its state *at the time of entry*: * `L_i`: The leverage selected for position `i`. * `C_i`: The USD value of the collateral used for position `i`, measured *at the time the position was entered*. * `I_i`: The price of the index asset (e.g., ETH/USD price) *at the time position `i` was entered*. Using these, we calculate the size of the individual position `i` in two ways: 1. **Position Size in USD (`S_i`):** This is calculated using the leverage and collateral value at entry. `S_i = L_i * C_i` 2. **Position Size in Tokens (`T_i`):** This represents the position size in terms of the underlying asset (e.g., number of ETH). It's derived from the USD size and the entry price. `T_i = S_i / I_i` **Calculating Total Open Interest:** To find the total Open Interest for the chosen type (long or short), we sum the respective sizes across all `N` open positions: 1. **Total Open Interest in USD (`S`):** Sum the USD position sizes (`S_i`) of all `N` open positions. `S = Σ S_i` (summing from i=1 to N) Which expands to: `S = Σ (L_i * C_i)` (summing from i=1 to N) 2. **Total Open Interest in Tokens (`T`):** Sum the token position sizes (`T_i`) of all `N` open positions. `T = Σ T_i` (summing from i=1 to N) Which expands to: `T = Σ (S_i / I_i)` (summing from i=1 to N) **Relevance to GMX** A solid grasp of Open Interest, including how it's derived from individual position sizes and calculated in both USD and token terms, is essential *before* diving into the specifics of the GMX protocol's codebase or mechanics. GMX, like other derivatives platforms, closely tracks Open Interest. Specifically, the **GMX protocol keeps track of Open Interest in both USD terms (`S`) and in terms of the underlying token (`T`)**. This tracking is fundamental to its risk management, funding rate calculations, and overall pool balancing mechanisms. Understanding OI provides context for how GMX manages the collective exposure of its users.
An essential explanation to The Concept of Open Interest - Grasp the crucial metric of Open Interest (OI), representing the total outstanding value in GMX's derivatives market. Master the calculation of Long and Short OI in both USD and token terms from individual position sizes.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Cyfrin Updraft has partnered with GMX to provide SSCD+ certifications vouchers to the first 25 students who demonstrate the completion of this course and are building on top of GMX. Join the GMX Discord server to redeem your coupon, or navigate to the docs to learn more!
Course Overview
About the course
Mechanics and contract architecture of the GMX protocol
Token pricing and fees
Liquidity: GM pools and GLV vaults
Math, funding rates, liquidation pricing, P&L calculations
Limit orders, take profit orders, stop loss, and stop market orders
Auto-cancel and auto-deleveraging
GLP, esGMX, GMX staking and delegation
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Last updated on June 26, 2025
Duration: 8min
Duration: 1h 19min
Duration: 1h 24min
Duration: 16min
Duration: 11min
Duration: 11min
Duration: 6min
Course Overview
About the course
Mechanics and contract architecture of the GMX protocol
Token pricing and fees
Liquidity: GM pools and GLV vaults
Math, funding rates, liquidation pricing, P&L calculations
Limit orders, take profit orders, stop loss, and stop market orders
Auto-cancel and auto-deleveraging
GLP, esGMX, GMX staking and delegation
DeFi Developer
$75,000 - $200,000 (avg. salary)
Smart Contract Engineer
$100,000 - $150,000 (avg. salary)
Web3 developer
$60,000 - $150,000 (avg. salary)
Web3 Developer Relations
$85,000 - $125,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Security researcher
$49,999 - $120,000 (avg. salary)
Last updated on June 26, 2025