Stealth Addresses Explained (And How To Use Them)
A simple explainer of stealth addresses, the plans for making them standardized for Ethereum and a walkthrough of how to use stealth addresses on Optimism today! When looking at the overall DeFi market, privacy-preserving protocols only make up a very small part of it by total value locked. According to statistics provided by DeFiLlama, just 0.52% of the entire TVL is attributed to privacy applications, with Aztec and Tornado Cash taking the lion’s share. Cryptocurrencies hold a lot of potent...
The Arrival of Real Yield: Lazy River 2.0
The most anticipated feature on Perp is finally here: USDC fee sharing! As a big upgrade to our staking program on Optimism, Lazy River 2.0 will begin distributing a stablecoin yield to vePERP holders from the protocol’s revenue.To start earning yield, you’ll first need to hold some PERP on Optimism. Check out this guide which provides a walkthrough for bridging to Optimism (we recommend using Optimism Gateway) and view the exchanges where you can buy PERP here.With the arrival of real yield,...

How to Hedge Against Impermanent Loss with Deribit’s Volatility Futures
In this guide, we’ll show you how you can hedge against impermanent loss when providing liquidity to Perp’s Bitcoin market using Deribit’s newly launched volatility futures product. Makers (AKA liquidity providers) on Perp can earn trading fees and liquidity mining rewards. However, as the price moves away from your entry point and traders consume the liquidity you provide, you face impermanent loss (or IL for short). But there are ways to hedge described in the article below. How to Mitigate...
Trustless crypto trading for everyone!
Stealth Addresses Explained (And How To Use Them)
A simple explainer of stealth addresses, the plans for making them standardized for Ethereum and a walkthrough of how to use stealth addresses on Optimism today! When looking at the overall DeFi market, privacy-preserving protocols only make up a very small part of it by total value locked. According to statistics provided by DeFiLlama, just 0.52% of the entire TVL is attributed to privacy applications, with Aztec and Tornado Cash taking the lion’s share. Cryptocurrencies hold a lot of potent...
The Arrival of Real Yield: Lazy River 2.0
The most anticipated feature on Perp is finally here: USDC fee sharing! As a big upgrade to our staking program on Optimism, Lazy River 2.0 will begin distributing a stablecoin yield to vePERP holders from the protocol’s revenue.To start earning yield, you’ll first need to hold some PERP on Optimism. Check out this guide which provides a walkthrough for bridging to Optimism (we recommend using Optimism Gateway) and view the exchanges where you can buy PERP here.With the arrival of real yield,...

How to Hedge Against Impermanent Loss with Deribit’s Volatility Futures
In this guide, we’ll show you how you can hedge against impermanent loss when providing liquidity to Perp’s Bitcoin market using Deribit’s newly launched volatility futures product. Makers (AKA liquidity providers) on Perp can earn trading fees and liquidity mining rewards. However, as the price moves away from your entry point and traders consume the liquidity you provide, you face impermanent loss (or IL for short). But there are ways to hedge described in the article below. How to Mitigate...
Trustless crypto trading for everyone!

Subscribe to Nekodex by Perpetual Protocol 🥨

Subscribe to Nekodex by Perpetual Protocol 🥨
Share Dialog
Share Dialog
>400 subscribers
>400 subscribers

Introducing mark price, an important upgrade improving the fairness and stability of trading on Perp, as well as reducing the risk of price manipulation and the likelihood of bad debt.
Perp utilizes the Index Time-weighted Average Price (TWAP) to determine margin requirements and liquidation processes in order to prevent unnecessary liquidations caused by price manipulation. However, this approach also poses a risk to the protocol.
Frequently, the Index TWAP is unable to promptly capture the current market conditions. In particular, when there are swift changes in the market, the market price may diverge from the Index TWAP.
If the market price and the Index TWAP exhibit a significant discrepancy, the following outcomes may occur:
The inability to instantly liquidate the accounts of traders, both takers and makers, who may be close to bankruptcy.
The lack or excess of incentives for liquidators. This is because Perp utilizes the Index TWAP as the closing price for liquidation, which may result in liquidators having insufficient motivation to liquidate positions or being overly incentivized to do so. This could lead to losses that the system would need to compensate for. When liquidating a short position for example, if the index price is higher than the market price, this will give liquidators a huge incentive to liquidate a position and vice versa.
These issues may lead to delayed liquidations of trader accounts and might discourage liquidators from taking over positions, which could result in increased losses and risk of bad debt for the protocol. To reduce potential risks, we have introduced the Mark Price, which provides an accurate and fair reference price for margin requirement calculation and liquidations.
Mark Price = Median of [Price 1, Price 2, Perpetual Contract Price]
Price 1 = Market TWAP (30-minute Basis)
Price 2 = Index Price + Premium (15-minute Basis)*
*Premium (15-minute Basis) = Market TWAP (15-minute Basis) - Index TWAP (15-minute Basis)
Previously, we referred to the perpetual contract price as the mark price when computing the funding rate. To prevent confusion regarding naming conventions, we have introduced a new function called getSqrtMarketTwapX96 within the Exchange contract (link). As a result, we intend to phase out the prior function, getSqrtMarkTwapX96, in a future release.
Original (to be deprecated):
function getSqrtMarkTwapX96(address baseToken, uint32 twapInterval) external view returns (uint160 sqrtMarkTwapX96);
Added:
function getSqrtMarketTwapX96(address baseToken, uint32 twapInterval) external view returns (uint160 sqrtMarketTwapX96);
We have included a new function in the AccountBalance contract (link) called getMarkPrice, which allows for the retrieval of the current mark price for each market.
function getMarkPrice(address baseToken) external view returns (uint256);
PositionValue will be changed to be calculated based on Mark Price instead of Index TWAP.
UnrealizedPnL, MarginRequirement, AccountValue and FreeCollateral also change due to the adjusted calculation method for position values.
Price for liquidation: use Mark Price to liquidate positions instead of Index TWAP.
In conclusion, the introduction of the Mark Price is an important upgrade that will help improve the fairness and stability of perpetual contract trading on our platform. These design changes make trading more accessible and user-friendly for traders of all levels, while still maintaining the high standards of reliability and security that Perp is known for.
By providing a more accurate and reliable reference price for the settlement of perpetual contracts, the Mark Price will help reduce the risk of price manipulation as well as the likelihood of bad debts and liquidations.
Finally, we want to remind users that since the calculation of margin requirements will change, please make sure your account leverage is at a healthy level (i.e., a margin ratio well above 10%) before the contract upgrade, which is scheduled to take place on March 14th. Please watch the announcement channels in our Discord for the latest updates.

Introducing mark price, an important upgrade improving the fairness and stability of trading on Perp, as well as reducing the risk of price manipulation and the likelihood of bad debt.
Perp utilizes the Index Time-weighted Average Price (TWAP) to determine margin requirements and liquidation processes in order to prevent unnecessary liquidations caused by price manipulation. However, this approach also poses a risk to the protocol.
Frequently, the Index TWAP is unable to promptly capture the current market conditions. In particular, when there are swift changes in the market, the market price may diverge from the Index TWAP.
If the market price and the Index TWAP exhibit a significant discrepancy, the following outcomes may occur:
The inability to instantly liquidate the accounts of traders, both takers and makers, who may be close to bankruptcy.
The lack or excess of incentives for liquidators. This is because Perp utilizes the Index TWAP as the closing price for liquidation, which may result in liquidators having insufficient motivation to liquidate positions or being overly incentivized to do so. This could lead to losses that the system would need to compensate for. When liquidating a short position for example, if the index price is higher than the market price, this will give liquidators a huge incentive to liquidate a position and vice versa.
These issues may lead to delayed liquidations of trader accounts and might discourage liquidators from taking over positions, which could result in increased losses and risk of bad debt for the protocol. To reduce potential risks, we have introduced the Mark Price, which provides an accurate and fair reference price for margin requirement calculation and liquidations.
Mark Price = Median of [Price 1, Price 2, Perpetual Contract Price]
Price 1 = Market TWAP (30-minute Basis)
Price 2 = Index Price + Premium (15-minute Basis)*
*Premium (15-minute Basis) = Market TWAP (15-minute Basis) - Index TWAP (15-minute Basis)
Previously, we referred to the perpetual contract price as the mark price when computing the funding rate. To prevent confusion regarding naming conventions, we have introduced a new function called getSqrtMarketTwapX96 within the Exchange contract (link). As a result, we intend to phase out the prior function, getSqrtMarkTwapX96, in a future release.
Original (to be deprecated):
function getSqrtMarkTwapX96(address baseToken, uint32 twapInterval) external view returns (uint160 sqrtMarkTwapX96);
Added:
function getSqrtMarketTwapX96(address baseToken, uint32 twapInterval) external view returns (uint160 sqrtMarketTwapX96);
We have included a new function in the AccountBalance contract (link) called getMarkPrice, which allows for the retrieval of the current mark price for each market.
function getMarkPrice(address baseToken) external view returns (uint256);
PositionValue will be changed to be calculated based on Mark Price instead of Index TWAP.
UnrealizedPnL, MarginRequirement, AccountValue and FreeCollateral also change due to the adjusted calculation method for position values.
Price for liquidation: use Mark Price to liquidate positions instead of Index TWAP.
In conclusion, the introduction of the Mark Price is an important upgrade that will help improve the fairness and stability of perpetual contract trading on our platform. These design changes make trading more accessible and user-friendly for traders of all levels, while still maintaining the high standards of reliability and security that Perp is known for.
By providing a more accurate and reliable reference price for the settlement of perpetual contracts, the Mark Price will help reduce the risk of price manipulation as well as the likelihood of bad debts and liquidations.
Finally, we want to remind users that since the calculation of margin requirements will change, please make sure your account leverage is at a healthy level (i.e., a margin ratio well above 10%) before the contract upgrade, which is scheduled to take place on March 14th. Please watch the announcement channels in our Discord for the latest updates.
No activity yet