GLV Vault Exercises

A practical exercise to GLV Liquidity Exercises - Implement Solidity functions for GMX GLV pool interactions. Learn to create deposit orders with USDC and withdrawal orders for WETH/USDC, while managing execution fees.

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. GMX Token Price
An in-depth analysis to GMX Market Token Pricing Logic - Delve into the `MarketUtils.sol` contract to see how GMX calculates GM token prices based on pool value, fees, PnL, and supply. Understand how deposits use this price to mint tokens via `ExecuteDepositUtils.sol`. Duration: 2min
2. GMX Pool Fees
A practical guide to Understanding GMX V2 Liquidity Provision Costs - Explore the exact fees charged when buying (depositing) or selling (withdrawing) GMX V2 GM tokens. Learn to identify and differentiate price impact, protocol buy/sell fees, and network costs. Duration: 1min
3. GMX Pool Deposit
A step-by-step analysis to Understanding GMX V2 Order Creation via Tenderly - Follow a GMX V2 deposit order transaction using the Tenderly debugger tool. Uncover the sequence of contract calls (`multicall`, `sendWnt`, `createDeposit`), decode parameters, and see how the final order ID is generated. Duration: 2min
4. GMX Pool Withdrawal
A detailed analysis to Analyzing GM Pool Withdrawals with Tenderly - Use Tenderly to dissect the `multicall` transaction creating a GMX GM pool withdrawal request. Trace how the `ExchangeRouter` directs execution fees and GM tokens to the `WithdrawalVault`. Duration: 2min
5. Quiz 1 Quiz
Questions: 11
6. GLV Token Price
An analytical analysis to Calculating GLV Token Price - Discover the formula for GLV token price: the total USD value of assets held divided by the GLV token supply. Follow a code walkthrough examining how Solidity functions calculate vault value and perform the final price division. Duration: 2min
7. GLV Fees
A clarifying explanation to Understanding GMX V2 GLV Deposit/Withdrawal Fees - Learn why depositing/withdrawing from GMX Liquidity Vaults (GLVs) incurs the same fees as direct GM pool interaction. Understand that GLV transactions ultimately route liquidity into the constituent GMX Market pools. Duration: 0min
8. GLV Deposit
An analytical breakdown to Decoding GMX V2 GLV Liquidity Deposits - Use Tenderly to dissect a GMX V2 GLV liquidity deposit transaction, tracing interactions via the `GlvRouter`. Analyze `multicall`, `sendWnt`, and `createGlvDeposit` functions, identify key parameters, and contrast with GM pool flows. Duration: 1min
9. GLV Withdrawal
A detailed dissection to Removing Liquidity from GlvVaults - Learn how to dissect GlvVault withdrawal transactions using Tenderly and Arbiscan. Understand the multicall structure, internal calls, and crucial createGlvWithdrawal parameters for GMX V2. Duration: 1min
10. Quiz 2 Quiz
Questions: 6
11. GMX Pool Exercises
A practical exercise to Market Liquidity Exercises - Implement Solidity functions to deposit USDC and withdraw assets from a GMX V2 market pool. Learn to calculate market token prices and manage GMX execution fee refunds. Reading Time: 0min
12. GLV Vault Exercises
A practical exercise to GLV Liquidity Exercises - Implement Solidity functions for GMX GLV pool interactions. Learn to create deposit orders with USDC and withdrawal orders for WETH/USDC, while managing execution fees. Reading Time: 0min

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