diff --git a/src/entities/trade.test.ts b/src/entities/trade.test.ts index 1e6dcf7..2cc199b 100644 --- a/src/entities/trade.test.ts +++ b/src/entities/trade.test.ts @@ -1192,7 +1192,7 @@ describe('Trade', () => { }) // v3 sdk price impact tests describe('#priceImpact', () => { - describe('with FOT fees', () => { + describe('with FOT sell fees', () => { const routev3 = new V3RouteSDK([pool_tax_output], weth, token4WithTax) const trade = new Trade({ v2Routes: [], @@ -1214,6 +1214,28 @@ describe('Trade', () => { }) }) + describe('with FOT buy fees', () => { + const routev3 = new V3RouteSDK([pool_tax_input], token5WithTax, weth) + const trade = new Trade({ + v2Routes: [], + v3Routes: [ + { + routev3, + inputAmount: CurrencyAmount.fromRawAmount(token5WithTax, 100), + outputAmount: CurrencyAmount.fromRawAmount(weth, 69), + }, + ], + tradeType: TradeType.EXACT_INPUT, + }) + + it('is cached', () => { + expect(trade.priceImpact === trade.priceImpact).toStrictEqual(true) + }) + it('is correct', () => { + expect(trade.priceImpact.toSignificant(3)).toEqual('00.0') + }) + }) + describe('tradeType = EXACT_INPUT', () => { const routev3 = new V3RouteSDK([pool_0_1, pool_1_2], token0, token2) const mixedRoute = new MixedRouteSDK([pool_0_1, pool_1_2], token0, token2)