Appearance
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
The Long Payoff is represented by phi(
The Short Payoff is represented by psi(
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(
Consider
1. Adding Liquidity
2. Open or Close a Long Position
3. Open or Close a Short Position
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
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
At any given time
Consider the following parameters at any given time
- Current Long Payoff =
- Current Short Payoff =
- Amount of LongPTokens held by an account =
- Amount of ShortPTokens held by an account =
- Amount of LongPTokens in circulation =
- Amount of ShortPTokens in circulation =
The Long Position Value(LPV) and Short Position Value(SPV) is given by,
We have the position values of the long and short tokens respectively. The calculated values are in underlying i.e in terms of PotentiaPool.sol
. Let's say