File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -195,7 +195,12 @@ func (k Keeper) UpdatePoolForSwap(
195195
196196 // convert the fees into USD
197197 swapFeeValueInUSD := k .CalculateCoinsUSDValue (ctx , swapFeeInCoins )
198- slippageAmountInUSD := k .CalculateUSDValue (ctx , tokenIn .Denom , slippageAmount .Dec ().TruncateInt ())
198+ slippageAmountInUSD := osmomath .ZeroBigDec ()
199+ if givenOut {
200+ slippageAmountInUSD = k .CalculateUSDValue (ctx , tokenIn .Denom , slippageAmount .Dec ().TruncateInt ())
201+ } else {
202+ slippageAmountInUSD = k .CalculateUSDValue (ctx , tokenOut .Denom , slippageAmount .Dec ().TruncateInt ())
203+ }
199204 weightRecoveryFeeAmountInUSD := k .CalculateUSDValue (ctx , tokenIn .Denom , weightRecoveryFeeAmount )
200205 bonusTokenAmountInUSD := k .CalculateUSDValue (ctx , tokenOut .Denom , bonusTokenAmount )
201206 takerFeesAmountInUSD := k .CalculateCoinsUSDValue (ctx , takerFeesInCoins )
You can’t perform that action at this time.
0 commit comments