Price Impact
Price impact is a byproduct of DN-perp, but it should not be considered a fee/cost; as Overall P&L from Price Impact revolve around zero given its symmetry.
Introduction
USDC-margined perpetual contracts employ the concept of price impact to replicate the dynamics observed in traditional order book-based exchanges, a crucial adaptation given the stark differences in how synthetic perpetual and traditional exchanges operate. On conventional exchanges, participants place buy and sell orders, thereby creating a "market depth", which is the gap between the highest price buyers are willing to pay (bid), and the lowest price sellers are ready to accept (ask). Through a matching process, the interaction between these orders drives price movements, which are inherently tied to the balance of supply and demand and ultimately move asset prices.
Contrastingly, in the domain of USDC-margined perpetual swaps, the mechanism for influencing asset prices does not rely on matching individual orders. Instead, it directly interfaces with a liquidity pool, where the size of a trade immediately impacts the asset's price. This price impact mechanism simulates the order book's price change behaviour, where larger trades can significantly affect the price, similar to the concept of 'slippage' in traditional exchanges. Price changes occur when large market orders are executed at prices that differ from the expected price due to the depth of the market.
The implementation of price impact also serves other purposes:
1. Deterrence against Price Manipulation
2. Market Stability Enhancement
3. Support for Fair Price Discovery
4. No Arbitrage Risk
In summary, the incorporation of price impact within USDC-margined perpetual is multifaceted, enhancing market integrity, preventing manipulation, and ensuring stability and fairness. These mechanisms play a pivotal role in preserving the ecosystem's health and participants' confidence by simulating the price movement dynamics of traditional order books and introducing costs to large, potentially market-distorting trades.
Price Impact Functions
Where:
c is a constant factor, the genesis setting for vUSDC perp is 11.11
x represents the LP's delta position, calculated as the difference between LP’s short and long positions, then normalized by the total assets under management (AUM) like before
Index Price: Spot TWAP price that combines both Oracle Prices and Index Prices
Perp Price: Current Price of Perpetual Future (same for long/short)
LP AUM: Total amount of liquidity for this trading pair, calculated by dollar
Premium/Discount: The deviation of Perp Price from Index Price
Next Price: The price of perp after this trade finishes, as every trade will impact perp prices
Execute Price: Execute price of your open/close position (from price impact)
Premium/Discount: The deviation of Perp price from Index price, represented as a decimal (for instance, 0.05 for a 5% premium or -0.05 for a 5% discount)
To determine the number of shares N purchasable within the change of net LP position (from initial position to next position), we need to solve the integral of the reciprocal of the price function from xorig
(initial position) to xnext
(next position):
This changes the integration limits and the integral itself:
Given premium means a positive price impact (price going up), and discount means a negative price impact (price going down), the price impact has two function
When the trader's position's every 1/√c > x > 0
:
When the trader's position's every x < 0
:
Given the two functions, N behaves like this:
A trader's position that crosses delta = 0 should be broken down into two parts and calculate N separately, and then use weighted average price to get an execution price
Calculate part x > 0, you get N1. Calculate part x < 0, you get N2.
Practical Implications
These formulas for N(xnext, xorig) tell us how much BTC long/short position can be purchased when the net LP position changes from xorig to xnext. Traders and financial analysts must understand and utilize this formula to gauge the impact of large purchase orders on market prices and to strategically plan entry and exit points in trades. The model emphasizes the importance of considering LP-DN and price impact in perp trading, especially in markets where large transactions can significantly affect prices.
How P&L works with price impact
As a byproduct of the DN-perps' design, opening/closing a position would result in a positive/negative price impact unless the trade size is too small relative to LP AUM.
P&L entry: For increasing positions, a positive price impact would result in a more favourable entry price for your position. For example, when opening a long position with a favourable price impact, the position's entry price would be lower than the 'perp price after trade'.
P&L exit: For decreasing positions, a negative price impact would result in a less appealing exit price. For example, if closing a long position with a negative price impact, the position's exit price would be higher than the 'perp price after trade'.
To avoid any confusion, the displayed P&L on your panel would show an overall P&L:
As in most cases P&L entry + P&L exit = 0
, hence
Numerical Illustration for price impact calculation
Assumptions and Given Parameters:
Total AUM of LP Pool: $1,000,000
Original Position Sizes: Each for short and long were $100,000
Trader's New Position: Short $30,000
Net LP's Long Position Size x: $30,000 (130000 long, 100000 short)
BTC Index Price: $70,000
c (Price Impact Coefficient): 11.11 (Given)
Objective:
To determine the effect of a new $30,000 short position on the BTC price and calculate the number of Bitcoins shorted under these conditions.
Non-linear Price Impact Formula
The formula for the Perpetual Price after the trade, considering the non-linear price impact, is:
Step1. Calculate Shares Purchased, N
The number of shares purchasable, N, is given by the integral:
Using the given PerpPrice(x), the shares N can be calculated as:
By introducing a $30,000 short position, the non-linear price impact formula calculation shows that approximately 0.4301 BTC can be shorted (without leverage) under the given market conditions.
Step 2: Calculate Entry Price (P entry)
Entry price per BTC short based on the average price over N:
Step 3: Calculate Price Impact
Quantifying the change in perp price due to your trade:
Step 4: Determine Entry P&L from Price Impact
Let's consider the P&L from this price movement for the trader:
Step 5: Determine Overall P&L
It seems like the trader makes a 301.33 profit just by opening the position; however, if the trader closes this position immediately after opening it, the P&L from price impact will result in a 301.33 loss, given the symmetric price impact. Overall P&L from price impact will be zero when you close immediately after opening:
Hence, the Overall P&L for closing immediately after opening will also be zero.
Last updated