How GMX Works

A high-level overview to How the GMX V2 Protocol Works - Explore the interactions between Traders, Liquidity Providers, and Keepers within the GMX V2 ecosystem. Understand the two-step order execution process, fee structures, and the crucial role of Keepers and oracles.

Get SSCD+ certified, for free!

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!

1. What Is GMX
An essential introduction to Getting Started with GMX V2 - Discover GMX V2, a decentralized perpetual exchange offering high-leverage trading, token swaps, and yield generation through GM Pools/GLV Vaults. Understand its unique two-step transaction process for MEV protection and the role of adaptive funding fees. Duration: 2min
2. How GMX Works
A high-level overview to How the GMX V2 Protocol Works - Explore the interactions between Traders, Liquidity Providers, and Keepers within the GMX V2 ecosystem. Understand the two-step order execution process, fee structures, and the crucial role of Keepers and oracles. Duration: 3min
3. Perpetual Swap
A simplified explanation to Understanding Perpetual Swaps - Grasp perpetual swaps as directional bets requiring collateral, moving beyond complex jargon. Understand the mechanics of profit, loss, and the critical role of liquidation based on collateral. Duration: 3min
4. Long And Short
A fundamental introduction to Understanding Long vs. Short Positions - Grasp the core concepts of long positions (betting price increases) and short positions (betting price decreases). Understand how perpetual swaps calculate profit/loss similarly to spot trading, without handling the actual asset. Duration: 6min
5. Quiz 1 Quiz
Questions: 18
6. Leverage
A foundational explanation to Understanding GMX Leverage - Grasp GMX's unique definition of leverage as a multiplier of your collateral's USD value. See how this calculation determines your initial position size through clear examples and the core formula. Duration: 2min
7. Purpose Of Leverage
A fundamental explanation to The Dual Nature of Leverage - Understand how leverage magnifies trading exposure using clear examples. Discover why this tool amplifies both potential profits and potential losses relative to your collateral. Duration: 5min
8. Market
A structural explanation to GMX Markets - Unpack the concept of a GMX Market used for perpetual swaps. Learn how the Index, Long, and Short tokens define the specific trading conditions for each asset. Duration: 2min
9. 2 Types Of Market
An essential comparison to Full Backed vs. Synthetic Markets - Understand the critical difference between Full Backed and Synthetic markets in decentralized trading protocols. Learn how the relationship between index and long tokens determines if pool assets can cover potential extreme liabilities. Duration: 7min
10. Quiz 2 Quiz
Questions: 12
11. Liquidity Provider
An essential guide to Introduction to Liquidity Provision - Uncover the definition of Liquidity Providers (LPs) and how they supply essential long/short tokens to markets. Delve into the incentives for LPs, including fee generation and the dynamic of profiting when traders lose. Duration: 1min
12. Position Size
A fundamental analysis to Understanding Trading Position Calculations - Explore the formulas defining position size in USD and tokens based on leverage, collateral, and entry price. Grasp how the constant token position size drives profit and loss calculations differently for long vs. short trades. Duration: 3min
13. Examples Position Profit And Loss
A detailed breakdown to P&L Calculation Examples - Follow step-by-step calculations for determining Profit and Loss (P&L) in USD for leveraged long and short positions. Learn how initial collateral, leverage, and price changes combine to impact your final P&L outcome. Duration: 3min
14. Liquidation
A critical explanation to Liquidation in Perpetual Swaps - Learn why positions without expiry dates can be forcefully closed to prevent protocol losses. Master the liquidation condition, understanding how current collateral value, position loss, and fees determine the trigger point. Duration: 2min
15. Open Interest
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. Duration: 2min
16. Quiz 3 Quiz
Questions: 11
17. Funding Fee
A fundamental explanation to Funding Fees Explained - Grasp the concept of funding fees as dynamic charges for holding trading positions. Understand the key rule: the side with larger open interest pays the side with smaller open interest. Duration: 0min
18. 4 Types Of Open Interest
A detailed examination to The Four Types of GMX Open Interest - Explore GMX's unique method for tracking open interest in its perpetual markets. Discover the four distinct OI types, defined by position direction (long/short) and collateral asset (long/short token). Duration: 1min
19. UI Market Swap
A practical guide to GMX Market Swaps - Learn how to execute instant token exchanges using GMX's market swap feature. Understand the role of GM Pools, associated fees (price impact, network), and the two-transaction execution process. Duration: 6min
20. UI Limit Swap
A detailed demonstration to Executing GMX Limit Swaps - Learn to configure and submit Limit Swap orders on GMX V2, specifying your desired execution price. Witness the two-stage process of order creation and keeper-bot execution via Arbiscan analysis. Duration: 1min
21. UI Market Long
A practical walkthrough to Opening Your First GMX Long Trade - Follow a step-by-step process to open a leveraged long position on GMX, selecting ETH/USD and using WETH as collateral. Grasp key concepts like leverage, liquidation price, position sizing, Open Interest, and associated trading fees. Duration: 5min
22. UI Close Long
A detailed walkthrough to Managing and Closing Leveraged Trades - Observe the process of closing a 2x ETH long position, from monitoring PNL and collateral to executing the close order. Gain clarity on borrow, funding, close, and network fees impacting your final settlement. Duration: 3min
23. UI Market Short
A detailed walkthrough to Executing a GMX Short Trade - Master the process of opening a leveraged short position on GMX, correctly selecting collateral types and understanding the inverse relationship between leverage and liquidation price for shorts. Learn how GMX calculates fees, including potential rebates for balancing open interest. Duration: 2min
24. Quiz 4 Quiz
Questions: 13
25. UI Close Short
A practical walkthrough to Closing an Unprofitable Short Position on GMX - Follow along as an unprofitable leveraged short ETH position is closed on GMX to minimize losses. Discover how to monitor PnL relative to entry/mark prices and execute the closing transaction via the interface. Duration: 1min
26. UI GMX Pool Add Liquidity
A practical guide to Providing Liquidity to GMX V2 GM Pools - Explore how to supply assets to single-market GM Pools via the GMX V2 Earn page. Understand the deposit process using single or paired tokens, associated fees, and the two-step transaction mechanism. Duration: 3min
27. UI GMX Pool Remove Liquidity
A step-by-step guide to Removing Liquidity from GMX V2 Pools - Learn the exact process for selling GM tokens and withdrawing assets from a GMX V2 liquidity pool. Understand proportional withdrawal, associated fees, and why price impact is typically negligible. Duration: 2min
28. UI GMX Pool Shift Liquidity
An efficient walkthrough to Using the GMX V2 Shift Feature - Discover how to seamlessly move your GM token liquidity between different market pools on GMX. Master the fee-saving 'Shift' function and the required ERC-20 approval steps. Duration: 1min
29. UI GLV Vault Add Liquidity
A detailed walkthrough to Depositing into GMX V2 GLV Vaults - Follow a step-by-step demonstration of adding USDC liquidity to a GLV (BTC-USDC) Vault. Understand the single-token deposit process and how to select the specific underlying GM Pool for your funds. Duration: 2min
30. UI GLV Vault Remove Liquidity
A practical walkthrough to Withdrawing from GMX V2 GLV Vaults - Follow the process of removing liquidity from a GMX V2 vault by selling your GLV tokens. Understand how to select an underlying GM pool, perform the ERC-20 approval, and confirm the transaction to receive assets back. Duration: 1min
31. GMX Contract Architecture
An architectural overview to GMX V2 Contract Architecture - Grasp the modular design of GMX V2, including Routers, Handlers, Utils, Vaults, and DataStore contracts. Understand the asynchronous order execution process powered by Keepers, Oracles, and the role of GM/GLV market tokens. Duration: 10min
32. Quiz 5 Quiz
Questions: 9

Course Overview

About the course

What you'll learn

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

Course Description

Who is this course for?

  • Software engineers
  • Web3 developers
  • Finance developers
  • Smart contract security researchers

Potential Careers

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)

Meet your instructors

Tasuku Nakamura

Tasuku Nakamura

Founder at smartcontract.engineer

Smart contract engineer and educator.

Last updated on June 26, 2025