Skip to content

Protocol Design

This provides an extensive understanding of how Potentia works.

Potentia utilizes an Automated Market Maker (AMM) model featuring an asymptotic bonding curve, similar to other decentralized exchanges. However, it offers a unique advantage in liquidity management compared to platforms like Uniswap. While Uniswap requires liquidity providers (LPs) to manually adjust their liquidity within specific price ranges, Potentia automates this process. This automation eliminates the need for LPs to constantly monitor and manage their positions, streamlining the liquidity provision experience. As a result, Potentia's approach to liquidity concentration differs significantly from Uniswap's, offering a more hands-off solution for liquidity providers.

Implementation

Each Potentia Pool is regulated by a long and short adjustment parameter, primarily α and β. The long payoff and the short payoff are directly proportional to α and β respectively. The values of α and β are determined during the pool deployment. They change during the course of pool interactions that happen in the pool.

The Long Payoff is represented by phi(Φ) where phi is given by,

ifx<=(r2α)1kΦ(x,r,α,k)=αxkelse=rr24αxk

The Short Payoff is represented by psi(Ψ) where psi is given by,

ifx>=(2βr)1kΨ(x,r,β,k)=βx-kelse=rr2xk4β

where

  • α is the long payoff adjustment parameter
  • β is the short payoff adjustment parameter
  • r is the amount of pool reserves
  • k is the pool power i.e the power pool derivative value
  • x is the normalised price of the underlying asset

Payoff Change

Examining the payoff chart reveals a distinctive feature: long and short positions follow separate bonding curves. This approach differs significantly from traditional AMMs, which typically operate using a single bonding curve for both positions. This dual-curve system in Potentia represents a novel approach to managing market dynamics and liquidity provision.

Adding or removing liquidity to the Potentia Pool doesn't affect these payoff functions. Opening long positions only affect the long payoff phi(Φ); whereas opening short positions only affect the short payoff psi(Ψ).

Consider ΔR as the change in reserves, and the new payoff are given by Φt(x) and Ψt(x).

1. Adding Liquidity

Φt(x)=Φ(x)Ψt(x)=Ψ(x)

2. Open or Close a Long Position

Φt(x)=Φ(x)±ΔRΨt(x)=Ψ(x)

3. Open or Close a Short Position

Φt(x)=Φ(x)Ψt(x)=Ψ(x)±ΔR

Position Management

Potentia's approach to position management represents a significant departure from traditional derivative systems. While conventional platforms typically record, update, and close individual positions, Potentia employs a fundamentally different mechanism. Instead of registering unique positions, Potentia represents all positions through ERC20 tokens, known as PTokens. Each Potentia pool operates with its own set of three distinct PToken:

  • LpPToken
  • LongPToken
  • ShortPToken

When a new position is established, the system calculates the appropriate number of PTokens to mint and introduces them into circulation. These tokens are then transferred to the position creator. The position value of these PTokens effectively represents a stake in the pool, with each token type corresponding to a specific position type (liquidity provision, long, or short). This tokenized approach to position management offers a more fluid and standardized method of tracking and transferring value within the system, setting Potentia apart from traditional derivative platforms.

Consider adding ΔR for a particular long position, the newly minted LongPToken can be calculated using,

solidity
// longSupply is LongPTokens in circulation
// msg.sender is account opening the long position
// Φ is the Long Payoff
if (longSupply == 0) {
    mint(msg.sender, ΔR);
} else {
    mint(msg.sender, longSupply*ΔR / Φ);
}

Similar calculations can be done for LpPToken and ShortPToken. Hence there are no discrete positions in Potentia. It only maintains aggregated positions. Traders can close full/partial positions by burning their PTokens.'

Position Value

We have an understanding of how positions work in Potentia. Let's take a look at how we can calculate the position value for the same in underlying or USDC.

At any given time t, we can determine the position value of PTokens held by an account using the appropriate payoff function. For LongPTokens, we use Long Payoff(Φ) to calculate the position value in the underlying asset. Similarly, we can apply this method to ShortPTokens.

Consider the following parameters at any given time t,

  1. Current Long Payoff = Φ
  2. Current Short Payoff = Ψ
  3. Amount of LongPTokens held by an account = a
  4. Amount of ShortPTokens held by an account = b
  5. Amount of LongPTokens in circulation = L
  6. Amount of ShortPTokens in circulation = S

The Long Position Value(LPV) and Short Position Value(SPV) is given by,

LPV=ΦaL,SPV=ΨbS

We have the position values of the long and short tokens respectively. The calculated values are in underlying i.e in terms of WETH, WBTC etc. To calculate the values in USDC, we can simply find the current exchange rate for the underlying asset from PotentiaPool.sol. Let's say 1 WETH=q USDC. The position values in USDC are given by qLPV and qSPV respectively.