From fa70cfd97162f635538ad1d342bae2369efe131c Mon Sep 17 00:00:00 2001 From: Tina Zheng Date: Fri, 13 Oct 2023 17:18:10 -0400 Subject: [PATCH] add error for 100% buy tax --- src/constants.ts | 1 + src/entities/trade.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/constants.ts b/src/constants.ts index fd46151..5245873 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -11,3 +11,4 @@ export const ONE = JSBI.BigInt(1) export const V2_FEE_PATH_PLACEHOLDER = 8388608 export const ZERO_PERCENT = new Percent(ZERO) +export const ONE_HUNDRED_PERCENT = new Percent(100, 100) diff --git a/src/entities/trade.ts b/src/entities/trade.ts index 9b0c267..7c2a0a7 100644 --- a/src/entities/trade.ts +++ b/src/entities/trade.ts @@ -2,7 +2,7 @@ import { Currency, CurrencyAmount, Fraction, Percent, Price, TradeType } from '@ import { Pair, Route as V2RouteSDK, Trade as V2TradeSDK } from '@uniswap/v2-sdk' import { Pool, Route as V3RouteSDK, Trade as V3TradeSDK } from '@uniswap/v3-sdk' import invariant from 'tiny-invariant' -import { ONE, ZERO, ZERO_PERCENT } from '../constants' +import { ONE, ONE_HUNDRED_PERCENT, ZERO, ZERO_PERCENT } from '../constants' import { MixedRouteSDK } from './mixedRoute/route' import { MixedRouteTrade as MixedRouteTradeSDK } from './mixedRoute/trade' import { IRoute, MixedRoute, RouteV2, RouteV3 } from './route' @@ -198,6 +198,10 @@ export class Trade