Comparing version 0.28.0 to 0.29.0
@@ -171,3 +171,3 @@ "use strict"; | ||
if (this.lastAmountChange === 'amountToReceive' && this.amountToReceive) { | ||
const { amountToUse, maximumSelling, liquidityProviderFee, priceImpact, priceInverse } = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapFields({ | ||
const { amountToUse, maximumSelling, minimumReceived, liquidityProviderFee, priceImpact, priceInverse } = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapFields({ | ||
network: __classPrivateFieldGet(this, _FlamingoSwapControllerService_network, "f"), | ||
@@ -183,3 +183,3 @@ amountToReceive: this.amountToReceive, | ||
this.maximumSelling = maximumSelling; | ||
this.minimumReceived = null; | ||
this.minimumReceived = minimumReceived; | ||
this.liquidityProviderFee = liquidityProviderFee; | ||
@@ -192,3 +192,3 @@ this.priceImpact = priceImpact; | ||
if (this.lastAmountChange === 'amountToUse' && this.amountToUse) { | ||
const { amountToReceive, minimumReceived, liquidityProviderFee, priceImpact, priceInverse } = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapFields({ | ||
const { amountToReceive, minimumReceived, maximumSelling, liquidityProviderFee, priceImpact, priceInverse } = FlamingoSwapHelper_1.FlamingoSwapHelper.getSwapFields({ | ||
network: __classPrivateFieldGet(this, _FlamingoSwapControllerService_network, "f"), | ||
@@ -204,3 +204,3 @@ amountToUse: this.amountToUse, | ||
this.minimumReceived = minimumReceived; | ||
this.maximumSelling = null; | ||
this.maximumSelling = maximumSelling; | ||
this.liquidityProviderFee = liquidityProviderFee; | ||
@@ -207,0 +207,0 @@ this.priceImpact = priceImpact; |
@@ -74,3 +74,3 @@ "use strict"; | ||
const price = amountToUse.div(amountToReceive); | ||
const midPrice = route.reduce((acc, item) => acc.times(item.reserveIn).div(item.reserveOut), this.BN_1); | ||
const midPrice = route.reduce((acc, item) => acc.times(item.reservesToUse).div(item.reservesToReceive), this.BN_1); | ||
const priceImpact = price.minus(midPrice).div(price).minus(fee.div(amountToUse)); | ||
@@ -77,0 +77,0 @@ return { |
{ | ||
"name": "bs-neo3", | ||
"version": "0.28.0", | ||
"version": "0.29.0", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "types": "dist/index.d.ts", |
97201