diff --git a/ride/lp.ride b/ride/lp.ride index 73415633..92621fa5 100644 --- a/ride/lp.ride +++ b/ride/lp.ride @@ -1011,7 +1011,7 @@ func calculateAmountOutForSwapAndSendTokens(cleanAmountIn: Int, isReverse: Boole } else { getStringOrFail(this, aa()) } - let poolAssetInBalance = getAccBalance(assetIn) - i.payments[0].value().amount + let poolAssetInBalance = getAccBalance(assetIn) - i.payments[0].value().amount - feePoolAmount let poolAssetOutBalance = getAccBalance(assetOut) let amountOut = fraction(poolAssetOutBalance, cleanAmountIn, poolAssetInBalance + cleanAmountIn) @@ -1021,13 +1021,10 @@ func calculateAmountOutForSwapAndSendTokens(cleanAmountIn: Int, isReverse: Boole strict checkK = newK >= oldK || "new K is fewer error".throw() strict checkMin = amountOutMin <= amountOut || "Exchange result is fewer coins than expected".throw() - strict refreshKLpActions = refreshKLpInternal(0, 0, 0)._1 - strict rebalanceState = rebalanceAsset(assetIn) strict withdrawState = withdrawAndRebalanceAsset(assetOut, amountOut) ( withdrawState ++ rebalanceState ++ - refreshKLpActions ++ [ ScriptTransfer(addressTo.addressFromStringValue(), amountOut, assetOut.parseAssetId()) ], diff --git a/ride/lp_stable.ride b/ride/lp_stable.ride index 84e73ad1..cfe334a0 100644 --- a/ride/lp_stable.ride +++ b/ride/lp_stable.ride @@ -1061,13 +1061,11 @@ func calculateAmountOutForSwapAndSendTokens(cleanAmountIn: Int, isReverse: Boole } let newD = newXp.getD() strict checkD = newD >= D || "new D is fewer error".throw() - - strict refreshDLpActions = refreshDLpInternal(0, 0, 0)._1 ( [ ScriptTransfer(addressTo.addressFromStringValue(), totalGetRaw, assetOut.parseAssetId()) - ] ++ refreshDLpActions, + ], totalGetRaw ) } @@ -1760,3 +1758,4 @@ func verify() = { } } } +