diff --git a/package.json b/package.json index 06e9701a..21b5041b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@balancer-labs/sor", - "version": "4.1.1-beta.2", + "version": "4.1.1-beta.3", "license": "GPL-3.0-only", "main": "dist/index.js", "module": "dist/index.esm.js", diff --git a/src/router/helpersClass.ts b/src/router/helpersClass.ts index 81bc22d7..f0fdf507 100644 --- a/src/router/helpersClass.ts +++ b/src/router/helpersClass.ts @@ -58,7 +58,6 @@ export function getEffectivePriceSwapForPath( ); if (swapType === SwapTypes.SwapExactIn) { outputAmountSwap = outputAmountSwap.minus(gasCost); - if (outputAmountSwap.lte(ZERO)) return INFINITY; return amount.div(outputAmountSwap); // amountIn/AmountOut } else { amount = amount.plus(gasCost); diff --git a/test/lib/subgraphPoolDataService.ts b/test/lib/subgraphPoolDataService.ts index ecf3870d..74f2bc94 100644 --- a/test/lib/subgraphPoolDataService.ts +++ b/test/lib/subgraphPoolDataService.ts @@ -16,7 +16,7 @@ const queryWithLinear = ` poolType swapFee totalShares - tokens { + tokens (orderBy: index) { address balance decimals @@ -65,7 +65,7 @@ const queryWithLinear = ` poolType swapFee totalShares - tokens { + tokens (orderBy: index) { address balance decimals diff --git a/test/testScripts/swapExample.ts b/test/testScripts/swapExample.ts index e848480b..586cb782 100644 --- a/test/testScripts/swapExample.ts +++ b/test/testScripts/swapExample.ts @@ -58,17 +58,17 @@ function setUp(networkId: Network, provider: JsonRpcProvider): SOR { } export async function swap(): Promise { - const networkId = Network.MAINNET; + const networkId = Network.ARBITRUM; const provider = new JsonRpcProvider(PROVIDER_URLS[networkId]); // gasPrice is used by SOR as a factor to determine how many pools to swap against. // i.e. higher cost means more costly to trade against lots of different pools. const gasPrice = BigNumber.from('14000000000'); // This determines the max no of pools the SOR will use to swap. const maxPools = 4; - const tokenIn = ADDRESSES[networkId].sAPE; + const tokenIn = ADDRESSES[networkId].USDC; const tokenOut = ADDRESSES[networkId].WETH; const swapType: SwapTypes = SwapTypes.SwapExactIn; - const swapAmount = parseFixed('2000', 18); + const swapAmount = parseFixed('5', 6); const sor = setUp(networkId, provider);