GammaSwap Docs
Comment on page


Terms used in the docs and GammaSwap Research



The annual percentage yield (APY) is the real rate of return earned on an investment, taking into account the effect of compounding interest. Unlike simple interest, compounding interest is calculated periodically and the amount is immediately added to the balance.
With r being the period rate and n the number of compounding periods, we can obtain the APY through this formula:
APY=(1+r/n)1APY = (1 + r / n)ⁿ - 1

Automated Market Maker (AMM)

An Automated Market Maker (AMM) is a type of decentralized exchange (DEX) protocol that relies on a mathematical formula to determine the price of assets. Instead of using an order book like a traditional exchange, where buy and sell orders are matched between market participants, an AMM facilitates trades between users and a liquidity pool.

Constant Function Market Maker (CFMM)

Constant Function Market Maker (CFMM) is a type of Automated Market Maker (AMM) used in decentralized finance (DeFi) that relies on a specific mathematical formula, or "constant function," to automatically set the price of assets in its liquidity pool. A CFMM operates based on a constant function that defines the relationship between the quantities of tokens in the liquidity pool. The function is designed such that, despite the quantities of tokens in the pool changing due to trades, some invariant (constant) relationship is maintained between them. For the constant product market maker (like Uniswap V2), the constant function is x * y = k where where
are the quantities of two tokens in the pool, and
is a constant.

Impermanent Loss (IL)

This is a risk associated with providing liquidity in an AMM. Impermanent loss occurs when the price of the tokens in the pool changes compared to when they were deposited, and the value of the pool tokens becomes less than what the liquidity providers would have had if they just held onto their tokens. The loss is 'impermanent' because it can be mitigated if the prices return to their original state.d

Impermanent Gain (IG)

Impermanent Gain is a term popularized by GammaSwap. It refers to the profit that Liquidity Borrowers achieve from shorting an LP position. When a Volatility Perpetual position is opened, the LP tokens are burned for the underlying tokens and held in the GamamSwap smart contract. If there is volatility, the reserve tokens can be redeemed for more LP tokens. This is how GammaSwap turns Impermanent Loss into Impermanent Gain.


In finance, a "straddle" is an options trading strategy in which the investor holds a position in both a call option and a put option with the same strike price and expiration date. This strategy is used when an investor expects a significant price movement in the underlying asset but is unsure of the direction that the movement will take (up or down). In GammaSwap, a "straddle" is just a borrowed LP position that is taken At The Money (ATM), so opened at the current price. It resembles the returns of a "Long Straddle" and is a position that profits from volatility in either price direction.


Delta measures the sensitivity of the price of a position to a $1 change in the price of the underlying asset. It provides an estimate of how much the value of the position would change given a $1 change in the price of the underlying asset.


Leverage is used to amplify the potential returns from an investment, but it also comes with a higher level of risk. At its core, leverage involves borrowing capital to invest in a particular asset or financial instrument. This borrowed capital is often referred to as "debt" or "leverage." It allows investors to take larger positions with smaller amount of capitals and earn high returns. Leverage isn't free though. The cost is typically reflected by higher interest payments and larger losses. Just as leverage amplifies gains, it can also amplify losses.

Perpetual Future

Perpetual futures, also known as a perpetual swap, is a type of derivative contract that allows traders to take long or short positions on an underlying asset. Unlike traditional futures contracts, perpetual futures have no expiration date, so they can theoretically be held indefinitely. This feature makes perpetual futures behave similarly to spot markets, while still allowing traders to benefit from using leverage.


"Margin" refers to the amount of capital that a trader must deposit for the position as collateral to open a position. It also is used to maintain the borrowed position and if the margin level is below the liquidation threshold, the position will be subject for liquidation.

Volatility Perpetual

A Volatility Perpetual is a perpetual position that can be taken in the form of a Long, Short or Straddle. It resembles the returns of a Perpetual Option and is available on any asset. It can be used to hedge risk for AMM LPs or spot traders and of course to speculate on volatility. Unlike a Perpetual Future, there is no delta risk. You can not get liquidated from price movements.
Uniswap: An Options Market by Daniel Alcarraz

Time to Liquidation

In GammaSwap, Liquidations are based off LTV and not price. The Time to Liquidation depends on how far away the LTV is away from the Liquidation Threshold. The Time to Liquidation can be reduced if the LTV is reduced or if the borrow rate is lowered.

Flash Loan

A flash loan is a feature offered only in DeFi that allows users to borrow an asset with zero collateral under the condition that the loan is repaid within the same transaction block in which it was borrowed. If the loan is not fully repaid by the end of that transaction block, the entire transaction (including all the actions taken with the borrowed funds) is reversed and behaves as if it had never happened, ensuring the lender does not lose any funds.

Liquidity Invariant

A "Liquidity Invariant" refers to a constant value that is maintained as trades occur within the AMM. This invariant is a mathematical formula relating to the quantities of the different assets held in the liquidity pool. It is designed to ensure that trades do not drain the pool and that there is always liquidity available for traders. The invariant is key to how an AMM prices assets and determines how much a trader receives when they trade one asset for another. The most popular example was pioneered by Uniswap, the x * y = k formula, where x is the quanity of Asset A in the liquidity pool and y is the quanity of Asset B in the liquidty pool. According to this model, no matter how the quantities of x and y change due to trades, their product remains constant except through the growth in fees.

Liquidity Invariant Unit

A Liquidity Invariant Unit is the measurement of the Liquidity Invariant. The total Liquidity Invariant Units remained fixed with changes in token price but grows over time through the accrual of fees.


Oracles are third-party services that provide smart contracts with external information. They serve as bridges between blockchains and the outside world. In DeFi applications, they are typically used to provide real-time information on asset prices, interest rates, and other relevant financial data. The most popular Oracle is Chainlink and most platforms that offer leverage are reliant on them.

Oracle Free

Oracle Free is a protocol that is simply not reliant on an oracle. Oracles are important and power many DeFi applications with real time pricing information; however, they constrain the amount of assets that a protocol can support and are not permissionless. It is also another dependency which could affect the security of a protocol, in the case of a Flash Loan attack or fraudelent pricing information.
Instead of relying on Oracles, GammaSwap uses the Liquidity Invariant to price the debt of GammaSwap Perpetual positions. This enables GammaSwap to minimize dependencies and support leverage trading on any asset as soon as a pool is created in a DEX.


In AMMs, the larger the trade relative to the size of the liquidity pool, the more the price the trader receives may vary from the current “Market Price”. This price difference due to the size of a trade is called slippage. Smaller pools generally have higher slippage, while larger pools tend to have lower slippage.


Volatility refers to the degree of variation of a trading price series over a certain period of time. High volatility often results in wider price swings, which can create trading opportunities and potential for significant gains and losses. Low volatility generally indicates a less risky, but also potentially less rewarding, trading environment.
  • Historical Volatility measures past price fluctuations and is calculated using historical data, such as past prices or returns. It gives traders an idea of past price trends but does not predict future price movements.
  • Implied Volatility, on the other hand, is a metric that gives an estimate of future volatility of an asset, and it is often derived from the prices of options on that asset. It is a crucial input in options pricing models, like the Black-Scholes model.

Loss Versus Rebalancing (LVR)

LVR is a measurement of the cost of providing liquidity. It is a better metric than Impermanent Loss because it takes into account price trajectory, toxic order flow and a running cost over time. Its most significant inference is that LP fee revenue should be dynamic and tied to volatility, σ².