diff --git a/packages/swap/src/helpers/orders/factories/makeOrderCalculations.test.ts b/packages/swap/src/helpers/orders/factories/makeOrderCalculations.test.ts index 1e7a96c267..2282792cc6 100644 --- a/packages/swap/src/helpers/orders/factories/makeOrderCalculations.test.ts +++ b/packages/swap/src/helpers/orders/factories/makeOrderCalculations.test.ts @@ -113,14 +113,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - actualPrice: '0.06716171329034198007', - base: '0.06693552899045170664', - difference: '0.418183996965910966', - market: '0.06693552899045170664', - priceImpact: '0.33791366603308449', - withFees: '0.06721544266097425366', - withFeesAndSlippage: '0.06721544266097425366', - withSlippage: '0.06716171329034198007', + actualPrice: '0.0671617132', + base: '0.0669355289', + difference: '0.4181839969', + market: '0.0669355289', + priceImpact: '0.3379136660', + withFees: '0.0672154426', + withFeesAndSlippage: '0.0672154426', + withSlippage: '0.0671617132', }, pool: pools[0]!, }) @@ -227,14 +227,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '0.06693552899045170664', - market: '0.06693552899045170664', - actualPrice: '0.06716171329034198007', - withSlippage: '0.06716171329034198007', - withFees: '0.06721544266097425366', - withFeesAndSlippage: '0.06721544266097425366', - difference: '0.418183996965910966', - priceImpact: '0.33791366603308449', + base: '0.0669355289', + market: '0.0669355289', + actualPrice: '0.0671617132', + withSlippage: '0.0671617132', + withFees: '0.0672154426', + withFeesAndSlippage: '0.0672154426', + difference: '0.4181839969', + priceImpact: '0.3379136660', }, pool: pools[0], } as SwapOrderCalculation) @@ -341,14 +341,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '0.06693552899045170664', - market: '0.06693552899045170664', - actualPrice: '0.0671617132966569541', - withSlippage: '0.0671617132966569541', - withFees: '0.06721544266729427966', - withFeesAndSlippage: '0.06721544266729427966', - difference: '0.418184006407871156', - priceImpact: '0.337913675467497163', + base: '0.0669355289', + market: '0.0669355289', + actualPrice: '0.0671617132', + withSlippage: '0.0671617132', + withFees: '0.0672154426', + withFeesAndSlippage: '0.0672154426', + difference: '0.4181840064', + priceImpact: '0.3379136754', }, pool: pool, } as SwapOrderCalculation) @@ -455,14 +455,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '0.06693552899045170664', - market: '0.06693552899045170664', - actualPrice: '0.0671617132966569541', - withSlippage: '0.0671617132966569541', - withFees: '0.06721544266729427966', - withFeesAndSlippage: '0.06721544266729427966', - difference: '0.418184006407871156', - priceImpact: '0.337913675467497163', + base: '0.0669355289', + market: '0.0669355289', + actualPrice: '0.0671617132', + withSlippage: '0.0671617132', + withFees: '0.0672154426', + withFeesAndSlippage: '0.0672154426', + difference: '0.4181840064', + priceImpact: '0.3379136754', }, pool: pool, } as SwapOrderCalculation) @@ -564,14 +564,14 @@ describe('makeOrderCalculations', () => { hasSupply: true, prices: { - base: '0.99009900990099009901', - market: '0.99009900990099009901', - actualPrice: '1', - withSlippage: '2', - withFees: '1', - withFeesAndSlippage: '2', - difference: '1', - priceImpact: '1', + base: '0.9900990099', + market: '0.9900990099', + actualPrice: '1.0000000000', + withSlippage: '2.0000000000', + withFees: '1.0000000000', + withFeesAndSlippage: '2.0000000000', + difference: '1.0000000000', + priceImpact: '1.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -671,14 +671,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -779,14 +779,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '-100', - priceImpact: '-100', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '-100.0000000000', + priceImpact: '-100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -887,14 +887,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: false, prices: { - base: '1', - market: '1', - actualPrice: '0.01', - withSlippage: '0.01', - withFees: '0.01', - withFeesAndSlippage: '0.01', - difference: '-99', - priceImpact: '-99', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '0.0100000000', + withSlippage: '0.0100000000', + withFees: '0.0100000000', + withFeesAndSlippage: '0.0100000000', + difference: '-99.0000000000', + priceImpact: '-99.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -995,14 +995,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '0', - market: '0', - actualPrice: '100', - withSlippage: '100', - withFees: '100', - withFeesAndSlippage: '100', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '100.0000000000', + withSlippage: '100.0000000000', + withFees: '100.0000000000', + withFeesAndSlippage: '100.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1103,14 +1103,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1208,14 +1208,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1316,14 +1316,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0.01', - withSlippage: '0.01', - withFees: '0.01', - withFeesAndSlippage: '0.01', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0100000000', + withSlippage: '0.0100000000', + withFees: '0.0100000000', + withFeesAndSlippage: '0.0100000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1424,14 +1424,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '0', - market: '0', - actualPrice: '100', - withSlippage: '100', - withFees: '100', - withFeesAndSlippage: '100', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '100.0000000000', + withSlippage: '100.0000000000', + withFees: '100.0000000000', + withFeesAndSlippage: '100.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1532,14 +1532,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1637,14 +1637,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1745,14 +1745,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: false, prices: { - base: '0', - market: '0', - actualPrice: '0.01', - withSlippage: '0.01', - withFees: '0.01', - withFeesAndSlippage: '0.01', - difference: '0', - priceImpact: '0', + base: '0.0000000000', + market: '0.0000000000', + actualPrice: '0.0100000000', + withSlippage: '0.0100000000', + withFees: '0.0100000000', + withFeesAndSlippage: '0.0100000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1853,14 +1853,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '2', - market: '1', - actualPrice: '2', - withSlippage: '2', - withFees: '2', - withFeesAndSlippage: '2', - difference: '0', - priceImpact: '100', + base: '2.0000000000', + market: '1.0000000000', + actualPrice: '2.0000000000', + withSlippage: '2.0000000000', + withFees: '2.0000000000', + withFeesAndSlippage: '2.0000000000', + difference: '0.0000000000', + priceImpact: '100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -1961,14 +1961,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '2', - market: '1', - actualPrice: '2', - withSlippage: '2', - withFees: '2', - withFeesAndSlippage: '2', - difference: '0', - priceImpact: '100', + base: '2.0000000000', + market: '1.0000000000', + actualPrice: '2.0000000000', + withSlippage: '2.0000000000', + withFees: '2.0000000000', + withFeesAndSlippage: '2.0000000000', + difference: '0.0000000000', + priceImpact: '100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2069,14 +2069,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '2', - market: '1', - actualPrice: '2', - withSlippage: '2', - withFees: '2', - withFeesAndSlippage: '2', - difference: '0', - priceImpact: '100', + base: '2.0000000000', + market: '1.0000000000', + actualPrice: '2.0000000000', + withSlippage: '2.0000000000', + withFees: '2.0000000000', + withFeesAndSlippage: '2.0000000000', + difference: '0.0000000000', + priceImpact: '100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2177,14 +2177,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '2', - market: '1', - actualPrice: '2', - withSlippage: '2', - withFees: '2', - withFeesAndSlippage: '2', - difference: '0', - priceImpact: '100', + base: '2.0000000000', + market: '1.0000000000', + actualPrice: '2.0000000000', + withSlippage: '2.0000000000', + withFees: '2.0000000000', + withFeesAndSlippage: '2.0000000000', + difference: '0.0000000000', + priceImpact: '100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2285,14 +2285,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '1', - withSlippage: '1', - withFees: '1', - withFeesAndSlippage: '1', - difference: '0', - priceImpact: '0', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '1.0000000000', + withSlippage: '1.0000000000', + withFees: '1.0000000000', + withFeesAndSlippage: '1.0000000000', + difference: '0.0000000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2404,14 +2404,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '1', - withSlippage: '1', - withFees: '1.0105', - withFeesAndSlippage: '1.0105', - difference: '1.05', - priceImpact: '0', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '1.0000000000', + withSlippage: '1.0000000000', + withFees: '1.0105000000', + withFeesAndSlippage: '1.0105000000', + difference: '1.0500000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2523,14 +2523,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '1', - withSlippage: '1', - withFees: '1.01025', - withFeesAndSlippage: '1.01025', - difference: '1.025', - priceImpact: '0', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '1.0000000000', + withSlippage: '1.0000000000', + withFees: '1.0102500000', + withFeesAndSlippage: '1.0102500000', + difference: '1.0250000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2642,14 +2642,14 @@ describe('makeOrderCalculations', () => { }, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '1', - withSlippage: '1', - withFees: '1.0102', - withFeesAndSlippage: '1.0102', - difference: '1.02', - priceImpact: '0', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '1.0000000000', + withSlippage: '1.0000000000', + withFees: '1.0102000000', + withFeesAndSlippage: '1.0102000000', + difference: '1.0200000000', + priceImpact: '0.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2753,14 +2753,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '-100', - priceImpact: '-100', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '-100.0000000000', + priceImpact: '-100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2864,14 +2864,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '-100', - priceImpact: '-100', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '-100.0000000000', + priceImpact: '-100.0000000000', }, pool: pools[0], } as SwapOrderCalculation) @@ -2973,14 +2973,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '0.5', - market: '0.5', - actualPrice: '0', - withSlippage: '0', - withFees: '0', - withFeesAndSlippage: '0', - difference: '-100', - priceImpact: '-100', + base: '0.5000000000', + market: '0.5000000000', + actualPrice: '0.0000000000', + withSlippage: '0.0000000000', + withFees: '0.0000000000', + withFeesAndSlippage: '0.0000000000', + difference: '-100.0000000000', + priceImpact: '-100.0000000000', }, pool: pool, } @@ -3083,14 +3083,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '0.5', - market: '0.5', - actualPrice: '5025.12562814070351758794', - withSlippage: '5025.12562814070351758794', - withFees: '5025.12562814070351758794', - withFeesAndSlippage: '5025.12562814070351758794', - difference: '1004925.125628140703517588', - priceImpact: '1004925.125628140703517588', + base: '0.5000000000', + market: '0.5000000000', + actualPrice: '5025.1256281407', + withSlippage: '5025.1256281407', + withFees: '5025.1256281407', + withFeesAndSlippage: '5025.1256281407', + difference: '1004925.1256281407', + priceImpact: '1004925.1256281407', }, pool: pool, } @@ -3193,14 +3193,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '1.25', - withSlippage: '1.25', - withFees: '1.25', - withFeesAndSlippage: '1.25', - difference: '25', - priceImpact: '25', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '1.2500000000', + withSlippage: '1.2500000000', + withFees: '1.2500000000', + withFeesAndSlippage: '1.2500000000', + difference: '25.0000000000', + priceImpact: '25.0000000000', }, pool: pool, } @@ -3303,14 +3303,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '2.5', - withSlippage: '2.5', - withFees: '2.5', - withFeesAndSlippage: '2.5', - difference: '150', - priceImpact: '150', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '2.5000000000', + withSlippage: '2.5000000000', + withFees: '2.5000000000', + withFeesAndSlippage: '2.5000000000', + difference: '150.0000000000', + priceImpact: '150.0000000000', }, pool: pool, } @@ -3413,14 +3413,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '1.255', - withSlippage: '1.255', - withFees: '1.255', - withFeesAndSlippage: '1.255', - difference: '25.5', - priceImpact: '25.5', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '1.2550000000', + withSlippage: '1.2550000000', + withFees: '1.2550000000', + withFeesAndSlippage: '1.2550000000', + difference: '25.5000000000', + priceImpact: '25.5000000000', }, pool: pool, } @@ -3523,14 +3523,14 @@ describe('makeOrderCalculations', () => { ptTotalValueSpent: undefined, hasSupply: true, prices: { - base: '1', - market: '1', - actualPrice: '2.51', - withSlippage: '2.51', - withFees: '2.51', - withFeesAndSlippage: '2.51', - difference: '151', - priceImpact: '151', + base: '1.0000000000', + market: '1.0000000000', + actualPrice: '2.5100000000', + withSlippage: '2.5100000000', + withFees: '2.5100000000', + withFeesAndSlippage: '2.5100000000', + difference: '151.0000000000', + priceImpact: '151.0000000000', }, pool: pool, } diff --git a/packages/swap/src/helpers/orders/factories/makeOrderCalculations.ts b/packages/swap/src/helpers/orders/factories/makeOrderCalculations.ts index 0cd90529c9..a413057d1f 100644 --- a/packages/swap/src/helpers/orders/factories/makeOrderCalculations.ts +++ b/packages/swap/src/helpers/orders/factories/makeOrderCalculations.ts @@ -19,6 +19,7 @@ export const makeOrderCalculations = ({ side, frontendFeeTiers, tokens, + priceDecimals = 10, }: Readonly<{ orderType: Swap.OrderType amounts: { @@ -32,6 +33,7 @@ export const makeOrderCalculations = ({ side?: 'buy' | 'sell' frontendFeeTiers: ReadonlyArray tokens: SwapState['orderData']['tokens'] + priceDecimals?: number }>): Array => { if (!amounts.sell || !amounts.buy || !tokens.ptInfo) return [] @@ -109,7 +111,7 @@ export const makeOrderCalculations = ({ sellQuantity .multipliedBy(ptPriceSell) .integerValue(BigNumber.ROUND_DOWN) - .toString(), + .toFixed(0), ) // ffee is based on PT value range + LP holding range @@ -222,14 +224,23 @@ export const makeOrderCalculations = ({ hasSupply, ptTotalValueSpent, prices: { - base: priceBase.toString(), - market: marketPrice.toString(), - actualPrice: actualPriceQuantity.toString(), - withSlippage: priceWithSlippage.toString(), - withFees: withFees.toString(), - withFeesAndSlippage: withFeesAndSlippage.toString(), - difference: difference.toString(), - priceImpact: priceImpact.toString(), + base: priceBase.toFixed(priceDecimals, BigNumber.ROUND_DOWN), + market: marketPrice.toFixed(priceDecimals, BigNumber.ROUND_DOWN), + actualPrice: actualPriceQuantity.toFixed( + priceDecimals, + BigNumber.ROUND_DOWN, + ), + withSlippage: priceWithSlippage.toFixed( + priceDecimals, + BigNumber.ROUND_DOWN, + ), + withFees: withFees.toFixed(priceDecimals, BigNumber.ROUND_DOWN), + withFeesAndSlippage: withFeesAndSlippage.toFixed( + priceDecimals, + BigNumber.ROUND_DOWN, + ), + difference: difference.toFixed(priceDecimals, BigNumber.ROUND_DOWN), + priceImpact: priceImpact.toFixed(priceDecimals, BigNumber.ROUND_DOWN), }, pool, } as const diff --git a/packages/swap/src/translators/reactjs/state/state.test.ts b/packages/swap/src/translators/reactjs/state/state.test.ts index 1b9d7257cb..e08085db9d 100644 --- a/packages/swap/src/translators/reactjs/state/state.test.ts +++ b/packages/swap/src/translators/reactjs/state/state.test.ts @@ -130,7 +130,7 @@ describe('State Actions', () => { const state = combinedSwapReducers(stateAfterPools, actionLimit) expect(state.orderData.type).toBe('limit') - expect(state.orderData.limitPrice).toBe('0.5') + expect(state.orderData.limitPrice).toBe('0.5000000000') expect(state.orderData.amounts.buy?.quantity).toBe(200n) const actionMarket: SwapCreateOrderAction = { @@ -201,7 +201,7 @@ describe('State Actions', () => { }) // change back to market price - expect(state.orderData.limitPrice).toBe('2') + expect(state.orderData.limitPrice).toBe('2.0000000000') expect(state.orderData.selectedPoolId).toBe('1') }) }) @@ -308,7 +308,7 @@ describe('State Actions', () => { }) // change back to market price - expect(state.orderData.limitPrice).toBe('2') + expect(state.orderData.limitPrice).toBe('2.0000000000') }) }) @@ -585,7 +585,7 @@ describe('State Actions', () => { pools: mocks.mockedPools6, }) - expect(state.orderData.limitPrice).toBe('0.5') + expect(state.orderData.limitPrice).toBe('0.5000000000') expect(state.orderData.selectedPoolId).toBeUndefined() }) })