Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
use zero instead of throwing error
Browse files Browse the repository at this point in the history
  • Loading branch information
tinaszheng committed Oct 13, 2023
1 parent 845cf1a commit b22e041
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uniswap/router-sdk",
"version": "1.7.1",
"version": "1.7.2",
"description": "An sdk for routing swaps using Uniswap v2 and Uniswap v3.",
"publishConfig": {
"access": "public"
Expand Down
4 changes: 1 addition & 3 deletions src/entities/trade.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ export class Trade<TInput extends Currency, TOutput extends Currency, TTradeType
return this._priceImpact
}

if (this.outputTax.equalTo(ONE_HUNDRED_PERCENT)) {
throw new Error('Unable to calculate price impact for a 100% buy-tax token')
}
if (this.outputTax.equalTo(ONE_HUNDRED_PERCENT)) return ZERO_PERCENT

let spotOutputAmount = CurrencyAmount.fromRawAmount(this.outputAmount.currency, 0)
for (const { route, inputAmount } of this.swaps) {
Expand Down

0 comments on commit b22e041

Please sign in to comment.