Deposit/Withdrawal Examples

These examples follow a user's end-to-end cycle through GMI.

Depositing

The Index has been operating for a while and has the following system snapshot:

  • Total Index Value = $3,000,000

  • Total GMI Supply = 2,000,000 (@ $1.50 each)

  • Total gmETH Value in Index = $1,100,000

  • gmETH Price = $1.32 / token

  • gmETH Target Weight / Total Token Weights = gmETH Target Weight Ratio = 0.4

  • Tax Bps = 60 basis points (0.6%)

  • Fee Bps = 100 basis points (1%)

  • Minimum Fee Bps = 33 basis points (0.33%)

A user buys $20,000 worth of gmETH from GMX , which is roughly 15,152 tokens. The user then deposits the 15,152 gmETH tokens into the GMI Index.

Deposit Fee

Upon deposit, the GMI smart contracts determine if the deposit benefits the Index or not. A transaction benefits the Index when it brings the GM asset closer to it's target weighting:

  • Initial gmETH Bank Balance = Total gmETH Value in Index / gmETH Price = $1,100,00 / $1.32 = 833,333.33 tokens

  • gmETH Target Balance = Total Index Value (including new deposit) * gmETH Target Weight Ratio / price = $3,020,000 * 0.4 / $1.32 = 915,151.52 tokens

  • Initial Difference = gmETH Target Balance - Initial gmETH Bank Balance = 81,818.18 tokens

  • New Bank Balance = Initial gmETH Bank Balance + New gmETH Deposit = 833,333.33 + 15,152 = 848,485.33 tokens

  • New Difference = gmETH Target Balance - New Bank Balance = 915,151.52 - 848,485.33 = 66,666.19.

Since the New Difference is less than the Initial Difference, the transaction benefits the Index, and the user sees a rebate on the normal fees:

  • Rebate Bps = (Tax Bps * Initial Difference) / gmETH Target Balance = (60 * 81,818.18) / 915,151.52 = 5.364.

If the Rebate Bps is greater than the Fee Bps (0.01), then the user is charged the Minimum Fee Bps. If the Rebate Bps is less than the Fee Bps, but higher than the Minimum Fee Bps, the transaction incurs a fee of Fee Bps - Rebate Bps. For this transaction, we have:

  • Final Fee Bps = Fee Bps - Rebate Bps = 100 - 5.364 = 94.64

This fee is then multiplied by the GMI mint amount and divided by the Fee Divisor (10,000):

  • GMI Mint Amount = (gmETH Deposit Value * Total GMI Supply) / Total Value) = ($20,000 * 2,000,000) / $3,000,000 = 13,333.33 tokens

  • Fee Amount = GMI Mint Amount * Final Fee Bps / Fee Divisor = 13,333.33 * 94.64 / 10,000 = $126.20 (or 0.63% of the deposit amount)

Deposit Reflection

Once the fee is determined, the protocol splits it into two buckets: 60% for reflection, 40% for USDC looping liquidity.

  • $126.20 * 0.6 = $75.72 -> Reflection

  • $126.20 * 0.4 = $50.48 -> USDC looping liquidity

So $75.2 in freshly minted GMI token stays within the Index contract in perpetuity and $50.48 in minted GMI tokens gets sent to the protocolFeeRecipient and earmarked for USDC looping liquidity at a later date.

During Liquidity Provision

While the depositor's GM assets are in the Index and they hold their GMI tokens, they are exposed to the reflection portion of each deposit and withdrawal fee accrued thereafter. As asset transfer volumes increase, the Index sees a net gain of both GMI tokens and GM asset tokens, due to the reflection portion of the fees never being spent. These tokens sit in the Index in perpetuity.

Let's say the above depositor returns after a certain time period to see the status of the initial deposit. The protocol's snapshot is:

  • Total Index Value = $50,000,000

  • Total GMI Supply = 25,000,000 (@ $2.00 each)

  • Total gmETH Value in Index = $10,000,000 (gmETH has increased to $1.50 per token)

  • GMI Volume since user's initial deposit = $300,000,000

  • Average user fee = 0.96%

  • Total fees = $300,000,000 * 0.0096 * 0.6 (60% reflections) = $1,609,157

Since the depositor still holds their 13,333.33 GMI tokens (0.053% of the entire pool), the tokens are now worth $26,666.67 ($858.22 of which is derived from the reflections)

Withdrawing

The depositor now wants to withdraw their gmETH tokens. Like depositing, the GMI smart contracts determine if the withdrawal benefits the Index or not. The above snapshot will be used in the fee calculation.

Withdrawal Fee

The target weight for gmETH is still 0.4, and with the above snapshot, the current weight is 0.2. The depositor's withdrawal will take gmETH's weight further away from the target weight, so a tax will be assessed on this transaction.

  • gmETH Withdraw Value = (GMI Amount * Total Index Value (excluding withdrawal)) / Total GMI Supply = (13,333 GMI tokens * $50,000,000) / 25,000,000 = $26,666.67

  • gmETH Withdraw Amount = gmETH Withdraw Value / gmETH Price = $26,666.67 / $1.50 = 17,777.78 tokens

  • gmETH Bank Balance = Total gmETH Value in Index / gmETH Price = $10,000,000 / $1.50 = 6,666,666.67 tokens

  • gmETH Target Balance = (Total Index Value - gmEth Withdrawal) * gmETH Target Weight Ratio / Price = ($50,000,000 - $26,666.67) * 0.4 / $1.50 = 13,326,222.2 tokens

  • Initial Difference = gmETH Target Balance - Initial gmETH Bank Balance = 6,659,555.55 tokens

  • New Bank Balance = Initial gmETH Bank Balance - New gmETH Withdrawal = 6,666,666.67 - 17,777.78 = 6,648,888.89 tokens

  • New Difference = gmETH Target Balance - New Bank Balance = 13,326,222.2 - 6,648,888.89 = 6,677,333.31

Since the New Difference is more than the Initial Difference, the transaction hurts the Index, and the user sees a tax on top of the nominal 1% fee:

  • Average Difference = (Initial Difference + New Difference) / 2 = (6,659,555.55 + 6,677,333.31) /2 = 6,668,444.43

  • Tax Bps = (Tax Bps * Average Difference) / gmETH Target Balance = (60 * 6,668,444.43) / 13,326,222.2 = 30.024 basis points

  • Final Fee Bps = Fee Bps + Tax Bps = 100 + 30.024 = 130.324

The Fee Bps is then multiplied by the gmETH Withdraw Amount and divided by the Fee Divisor (10,000):

  • Fee Amount = (gmETH Withdraw Amount * Final Fee Bps) / Fee Divisor = (17,777.78 * 130.324) / 10,000 = $231.69 (or 0.86% of the withdrawal amount)

Withdrawal Reflection

Once the fee is determined, the protocol again splits it into two buckets: 60% for reflection, 40% for USDC looping liquidity.

  • $231.69 * 0.6 = $139.01 -> Reflection

  • $231.69 * 0.4 = $92.68 -> USDC looping liquidity

$139.01 worth of gmETH tokens stays within the Index contract in perpetuity and $92.68 in gmETH tokens gets sent to the protocolFeeRecipient and earmarked for USDC looping liquidity at a later date.

Last updated