Skip to content

Commit

Permalink
fix: typo causing failed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AustinWoetzel committed Mar 29, 2024
1 parent 2bc844c commit 80f593f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/swap/stableswapCurve/stable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,9 @@ export class StableConfig {
newPool1: pool1Size,
tradeDirIs0For1,
});
throw Error(`The price impact of this trade (${priceImpact.toString()}%) is outside of the acceptable range of 0% - ${this.priceImpactLimit}%. `);
if (priceImpact.isGreaterThan(this.priceImpactLimit) || priceImpact.isLessThan(BigNumber(0))) {
throw Error(`The price impact of this trade (${priceImpact.toString()}%) is outside of the acceptable range of 0% - ${this.priceImpactLimit}%.`);
}
}

// Returns the price impact associated with new x and y values (pool sizes),
Expand Down

0 comments on commit 80f593f

Please sign in to comment.