11#[ cfg( test) ]
22use crate :: params:: swap:: TradeDirection ;
33use crate :: {
4- // curve::{
5- // get_delta_amount_a_unsigned, get_delta_amount_a_unsigned_unchecked,
6- // get_delta_amount_b_unsigned, get_delta_amount_b_unsigned_unchecked,
7- // get_next_sqrt_price_from_input, get_next_sqrt_price_from_output,
8- // },
94 safe_math:: SafeMath ,
105 state:: { SwapAmountFromInput , SwapAmountFromOutput } ,
116 u128x128_math:: { mul_div_u256, Rounding } ,
12- InitialPoolInformation ,
13- LiquidityHandler ,
14- PoolError ,
7+ InitialPoolInformation , LiquidityHandler , PoolError ,
158} ;
169use anchor_lang:: prelude:: * ;
1710use ruint:: aliases:: U256 ;
@@ -368,7 +361,7 @@ pub fn get_delta_amount_b_unsigned_unchecked(
368361}
369362
370363/// Gets the next sqrt price given an input amount of token_a or token_b
371- /// Throws if price or liquidity are 0, or if the next price is out of bounds
364+ /// Throws if price or liquidity are 0, or if the next price overflow q64.64
372365pub fn get_next_sqrt_price_from_input (
373366 sqrt_price : u128 ,
374367 liquidity : u128 ,
@@ -391,7 +384,7 @@ pub fn get_next_sqrt_price_from_input(
391384}
392385
393386/// Gets the next sqrt price given an output amount of token_a or token_b
394- /// Throws if price or liquidity are 0, or if the next price is out of bounds
387+ /// Throws if price or liquidity are 0, or if the next price overflow q64.64
395388pub fn get_next_sqrt_price_from_output (
396389 sqrt_price : u128 ,
397390 liquidity : u128 ,
0 commit comments