Squeeze Docs
  • 😀Welcome!
  • 🧽Introduction
  • 🪙Token Launch
  • 📒Math
    • 📈Leverage
    • 📖Open Fee
  • 🔗Links
  • ⚙️Integration Guide
Powered by GitBook
On this page
  • Liquidity
  • Examples
  • Liquidity Banks
  • Shorts
  • Longs
  1. Math

Leverage

Oh no it's math

PreviousMathNextOpen Fee

Last updated 7 months ago

Squeeze enables leverage trading by utilizing the same LP used for swaps eliminating the need to source new liquidity. This is in contrast to how most synthetics work, as we can see from how the liquidity in perpetual futures markets does not affect spot markets. Long-tail assets cannot afford to fragment liquidity away from spot markets and often lack a price feed making Squeeze the optimal solution to enable leverage within these constraints.

The basic principle is that longs and shorts borrow liquidity from the buy or sell side to dump into the other side.

Liquidity

CLMM liquidity is expressed with their heights at each tick like the following.

The most important thing to understand is that we're borrowing liquidity, and the same "amount" of liquidity means different things depending on which price range the liquidity is provided in. 1 unit of liquidity is composed of more of one asset B and less of asset A if the price range is set higher where the price of A is higher.

Examples

Initial

When using a CLMM to seed liquidity, usually only the sell side is set up with "even" distribution. While the liquidity is "even", the number of tokens in each tick is exponentially smaller as we get further to the right. The price of the token becomes higher as we move to the right and fewer tokens are needed to have the same liquidity value. A good analogy would be how Greenland looks as big as Africa on a map, but smaller than a single African country such as Algeria if seen on a globe.

Active

An actively traded CLMM with only one liquidity provider would look something like this.

Liquidity Banks

In practice, Squeeze manages LP by splitting it up into liquidity banks, which are concentrated liquidity positions that traders can borrow from. This makes the LP manipulation easier to manage.

Shorts

When a short is initiated, traders choose which liquidity banks they want to borrow from. The closer the selected liquidity bank is to the current price, the higher the leverage available to the trader. If the price moves beyond the furthest tick out of the liquidity banks chosen, the position can be liquidated. The collateral for the position is composed of three components:

  • User-Provided Collateral: The amount the trader initially puts up.

  • Collateral from the Liquidity Bank: When the bank being borrowed from is actively trading and has a mix of both assets, the collateral asset from removing liquidity also contributes.

  • Swapped Asset Collateral: The proceeds from swapping the borrowed asset into the other side of the pair.

The sum of these components must be enough to fully repay the borrowed liquidity when the price shifts across the liquidity bank range flipping them. Since the price range is constant, the collateral requirement is independent of the active price preventing bad debt even with delayed liquidations.

There is an open fee that makes the amount of liquidity to repay slightly higher than what was borrowed. This fee ensures that as leverage activity increases, the liquidity in the pool thickens, improving market depth and stability.

Longs

Longs in Squeeze are essentially shorts with an initial swap to simulate a long position. Whether using asset A as collateral to borrow asset B or vice versa, both setups are technically shorts from different perspectives.

In practice, a long is just a short with a swap performed beforehand. The result of this swap functions like user-provided collateral, allowing traders to effectively "long" one asset by borrowing and swapping another, while maintaining the same underlying mechanics as a short.

We will be using the same methodology to explain how liquidity is modified under each circumstance. To learn more about CLMM, read about it here, and .

📒
📈
part 1
part 2
ETH/WBTC pool on Uniswap