Inadequate Liquidity Management During Discounted HOT Swaps
Summary
The automated market maker (AMM) system incorporates a function _hotSwap to handle Hybrid Order Type (HOT) swaps. Ive identified a potential issue where the AMM fails to update liquidity parameters during these swaps, even though other aspects such as fees and spot prices are updated. This issue is specifically pronounced in the context of discounted HOT swaps.
Vulnerability Detail
In the _hotSwap function, when executing a swap classified as a discounted HOT, the system updates various parameters including fee settings and the spot price. However, it neglects to update the liquidity metrics, which are crucial for maintaining accurate and fair trading conditions within the AMM. This oversight could lead to discrepancies between the actual liquidity available and the liquidity levels used in trading calculations, potentially impacting price accuracy and market stability.
Impact
The absence of liquidity updates during significant transaction scenarios like discounted HOT swaps can lead to several issues:
Market Efficiency and Integrity: Stale or inaccurate liquidity data can result in inefficient market operations, where prices do not reflect true market conditions.
Risk of Market Manipulation: Traders may exploit known discrepancies in liquidity reporting to their advantage, potentially leading to unfair trading practices and manipulation.
Modify the _hotSwap function to include updates to liquidity metrics alongside other updates during discounted HOT swaps. This ensures that all relevant market parameters reflect current conditions.
0xrobsol
high
Inadequate Liquidity Management During Discounted HOT Swaps
Summary
The automated market maker (AMM) system incorporates a function _hotSwap to handle Hybrid Order Type (HOT) swaps. Ive identified a potential issue where the AMM fails to update liquidity parameters during these swaps, even though other aspects such as fees and spot prices are updated. This issue is specifically pronounced in the context of discounted HOT swaps.
Vulnerability Detail
In the _hotSwap function, when executing a swap classified as a discounted HOT, the system updates various parameters including fee settings and the spot price. However, it neglects to update the liquidity metrics, which are crucial for maintaining accurate and fair trading conditions within the AMM. This oversight could lead to discrepancies between the actual liquidity available and the liquidity levels used in trading calculations, potentially impacting price accuracy and market stability.
Impact
The absence of liquidity updates during significant transaction scenarios like discounted HOT swaps can lead to several issues:
Code Snippet
https://github.com/sherlock-audit/2024-03-arrakis/blob/main/valantis-hot/src/HOT.sol#L974-L989
Tool used
Manual Review
Recommendation
Modify the _hotSwap function to include updates to liquidity metrics alongside other updates during discounted HOT swaps. This ensures that all relevant market parameters reflect current conditions.