Scan to download
BTC $67,121.62 -0.81%
ETH $2,025.42 +0.24%
BNB $621.64 -0.11%
XRP $1.42 -4.56%
SOL $81.67 -4.53%
TRX $0.2795 -0.47%
DOGE $0.0974 -3.83%
ADA $0.2735 -4.22%
BCH $487.40 -5.43%
LINK $8.64 -2.97%
HYPE $28.98 -1.81%
AAVE $122.61 -3.42%
SUI $0.9138 -6.63%
XLM $0.1605 -4.62%
ZEC $260.31 -8.86%
BTC $67,121.62 -0.81%
ETH $2,025.42 +0.24%
BNB $621.64 -0.11%
XRP $1.42 -4.56%
SOL $81.67 -4.53%
TRX $0.2795 -0.47%
DOGE $0.0974 -3.83%
ADA $0.2735 -4.22%
BCH $487.40 -5.43%
LINK $8.64 -2.97%
HYPE $28.98 -1.81%
AAVE $122.61 -3.42%
SUI $0.9138 -6.63%
XLM $0.1605 -4.62%
ZEC $260.31 -8.86%

Paradigm: All DeFi products are perpetual contracts of power

Summary: Uniswap is a 0.5 order perpetual contract.
Foresight News
2024-03-07 17:52:40
Collection
Uniswap is a 0.5 order perpetual contract.

Written by: Joe Clark, Andrew Leone, Dan Robinson, respectively Opyn Research Director, Opyn CEO, Paradigm Research Director

Compiled by: Luffy, Foresight News

Recently, we have been pondering the issue of power perpetual contracts. Power perpetual contracts refer to derivative contracts that track the power of an index, such as the square or cube of the index. This is an interesting rabbit hole. The longer you think about power perpetual contracts, the more you will find that everything in the DeFi world is similar to it.

Here, we present three surprising points:

  • Cryptocurrency-collateralized stablecoins (like DAI or RAI) are like 0th-order perpetual contracts.
  • Margin futures (like dYdX) are 1st-order perpetual contracts.
  • Constant product AMMs like Uniswap are replicating portfolios of 0.5th-order perpetual contracts, while constant geometric mean AMMs like Balancer are replicating portfolios of power perpetual contracts with any value between 0 and 1.

This is cool because it reveals a surprisingly compact design space behind three major primitives in DeFi. Before explaining each one, we first need to define perpetual contracts and power perpetual contracts.

Definition of perpetual contracts: A type of contract that tracks an index (note: the index is usually a price, but it can also be anything measured in numerical form, such as the average temperature in San Francisco or the number of giraffes alive today), providing risk exposure without settlement. The further the trading price (mark price) is from the target price (index price), the larger the amount paid periodically (funding fee).

Graphically, the funding fee payment varies with the difference between the mark price and the index price over the funding period. If the mark price is above the index, the longs pay the shorts. If the mark price is below the index price, the shorts pay the longs.

There are many mechanisms for funding fee payments (e.g., cash or physical payments, periodic or continuous funding fees, etc.), and there are also many mechanisms for setting interest rates based on price (including the ratio mechanism used by Squeeth and the more complex PID controller used by Reflexer). But all mechanisms are based on the same idea: when the mark price is above the index price, longs should pay shorts, and vice versa.

Definition of power perpetual contracts: A type of perpetual contract that tracks the index price raised to the power of p.

To create a short position in a power perpetual contract, you first need to lock some collateral in the vault and mint (i.e., borrow) the power perpetual contract. Sell this minted power perpetual contract to go short. If you want to go long, buy from someone who holds the power perpetual contract.

This mechanism is driven by the required collateral-to-debt ratio:

*Collateral Ratio = Equity / Debt = (( Amount of Collateral ) * ( Price of Collateral )) / (( Amount of Perpetual Contracts ) * ( Index Price )^p)*

This ratio must be safely maintained above 1 to ensure there is enough collateral to repay the debt; otherwise, the contract will liquidate the collateral by buying enough perpetual contracts to close the position.

Design Space of Power Perpetual Contracts

The design space of power perpetual contracts involves the power p, the minimum collateral ratio c > 1, and three asset choices:

  • Collateral Asset: e.g., USD
  • Index Asset (the asset whose value is tokenized): e.g., ETH
  • Valuation Asset (the unit measuring value): typically USD

Now we present three propositions.

Proposition 1: Stablecoins are 0th-order power perpetual contracts

Stablecoins are loans minted against reliable collateral. The following configuration gives an example of a USD stablecoin:

  • Collateral Asset: ETH
  • Index Asset: ETH
  • Valuation Asset: USD
  • Collateral Ratio: 1.5
  • Power: 0

This means we collateralize ETH and mint stablecoin tokens. The index is the zero-th power of the ETH price, i.e., ETH^0 = 1.

If I deposit 1 ETH as collateral, and the trading price of ETH is $3000, I can mint up to 2000 tokens.

*Collateral Ratio = Equity / Debt = (( Amount of Collateral ) * ( Price of Collateral )) / (( Amount of Power Perpetual Contracts ) * ( Index Price )^p )= 1 * 3000/ (2000 * 1) = 1.5*

The funding fee is the current trading price of the stablecoin (mark price) minus the index price raised to the 0th power.

Funding Fee = Mark Price - Index Price^0 = Mark Price - 1

The funding fee mechanism provides a good incentive for the trading price of the stablecoin to anchor around $1. If its trading price is significantly above $1, users will sell their stablecoins and then mint and sell more stablecoins for profit. If the trading price is below $1, users can buy stablecoins for a positive interest rate and potentially sell them at a higher price in the future.

Not all stablecoins use this precise (mark price - index price) funding fee mechanism, but all collateralized stablecoins share this basic structure, treating stablecoins as loans against good collateral. Even stablecoins that set interest rates through governance will set them at levels similar to mark price - 1 to maintain their peg to $1.

Proposition 2: Margin Futures are 1st-order power perpetual contracts

If we modify the power of the stablecoin from the previous section to 1 and change the collateral to USD, we get a tokenized ETH asset:

  • Collateral Asset: USD
  • Index Asset: ETH
  • Valuation Asset: USD
  • Collateral Ratio: 1.5
  • Power: 1

I collateralize $4500 and mint a stable ETH (priced at $3000).

*Collateral Ratio = Equity / Debt = (( Amount of Collateral ) * ( Price of Collateral )) / (( Amount of Power Perpetual Contracts ) * ( Index Price )^p ) = 4500 *1 / (1 * 3000^1) = 1.5*

The funding fee for this perpetual contract is the trading price of USD (mark price) minus the target index price^1.

Funding Fee = Mark Price - Index Price^1= Mark Price - ETH/USD Price

The funding fee mechanism incentivizes the perpetual contract to trade close to the ETH price. If the perpetual contract price rises significantly, the funding fee will encourage arbitrageurs to buy ETH and short the perpetual contract. If the perpetual contract price falls significantly, it will encourage them to sell ETH and buy the perpetual contract.

I can sell this stable ETH asset to short the price of ETH, using USD as collateral.

From Tokenized Short Assets to Margin Short Perpetual Assets

The capital efficiency of the stable ETH asset we constructed is not very high. We put in $4500 of collateral to gain a short ETH exposure worth $3000 (or 1 ETH). We can improve capital efficiency by selling the minted ETH contract tokens (stableETH) and then using them as collateral to mint more ETH tokens.

If the minimum collateral ratio is 1.5 and ETH is $3000, we operate as follows:

  • Deposit $4500 and mint 1 ETH contract token;
  • Sell the ETH contract token for $3000, then use the USD obtained from the sale as collateral to mint 1/1.5 = 0.666 ETH contract tokens;
  • Sell the ETH contract token for $2000 and mint (1/1.5)^2 = 0.444 ETH contract tokens;
  • Sell the ETH contract token for $1333.33 and mint (1/1.5)^3 = 0.296 ETH contract tokens.

Note: Leverage can typically be calculated as 1/(Collateral Ratio - 1), in this case, leverage = 1/(1.5-1)=2.

Ultimately, we minted and sold 3 ETH contract tokens, meaning that $4500 of collateral ultimately gained $9000 of short ETH exposure. This position is equivalent to opening a 2x leveraged short ETH/USD perpetual contract.

If we could use flash trades or flash loans, this process would be simplified. We could flash swap the 3 ETH contract tokens for USD and use the proceeds as collateral to mint ETH contract tokens to repay.

If the collateral ratio requirement is 110%, we could establish a 10x position.

Going Long Instead of Shorting

If one wants to go long, users can purchase ETH contract tokens. To leverage a long position, users can borrow more USD using ETH contract tokens as collateral and use the borrowed USD to buy more ETH contract tokens, repeating the process for a maximum of 2x exposure. If using flash trades or flash loans, this can be done in a single transaction.

This means that over-collateralized perpetual contracts can be converted into under-collateralized perpetual contracts.

Proposition 3: Uniswap and other CFMMs are (almost) 0.5th-order power perpetual contracts

The value of liquidity positions in Uniswap pools is proportional to the square root of the relative price of the two assets. For the ETH/USD pool, the value for LPs (liquidity providers) is:

*V = 2 * (k * (ETH Price))^0.5*

where k is the product of the quantities of the two tokens. Each cycle of the trading pool generates a certain amount of trading fees.

Now consider the power perpetual contract:

  • Collateral Asset: USD
  • Index Asset: ETH
  • Valuation Asset: USD
  • Collateral Ratio: 1.2
  • Power: 0.5

This power perpetual contract will track the square root of the ETH price.

LPs will receive the difference between the funding fee and AMM fees. Since this trade offsets price risk, the trading price of the 0.5th-order power perpetual contract should be just below:

Expected Uniswap Fees = Index Price - Mark Price

This gives us a nice result that the equilibrium Uniswap fees (note: if the annualized volatility of the trading pair is 90%, you need to earn 1/8 * 0.9^2 = 10.125% return from LP fees. Therefore, if you have $100 of Uniswap LP, you need to earn $0.028 in fees daily to cover impermanent loss. The funding fee for the 0.5th-order power perpetual contract is 2.8 basis points per day.) should be the funding fee rate for the 0.5 perpetual contract. In a simplified case of zero interest rates:

Equilibrium Uniswap Return = σ²/8

where σ² is the variance of the price returns of one asset relative to another in the trading pool. We also derive this result from Uniswap's perspective (see Appendix C here). We also provide a detailed discussion from the perspective of power here.

Thus, stablecoins (and more broadly, collateralized loans), margin perpetual futures contracts, and AMMs are all a type of power perpetual contract.

What else is overlooked?

Higher-order power perpetual contracts: starting from second-order power perpetual contracts. Squeeth is the first second-order power perpetual contract, providing risk exposure to the square of the price. By combining higher-order power perpetual contracts and 1st-order power perpetual contracts with 0th-order power perpetual contracts as collateral, we can approximate many returns.

If we need more precise results, we can use a Taylor series of power perpetual contracts with integer powers to simulate any function: sin(x), e^x², log(x).

What’s next to look forward to? How interesting would a world be that allows power perpetual contracts, collateral assets, and Uniswap LPs to coexist harmoniously.

warnning Risk warning
app_icon
ChainCatcher Building the Web3 world with innovations.