Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 1.1.5 #538

Merged
merged 44 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
0b27b23
fix: acknowledge query.args.first
gmbronco Aug 25, 2023
81a7f8b
fix: remove pool in recovery from specs
gmbronco Aug 25, 2023
0998349
new: onchain data via multicall3 with batching
gmbronco Aug 25, 2023
8554edb
skipping recovery specs due to fixed block number
gmbronco Aug 25, 2023
36fcf1a
Update balancer-js/src/modules/data/pool/subgraph.ts
gmbronco Aug 25, 2023
abc7997
Update balancer-js/examples/data/onchain-multicall3.ts
gmbronco Aug 25, 2023
c2066ec
onchain data via multicall3 fixes
gmbronco Aug 29, 2023
7c5e23c
Temp add GyroE mainnet pool to SOR ignore list.
johngrantuk Aug 30, 2023
97d497e
Merge pull request #530 from balancer/hotfix-add-ignored-pool
johngrantuk Aug 30, 2023
293187b
chore: version bump v1.1.5-beta.0
johngrantuk Aug 30, 2023
af598c8
onchain data via multicall3 fixes
gmbronco Aug 30, 2023
ae2b87e
Make SOR filter all ignored pools.
johngrantuk Aug 30, 2023
c4c8c1c
Temp fix polygon test block number.
johngrantuk Aug 30, 2023
ee41143
Fix broken test.
johngrantuk Aug 30, 2023
fb21560
Broken tests updated.
johngrantuk Aug 30, 2023
a4c3e86
Fix lint.
johngrantuk Aug 30, 2023
3711301
Revert example changes.
johngrantuk Aug 30, 2023
213d84d
Merge pull request #532 from balancer/sor-filter-all-ignored
johngrantuk Aug 30, 2023
a56a2fa
chore: version bump v1.1.5-beta.1
johngrantuk Aug 30, 2023
f85e4b4
Merge develop.
johngrantuk Aug 30, 2023
2ad1a80
add Gnosis 3POOL_BPT/wstETH pool to mid pool ids.
johngrantuk Aug 31, 2023
70c02fb
Merge pull request #533 from balancer/gnosis-midpool-config
johngrantuk Aug 31, 2023
2f9f976
chore: version bump v1.1.5-beta.2
johngrantuk Aug 31, 2023
725988b
fix: skipping specs with disabled pools
gmbronco Aug 31, 2023
71aed4a
fix: should fetch data for all linear pools
gmbronco Aug 31, 2023
b1d7480
fix: should return pool's default data
gmbronco Aug 31, 2023
54a5228
fix: bringing back commented out tests
gmbronco Aug 31, 2023
88ca870
Merge pull request #526 from balancer/onchaindata-multicall3
gmbronco Sep 1, 2023
f4879f0
chore: version bump v1.1.5-beta.3
johngrantuk Sep 1, 2023
2b576ee
Adding missing parameters to sdk.pools.buildExitExactBPTIn method;
Sep 11, 2023
2dcbfb7
Fixing tests for composable stable pools;
Sep 11, 2023
36c5174
Merge branch 'fix-tests' into build-exit-missing-parameters
Sep 11, 2023
812b02e
Merge pull request #534 from balancer/build-exit-missing-parameters
lgahdl Sep 12, 2023
81bb159
chore: version bump v1.1.5-beta.4
johngrantuk Sep 12, 2023
d10c76c
adding avalanche gauge factory
gmbronco Sep 21, 2023
4f9be8b
Merge pull request #535 from balancer/avalanch-gauge-factory
johngrantuk Sep 21, 2023
8f1a0bd
chore: version bump v1.1.5-beta.5
johngrantuk Sep 21, 2023
fffdbf2
fix: filter out old gauges
gmbronco Sep 21, 2023
fc9e72c
Merge pull request #536 from balancer/gauges-filter
johngrantuk Sep 21, 2023
010bb3f
chore: version bump v1.1.5-beta.6
johngrantuk Sep 21, 2023
458d214
chore: Remove gyroE V2 from ignore list now that SG is fixed.
johngrantuk Sep 25, 2023
27b092e
Merge pull request #537 from balancer/remove-gyroEV2-from-ignore
johngrantuk Sep 25, 2023
94d75ed
chore: version bump v1.1.5-beta.7
johngrantuk Sep 25, 2023
3059111
chore: Bump version for release: 1.1.5.
johngrantuk Sep 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions balancer-js/examples/data/onchain-multicall3.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
import {
PoolsSubgraphRepository,
SubgraphPoolBase,
Network,
BALANCER_NETWORK_CONFIG,
getOnChainBalances as getOnChainBalances3,
} from '@balancer-labs/sdk';
import { JsonRpcProvider } from '@ethersproject/providers';
// import _ from 'lodash';

// Importing legacy multicall fetcher for comparison
// import { getOnChainBalances } from '@/modules/sor/pool-data/onChainData';

const network = Network.POLYGON;

const pools = new PoolsSubgraphRepository({
url: BALANCER_NETWORK_CONFIG[network].urls.subgraph,
chainId: network,
query: {
args: {
first: 10,
skip: 0,
orderBy: 'totalLiquidity',
orderDirection: 'desc',
where: {
poolType: {
eq: 'GyroE',
},
},
},
attrs: {},
},
});

const providers: Record<number, JsonRpcProvider> = {
[Network.MAINNET]: new JsonRpcProvider('https://rpc.ankr.com/eth'),
[Network.POLYGON]: new JsonRpcProvider('https://rpc.ankr.com/polygon'),
[Network.ARBITRUM]: new JsonRpcProvider('https://rpc.ankr.com/arbitrum'),
[Network.OPTIMISM]: new JsonRpcProvider('https://rpc.ankr.com/optimism'),
[Network.BASE]: new JsonRpcProvider('https://rpc.ankr.com/base'),
[Network.FANTOM]: new JsonRpcProvider('https://rpc.ankr.com/fantom'),
[Network.ZKEVM]: new JsonRpcProvider('https://rpc.ankr.com/polygon_zkevm'),
};

const provider = providers[network];

/**
* Recursively finds differences between two objects. Use to compare onchain data from 2 different fetchers.
*/
// function diffObjects(
// object1: any,
// object2: any,
// path = ''
// ): any {
// const allKeys = _.union(Object.keys(object1), Object.keys(object2));

// const differences = [];

// for (const key of allKeys) {
// const newPath = path ? `${path}.${key}` : key;

// if (_.isObject(object1[key]) && _.isObject(object2[key])) {
// differences.push(...diffObjects(object1[key], object2[key], newPath));
// } else if (!_.isEqual(object1[key], object2[key])) {
// differences.push({
// path: newPath,
// value1: object1[key],
// value2: object2[key],
// });
// }
// }

// return differences;
// }

async function main() {
const subgraph = (await pools.fetch()) as SubgraphPoolBase[];
const onchain3 = await getOnChainBalances3(
subgraph,
'',
'0xBA12222222228d8Ba445958a75a0704d566BF2C8',
provider
);
console.log(onchain3.length);
console.log(JSON.stringify(onchain3, null, 2));
// const onchain = await getOnChainBalances(subgraph, '0xeefba1e63905ef1d7acba5a8513c70307c1ce441', '0xBA12222222228d8Ba445958a75a0704d566BF2C8', provider);
// console.log(onchain.length)
// for(const i in subgraph) {
// const one = onchain3.find((x) => x.id === subgraph[i].id)
// const two = onchain.find((x) => x.id === subgraph[i].id)
// console.log('Pool', subgraph[i].id)
// if (!two) {
// console.log('two missing')
// continue
// }
// console.log(JSON.stringify(findNestedValueDifferences(one, two), null, 2));
// }
}

main();

// yarn example ./debug/onchain-multicall3.ts
11 changes: 6 additions & 5 deletions balancer-js/examples/swaps/advanced.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* Run command:
* yarn example ./examples/swaps/advanced.ts
*/
import { FORK_NODES } from '@/test/lib/utils';
import {
BalancerSDK,
Network,
Expand Down Expand Up @@ -119,12 +120,12 @@ async function getAndProcessSwaps(
}

async function swapExample() {
const network = Network.POLYGON;
const rpcUrl = 'https://rpc.ankr.com/polygon';
const tokenIn = '0x3A58a54C066FdC0f2D55FC9C89F0415C92eBf3C4'; // stMatic
const tokenOut = AddressZero; // Matic
const network = Network.GNOSIS;
const rpcUrl = FORK_NODES[network];
const tokenIn = '0xe91d153e0b41518a2ce8dd3d7944fa863463a97d';
const tokenOut = '0x6A023CCd1ff6F2045C3309768eAd9E68F978f6e1';
const swapType = SwapTypes.SwapExactIn;
const amount = parseFixed('20', 18);
const amount = parseFixed('20000', 18);
// Currently Relayer only suitable for ExactIn and non-eth swaps
const canUseJoinExitPaths = canUseJoinExit(swapType, tokenIn, tokenOut);

Expand Down
2 changes: 1 addition & 1 deletion balancer-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@balancer-labs/sdk",
"version": "1.1.4",
"version": "1.1.5",
"description": "JavaScript SDK for interacting with the Balancer Protocol V2",
"license": "GPL-3.0-only",
"homepage": "https://github.com/balancer-labs/balancer-sdk#readme",
Expand Down
Loading