Skip to content

Commit

Permalink
Merge pull request #497 from balancer/optimism-config
Browse files Browse the repository at this point in the history
adding subgraph urls on optimism
  • Loading branch information
johngrantuk committed Jul 25, 2023
2 parents 8f830e9 + 0834d9a commit 084276c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
27 changes: 27 additions & 0 deletions balancer-js/examples/pools/aprs/aprs.optimism.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Display APRs
*
* Run command:
* yarn example ./examples/pools/aprs/aprs.optimism.ts
*/
import { BalancerSDK } from '@balancer-labs/sdk';

const sdk = new BalancerSDK({
network: 10,
rpcUrl: 'https://rpc.ankr.com/optimism',
});

const { pools } = sdk;

const main = async () => {
const pool = await pools.find(
'0x7ca75bdea9dede97f8b13c6641b768650cb837820002000000000000000000d5'
);

if (pool) {
const apr = await pools.apr(pool);
console.log(pool.id, apr);
}
};

main();
5 changes: 4 additions & 1 deletion balancer-js/src/lib/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,10 @@ export const BALANCER_NETWORK_CONFIG: Record<Network, BalancerNetworkConfig> = {
urls: {
subgraph:
'https://api.thegraph.com/subgraphs/name/beethovenxfi/beethovenx-optimism',
gaugesSubgraph: '',
gaugesSubgraph:
'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gauges-optimism',
blockNumberSubgraph:
'https://api.thegraph.com/subgraphs/name/lyra-finance/optimism-mainnet-blocks',
},
pools: {},
sorConnectingTokens: [
Expand Down

0 comments on commit 084276c

Please sign in to comment.