🧠Grip: Perpetual Pools

Vi
Clayming Space
Published in
7 min readMar 8, 2022

What are Perpetuals?

Perpetuals or a perpetual futures contract also known as perpetual swap is a mandatory agreement to buy or sell an asset at an unspecified date in the future. They are different from regular futures contracts in that they do not have an pre-specified expiry date and are always cash-settled.

Perpetual futures were first suggested by Robert Shiller in 1992 to create liquid derivatives markets for highly illiquid assets[1]. But, perpetuals as an asset class really blossomed in crypto with its introduction by BitMEX in 2016.

What are Perpetual Pools?

Perpetual Pools are a spin on this financial primitive where instead of having an exchange (like FTX, Binance Futures, BitMEX, etc.) handling the nuances of perpetual swaps such as needing collateral from the user and liquidations, funding rates, ensuring a well oiled order book, etc., and on the other hand the trader needs to provide collateral, manage leverage, etc. — all this is done within a pool.

Think of it like a pool with both water and oil. Instead replace water with the long position tokens (L-tokens) and oil with the short position tokens (S-tokens). If one decides to take the long position (water), they deposit collateral (i.e. USDC in the case of Tracer Perpetuals) for long position token (water tokens). This is the same if they decide to take the short position (oil). All the collateral in the pool is balanced to match the movement of the asset’s price.

A conceptual visual of a Perpetual Pool

Theoretically, this makes it easy for anyone to launch their own pool (perpetuals exchange) — as long as its approved by the DAO. And theoretically, one can actually launch a pool of water and oil tokens providing they get a good oracle price feed.

Perpetual Pools Mechanics

When taking a position in a perpetual pool, the trader has no qualms. These positions are fungible and one cannot get liquidated or needs to worry about managing their collateral ratio. The downside is volatility decay.

When a user provides collateral (i.e. USDC), they are provided with an ERC-20 token that represents the position they took (as described above). They provide collateral in a pool that consists of value between long and short sides based on an underlying oracle price feed.

A conceptual visual of a value transfer

The value of tokens on either side is determined by the proportion of collateral held on each side (long and short) of the pool. If the price goes up, the long side gets a percentage of the short side’s collateral. If the price goes down, the short side gets a percentage of the long side’s collateral. Every time period, the value of both sides are balanced by transferring value using a transfer function that acts as leveraged exposure. This transfer function is what’s called as Power Leverage.

There are some constrains to Perpetual Pools:

  1. Sides (long/short) have to account for sensitivity to large price movements such that 100% of their collateral is never lost.
  2. An implied rate is paid to the counterparty by the trader.
  3. Traders will need to queue to enter (mint) and exit (burn) a side. Although, this is changing with V2 and currently with BTC, ETH sides one can go around this via Balancer.

What is Power Leverage?

The amount of collateral a side (long/short) gets every time price moves can be calculated in anyway but with an objective to have no expiration and liquidation, the power leverage transfer function is used.

Value Transfer formula via Power Leverage

Power leverage provides returns similar to a times leverage while also dampening returns during high volatility market events to avoid the loss of collateral[2]. This can be considered a form of leverage geometric balancing where returns go up to a certain target (say 3x) but not completely ~70% of the time, while also dampening the downside ensuring you’re still up the broader market but in the case of perpetual pools, the pool’s value is an inverse of the price change.

Let’s say we have the price of the asset denoted as P. We denote the time right now as t and the time in the future as (t+1). Therefore, price of the asset right now can be denoted as P_t and price of the asset in the future can be denoted as P_(t+1).

When there is a price increase (up only), then the amount of collateral value transferred between the short to the long side is calculated as …

Value = 1 - [P_t / P_(t+1)]^l     where l can be 1x or 3x leverage

When the price is down only, the amount of collateral value transferred between the long to the short side is calculated as…

Value = 1 - [P_(t+1) / P_t]^l     where l can be 1x or 3x leverage

A typical (times) leverage (say 3x) is 3x * 10% = 30% but, a power leverage is what you see above. This relative value transfer aspect is what ensures, collateral is never lost and gives the attributes of no liquidations and expirations. The graph 👇 depicts this visually. The upside is slightly less than a typical (times) leverage while the downside is minimized.

Value transfer for times leverage “(x)” and power leverage “(p)” functions in a 2 leverage pool

What is Rebalancing?

Rebalancing is an event inside perpetual pools that aims to balance or unbalance (long/short) sides in the pool. If a pool has equal value in long and short sides, it will unbalance to ensure collateral value on each side reflects the underlying asset price. If a pool has unequal value in long and short sides, this unevenness is called skew and traders can take advantage of this, also called skew farming.

Rebalancing Rate Formula

Skew points out that there is excess demand for positions in one side over positions in the other. As such, the side with more collateral pays an effective rate (rebalancing rate) to the side with less. This is similar to the concept of funding rate in traditional perpetual swaps.

If the rebalance rate is positive, the skew is favored toward the long position while negative favors toward the short side. The former, as an example, results in the long side gain lower than that calculated by the power leverage transfer function while the short side has greater gains.

ROI on Skew Farming

This asymmetric upside on the short side, incentivizes traders to mint into it. This rebalancing rate eventuates towards zero as traders try to farm this skew both ways. As the pools tends towards equal collateral on both sides, it effectively provides expected returns that are very similar to consistent rebalancing leveraged portfolios.

What is a Keeper?

A keeper is essentially a controller (if you’re familiar with control systems/theory). A keeper’s function is to maintain positions (upkeep) within the perpetual pool. This is typically what a trader and/or exchange would do but, is automated via a combination of an off-chain bot that triggers the Keeper smart contract to perform the rebalancing on-chain as shown in the figure below.

Rebalancing process for Perpetual Pools
  • (1.0) Trader deposits collateral into a Perpetual Pool.
  • (2.0) Collateral accumulates into the pool contract.
  • (3.0) A keeper bot triggers the keeper contract to begin the rebalance.
  • (3.1a)The pool contract asks the committer contract to verify the tokens past the time interval that qualify for minting, burning, or transfer.
  • (3.1b) The price feed is pulled from the oracle to inform rebalancing calculations.
  • (3.1c) The library calculates the rebalance.
  • (4.0) Long and short tokens are minted and/or burned and the rebalance is complete.

Anyone can run an off-chain keeper bot. Keeper bots are incentivized to trigger the contract via a fee accrual mechanism.

To end here, we discussed the main elements of Tracer Perpetual Pools. These were,

  • The concept of Perpetual Pool and how they differ to typical perpetuals
  • The mechanics behind perpetual pools
  • The notion of power leverage used to perform value transfer between long and short sides of a pool
  • The role rebalancing plays within a perpetual pool to ensure liquidation does not occur.
  • And finally, keepers. Bots that trigger rebalancing events for perpetual pools and how they are incentivized to do so.

If you think I’ve missed out on some details that may be pertinent to the piece, please reach out so I can correct it.

[1] Shiller, Robert J, 1993. “Measuring Asset Values for Cash Settlement in Derivative Markets: Hedonic Repeated Measures Indices and Perpetual Futures,” Journal of Finance, American Finance Association, vol. 48(3), pages 911–931, July.

[2] Tracer: Perpetual Pools Litepaper.

--

--

Vi
Clayming Space

Founder of Metasolis and a fifth-culture-kid. I enjoy music, reading, outdoors, making cool stuff, scify shows, shorts and movies.