# Summary

The current price impact mechanism on Jupiter, based solely on trade size, exposes the protocol to potential exploits. Exploiters can break down their trades into many small transactions to access a large amount of liquidity at a low price.

We recommend **implementing a price impact mechanism based on delta imbalance within a specific window**. This approach will help prevent potential exploits and ensure that LPs are compensated for providing liquidity during peak demand. Unlike the current model, which is solely a function of trade size, this new mechanism offers better protection against exploits. Additionally, incorporating funding rates and other suggested changes will enhance the systemâ€™s robustness and fairness.

We have observed that users are adapting to the current price impact model by splitting their trades into smaller, incremental transactions. This strategy allows them to avoid the increased costs associated with larger trades under the existing model.

We expect our changes to result in a slight increase in revenue from fees, with significant potential for volume growth and, consequently, higher fees.

# Price impact as a function of delta imbalance in a time window

We propose introducing a price impact fee based on the delta imbalance created in each market within a specific time window, such as a 1-minute interval. This approach addresses several key issues:

**Informed Trading:**Traders with strong signals on price movements will not benefit from splitting positions across different trades or addresses, as positions need to be opened quickly before the strategysâ€™ alpha decays.**Sharp Price Movements:**During sharp price movements, traders taking numerous one-sided positions will incur higher costs for opening their positions. This compensates for the undesirable delta imposed on the JLP.**High Volume Periods:**During periods of high trading volume in both directions, the imbalance difference will be minimal due to offsetting buy and sell trades. Thus, a high price impact fee will not be imposed, and overall volume and utilization should remain unaffected.

**Suggested Mechanism:**

For each market, we calculate the open interest imbalance (the sum of long open interest minus the sum of short open interest) after the current trade and subtract the open interest imbalance from one minute earlier (approximated by block numbers). This gives us the delta imbalance.

We then define the price impact fee as a function of the delta imbalance:

\text{price impact fee}=\text{base fee}+\text{factor}\times{\text{abs(delta imbalance)}^{exp}}

Where `factor`

and `exp`

are parameters that need to be calibrated, a close trade will only pay the base rate (i.e. for a factor of 1e-9 and exp of 2, the fee will be 20 bps for a 2M$ trade).

## Near Zero Impact on Trading Experience

Examining historical trade concentration, we calculated the delta imbalance generated over a 1-minute period. The resulting histogram is as follows:

**Analysis of Delta Imbalance and Impact on Trading Fees:**

The median delta imbalance is $3,500, with the 95th percentile at $400,000 and the 99th percentile at $1,500,000. This indicates that the price impact will exceed 15 basis points only 2% of the time (at the 1st and 99th percentiles). Consequently, excessively high fees will rarely be imposed on traders, mitigating undesirable impacts on trading activities.

## Impact on Traders

To verify no significant negative impact on traders who we do not wish to penalize, we examin the instances where high fees are incurred in percentage terms and testing their correlation with price changes, we analyzed the median fee percentage over windows of 1 minute and 10 minutes. We observed a low correlation between the median fee percentage and price change, with a correlation of 7.5% for the 1-minute period and 2.2% for the 10-minute period. Below, we present the median fee percentage versus price over a 10-minute window, highlighting the impact of the suggested price impact fee method.

## Parameter Specification

The suggested method requires specifying five parameters for each asset:

**Base Rate**: A fixed fee expressed as a percentage of the trade size.**Exp**: The exponent to which the absolute value of delta imbalance is raised.**Factor**: A multiplier applied to abs(delta imbalance)exp.**Delta Imbalance Threshold**: A threshold for the absolute value of delta imbalance. When exceeded, additional price impact fees are applied. This prevents high fees during periods of low delta imbalance, which is not the methodâ€™s target.**Max Fee**: The maximum total fee, expressed as a percentage of the trade size, to prevent excessively high fees.

We observed a volume increase over a 10-day period following the introduction of price impact (June 8, 2024, to June 19, 2024) compared to the 10-day period prior (May 23, 2024, to June 3, 2024). This increase is seen as a positive market reaction to the fee reduction, specifically through lowering the base rate to 7 bps. Therefore, we recommend maintaining the base rate at 7 bps for all assets.

The following simulations used live trade data from Jupiter from 1 May 2024 to 1 June 2024, during which there was no price impact and a fixed open/close fee of 10 bps.

### SOL

We recommend a max fee of 1%, a delta imbalance threshold of $750,000, and a factor of 5e-10. This configuration results in $11.6 million for all traders, a 30% increase compared to the benchmark. Below we present the distribution of fees within each group to further explain why we allow for this increase in fees paid by all users.

The impact on users is minimal â€” 96% of their trades only incur the base rate. We believe the remaining 4% might include some suspicious traders yet to be identified, which we plan to do.

### BTC

In the tested period mentioned above, when trade fee was fixed to 10 bps, users paid a total of $1,180,000 in open/close fees. We provide a heatmap showing the total trade (open/close) fees paid using the suggested price impact mechanism, for different delta_imbalance_thr (x-axis) and factor (y-axis), while the exponent is set to 2, and each table represents a different max_fee.

We recommend a delta imbalance threshold of $5,000,000, with a factor of 5e-11 and a max fee of 1%. This approach ensures we do not impose unnecessary limitations on the BTC market, either now or unintentionally if the market grows. These values will currently keep the feature inactive, (which can be seen by the total fees being equal to the previous fees * 0.7) only triggering it if a strong one-sided volume occurs in a short period on Jupiter.

### ETH

In the tested period mentioned above, when trade fee was fixed to 10 bps, users paid a total of $968,000 in open/close fees. Below, we provide a heatmap showing the total trade (open/close) fees paid using the suggested price impact mechanism, for different delta_imbalance_thr (x-axis) and factor (y-axis), while the exponent is set to 2, and each table represents a different max_fee.

We recommend a delta imbalance threshold of $5,000,000, with a factor of 5e-11 and a max fee of 1%. This approach ensures we do not impose unnecessary limitations on the ETH market, either now or unintentionally, if the market grows. These values will currently keep the feature inactive (which can be seen by the total fees being equal to the previous fees * 0.7), only triggering it if a strong one-sided volume occurs in a short period on Jupiter.

### Impact on JLP returns

As previously mentioned, despite the fee reduction in most SOL trades, the total fees collected increased by 30% during the tested period before the current price impact implementation. Since the introduction of the current price impact mechanism, fees collected from the SOL market have risen by 15% for approximately the same volume. Consequently, we anticipate a further increase in collected fees from the SOL market. Given that fees will be lower for the majority of trades, it is reasonable to expect growth in volume.

Regarding the BTC and ETH markets, the introduction of price impact as a function of trade size, with a 7 bps base rate, resulted in a ~3.5% decrease in ETH volume, while BTC volume increased by 30%. We expect traders to mainly pay the base rate on these markets with the suggested values, reflecting a 30% discount. Assuming the same impact on volume, we anticipate the total volume in these markets to increase by ~13.25%, which should result in a ~20% reduction in collected fees. However, since there will be no penalty for large trades in these markets, we expect volumes to increase further, leading to sustained or even enhanced revenue from fees.

To summarize, SOL accounted for 76% of accumulated fees from 1/6/2024 to 8/7/2024, while BTC and ETH each accounted for 12%. We expect fees to increase in the SOL market, with a likely rise in volume as well. For BTC and ETH, we foresee a decrease in collected fees; however, volume growth could offset this. Overall, due to the significant weight of SOL in income, we expect a 20% increase compared to the period before the price impact introduction, and a 6% increase compared to the period after.

# Recommendations

Asset | base rate | factor | exp | delta_imbalance_thr | max_fee |
---|---|---|---|---|---|

SOL | 7 bps | 5e-10 | 2 | 750,000 | 1% |

BTC | 7 bps | 5e-11 | 2 | 5,000,000 | 1% |

ETH | 7 bps | 5e-11 | 2 | 5,000,000 | 1% |