Skip to content

Commit

Permalink
fix UniV3 tick comparison bug
Browse files Browse the repository at this point in the history
  • Loading branch information
0xDmtri committed Nov 2, 2024
1 parent 5bfb008 commit 7fd3e96
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/amm/uniswap_v3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ impl UniswapV3Pool {

if liquidity_delta != 0 {
//if the tick is between the tick lower and tick upper, update the liquidity between the ticks
if self.tick > tick_lower && self.tick < tick_upper {
if self.tick >= tick_lower && self.tick < tick_upper {
self.liquidity = if liquidity_delta < 0 {
self.liquidity - ((-liquidity_delta) as u128)
} else {
Expand Down

0 comments on commit 7fd3e96

Please sign in to comment.