Skip to content

Commit

Permalink
Merge pull request #363 from balancer-labs/develop
Browse files Browse the repository at this point in the history
Release 4.1.1-beta.3
  • Loading branch information
John Grant authored Feb 17, 2023
2 parents 93ae3f7 + 031cf51 commit 721eb06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
1 change: 0 additions & 1 deletion src/router/helpersClass.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions test/lib/subgraphPoolDataService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const queryWithLinear = `
poolType
swapFee
totalShares
tokens {
tokens (orderBy: index) {
address
balance
decimals
Expand Down Expand Up @@ -65,7 +65,7 @@ const queryWithLinear = `
poolType
swapFee
totalShares
tokens {
tokens (orderBy: index) {
address
balance
decimals
Expand Down
6 changes: 3 additions & 3 deletions test/testScripts/swapExample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ function setUp(networkId: Network, provider: JsonRpcProvider): SOR {
}

export async function swap(): Promise<void> {
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);

Expand Down

0 comments on commit 721eb06

Please sign in to comment.