Skip to content

Commit

Permalink
Merge pull request #498 from balancer/avalanche-gauges
Browse files Browse the repository at this point in the history
Add gauge SG and example.
  • Loading branch information
johngrantuk committed Jul 26, 2023
2 parents 8815d04 + f0493a2 commit ab0a0a1
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
29 changes: 29 additions & 0 deletions balancer-js/examples/pools/aprs/aprs.avalanche.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/**
* Display APRs
*
* Run command:
* yarn example ./examples/pools/aprs/aprs.avalanche.ts
*/
import { BalancerSDK, Network } from '@balancer-labs/sdk';

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

const { pools } = sdk;

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

console.log(pool);

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

main();
2 changes: 2 additions & 0 deletions balancer-js/src/lib/constants/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,8 @@ export const BALANCER_NETWORK_CONFIG: Record<Network, BalancerNetworkConfig> = {
urls: {
subgraph:
'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-avalanche-v2',
gaugesSubgraph:
'https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gauges-avalanche',
},
thirdParty: {
coingecko: {
Expand Down

0 comments on commit ab0a0a1

Please sign in to comment.