Skip to content

Commit

Permalink
chore: fix other subgraphs
Browse files Browse the repository at this point in the history
  • Loading branch information
luizakp committed Aug 27, 2024
1 parent b8ed78d commit e51402b
Show file tree
Hide file tree
Showing 40 changed files with 15,075 additions and 5,947 deletions.
3 changes: 1 addition & 2 deletions packages/balancer-apr/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
"lint:fix": "eslint '**/*.{ts,tsx}' --fix",
"migrations:generate": "drizzle-kit generate:pg",
"migrations:push": "node -r esbuild-register src/db/migrate.ts",
"migrations:drop": "drizzle-kit drop --config=drizzle.config.ts",
"build": "node get-pool-data.js"
"migrations:drop": "drizzle-kit drop --config=drizzle.config.ts"
},
"devDependencies": {
"@bleu/tsconfig": "workspace:*",
Expand Down
81 changes: 40 additions & 41 deletions packages/gql/codegen.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { capitalize, Network } from "@bleu/utils";
import { CodegenConfig } from "@graphql-codegen/cli";
import dotenv from 'dotenv';

dotenv.config();

export enum Subgraph {
BalancerPoolsMetadata = "balancer-pools-metadata",
Expand All @@ -20,48 +23,45 @@ export enum Subgraph {
// https://linear.app/bleu-llc/issue/BAL-290/deploy-subgraph-with-token-relation-on-other-networks

export const SUBGRAPHS = {
[Subgraph.BalancerPoolsMetadata]: {
name: Subgraph.BalancerPoolsMetadata,
endpoints() {
const baseEndpoint =
"https://api.thegraph.com/subgraphs/name/bleu-studio";
// [Subgraph.BalancerPoolsMetadata]: {
// name: Subgraph.BalancerPoolsMetadata,
// endpoints() {
// const baseEndpoint =
// "https://api.thegraph.com/subgraphs/name/bleu-studio";

return {
[Network.Ethereum]: `${baseEndpoint}/balancer-pool-metadata`,
[Network.Goerli]: `${baseEndpoint}/bal-pools-metadata-goerli`,
[Network.Polygon]: `${baseEndpoint}/balancer-pools-metadata-matic`,
[Network.Arbitrum]: `${baseEndpoint}/bal-pools-metadata-arb`,
[Network.Gnosis]: `${baseEndpoint}/balancer-pools-metadata-gnosis`,
[Network.Optimism]: `${baseEndpoint}/balancer-pools-metadata-op`,
// TODO: deploy Base, Avalanche and sepolia subgraphs
[Network.PolygonZKEVM]: `${baseEndpoint}/balancer-pool-metadata`,
[Network.Base]: `${baseEndpoint}/balancer-pool-metadata`,
[Network.Sepolia]: `${baseEndpoint}/balancer-pool-metadata`,
[Network.Avalanche]: `${baseEndpoint}/balancer-pool-metadata`,
};
},
endpointFor(network: Network) {
return this.endpoints()[network];
},
},
// return {
// [Network.Ethereum]: `${baseEndpoint}/balancer-pool-metadata`,
// [Network.Goerli]: `${baseEndpoint}/bal-pools-metadata-goerli`,
// [Network.Polygon]: `${baseEndpoint}/balancer-pools-metadata-matic`,
// [Network.Arbitrum]: `${baseEndpoint}/bal-pools-metadata-arb`,
// [Network.Gnosis]: `${baseEndpoint}/balancer-pools-metadata-gnosis`,
// [Network.Optimism]: `${baseEndpoint}/balancer-pools-metadata-op`,
// // TODO: deploy Base, Avalanche and sepolia subgraphs
// [Network.PolygonZKEVM]: `${baseEndpoint}/balancer-pool-metadata`,
// [Network.Base]: `${baseEndpoint}/balancer-pool-metadata`,
// [Network.Sepolia]: `${baseEndpoint}/balancer-pool-metadata`,
// [Network.Avalanche]: `${baseEndpoint}/balancer-pool-metadata`,
// };
// },
// endpointFor(network: Network) {
// return this.endpoints()[network];
// },
// },
[Subgraph.BalancerGauges]: {
name: Subgraph.BalancerGauges,
endpoints() {
const baseEndpoint =
"https://api.thegraph.com/subgraphs/name/balancer-labs/balancer-gauges";

return {
[Network.Ethereum]: `${baseEndpoint}`,
// TODO: substitute Sepolia
[Network.Sepolia]: `${baseEndpoint}-goerli`,
[Network.Goerli]: `${baseEndpoint}-goerli`,
[Network.Polygon]: `${baseEndpoint}-polygon`,
[Network.PolygonZKEVM]: `https://api.studio.thegraph.com/query/24660/balancer-gauges-polygon-zk/version/latest`,
[Network.Arbitrum]: `${baseEndpoint}-arbitrum`,
[Network.Gnosis]: `${baseEndpoint}-gnosis-chain`,
[Network.Optimism]: `${baseEndpoint}-optimism`,
[Network.Base]: `https://api.studio.thegraph.com/query/24660/balancer-gauges-base/version/latest`,
[Network.Avalanche]: `${baseEndpoint}-avalanche`,
[Network.Ethereum]: "https://api.studio.thegraph.com/query/75376/balancer-gauges/version/latest",
[Network.Sepolia]: "https://api.studio.thegraph.com/query/24660/balancer-gauges-sepolia/version/latest",
[Network.Goerli]: "https://api.studio.thegraph.com/query/24660/balancer-gauges-sepolia/version/latest",
[Network.Polygon]: "https://api.studio.thegraph.com/query/75376/balancer-gauges-polygon/version/latest",
[Network.PolygonZKEVM]:"https://api.studio.thegraph.com/query/24660/balancer-gauges-polygon-zk/version/latest" ,
[Network.Arbitrum]: "https://api.studio.thegraph.com/query/75376/balancer-gauges-arbitrum/version/latest",
[Network.Gnosis]: "https://api.studio.thegraph.com/query/75376/balancer-gauges-gnosis-chain/version/latest",
[Network.Optimism]: "https://api.studio.thegraph.com/query/75376/balancer-gauges-optimism/version/latest",
[Network.Base]: "https://api.studio.thegraph.com/query/24660/balancer-gauges-base/version/latest",
[Network.Avalanche]: "https://api.studio.thegraph.com/query/75376/balancer-gauges-avalanche/version/latest",
};
},
endpointFor(network: Network) {
Expand All @@ -77,7 +77,7 @@ export const SUBGRAPHS = {
[Network.Sepolia]:
"https://api.studio.thegraph.com/query/24660/balancer-sepolia-v2/version/latest",
[Network.Goerli]:
"https://api.studio.thegraph.com/query/75376/balancer-v2/version/latest",
"https://api.studio.thegraph.com/query/24660/balancer-sepolia-v2/version/latest",
[Network.Polygon]:
"https://api.studio.thegraph.com/query/75376/balancer-polygon-v2/version/latest",
[Network.PolygonZKEVM]:
Expand Down Expand Up @@ -124,7 +124,7 @@ export const SUBGRAPHS = {
name: Subgraph.UniswapV2,
endpoints() {
const baseEndpoint =
"https://api.thegraph.com/subgraphs/name/ianlapham/uniswap-v2-dev";
`https://gateway.thegraph.com/api/${process.env.THE_GRAPH_API_KEY}/subgraphs/id/EYCKATKGBKLWvSfwvBjzfCBmGwYNdVkduYXVivCsLRFu`;
return {
[Network.Ethereum]: `${baseEndpoint}`,
};
Expand All @@ -141,10 +141,9 @@ export const SUBGRAPHS = {
[Subgraph.Sushi]: {
name: Subgraph.Sushi,
endpoints() {
const baseEndpoint = "https://api.thegraph.com/subgraphs/name/sushiswap";
return {
[Network.Ethereum]: `${baseEndpoint}/exchange`,
[Network.Gnosis]: `${baseEndpoint}/xdai-exchange`,
[Network.Ethereum]: `https://gateway.thegraph.com/api/${process.env.THE_GRAPH_API_KEY}/subgraphs/id/A4JrrMwrEXsYNAiYw7rWwbHhQZdj6YZg1uVy5wa6g821`,
[Network.Gnosis]: `https://gateway.thegraph.com/api/${process.env.THE_GRAPH_API_KEY}/subgraphs/id/A4JrrMwrEXsYNAiYw7rWwbHhQZdj6YZg1uVy5wa6g821`,
};
},
endpointFor(network: Network) {
Expand Down
Loading

0 comments on commit e51402b

Please sign in to comment.