Skip to content

Commit

Permalink
chore: Migrate base subgraphs (#9913)
Browse files Browse the repository at this point in the history
<!--
Before opening a pull request, please read the [contributing
guidelines](https://github.com/pancakeswap/pancake-frontend/blob/develop/CONTRIBUTING.md)
first
-->


<!-- start pr-codex -->

---

## PR-Codex overview
The focus of this PR is to migrate base subgraphs to the Graph Studio
and update subgraph URLs for the `BASE` chain.

### Detailed summary
- Migrated base subgraphs to the Graph Studio
- Updated subgraph URLs for the `BASE` chain in various files
- Utilized new API endpoints for `BASE` chain subgraphs

> ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your
question}`

<!-- end pr-codex -->
  • Loading branch information
chefjackson authored Jun 3, 2024
1 parent 3a41cb8 commit edf4640
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/flat-foxes-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@pancakeswap/chains': patch
---

Migrate base subgraphs to the graph studio
2 changes: 2 additions & 0 deletions apps/web/src/config/constants/endpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export const V2_SUBGRAPH_URLS = {
...V2_SUBGRAPHS,
[ChainId.BSC]: `${EXPLORER_API}/subgraphs/v2/bsc/graphql`,
[ChainId.POLYGON_ZKEVM]: `${THE_GRAPH_PROXY_API}/exchange-v2-polygon-zkevm`,
[ChainId.BASE]: `${THE_GRAPH_PROXY_API}/exchange-v2-base`,
}

export const BLOCKS_CLIENT_WITH_CHAIN = BLOCKS_SUBGRAPHS
Expand All @@ -61,6 +62,7 @@ export const ASSET_CDN = 'https://assets.pancakeswap.finance'
export const V3_SUBGRAPH_URLS = {
...V3_SUBGRAPHS,
[ChainId.POLYGON_ZKEVM]: `${THE_GRAPH_PROXY_API}/exchange-v3-polygon-zkevm`,
[ChainId.BASE]: `${THE_GRAPH_PROXY_API}/exchange-v3-base`,
}

export const STABLESWAP_SUBGRAPHS_URLS = {
Expand Down
4 changes: 2 additions & 2 deletions packages/chains/src/subgraphs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function getV3Subgraphs({ noderealApiKey, theGraphApiKey }: SubgraphParam
[ChainId.LINEA]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-linea/version/latest',
[ChainId.LINEA_TESTNET]:
'https://thegraph.goerli.zkevm.consensys.net/subgraphs/name/pancakeswap/exchange-v3-linea-goerli',
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest',
[ChainId.BASE]: `https://gateway-arbitrum.network.thegraph.com/api/${theGraphApiKey}/subgraphs/id/5YYKGBcRkJs6tmDfB3RpHdbK2R5KBACHQebXVgbUcYQp`,
[ChainId.BASE_TESTNET]: 'https://api.studio.thegraph.com/query/45376/exchange-v3-base-testnet/version/latest',
[ChainId.OPBNB]: `https://open-platform-ap.nodereal.io/${noderealApiKey}/opbnb-mainnet-graph-query/subgraphs/name/pancakeswap/exchange-v3`,
[ChainId.OPBNB_TESTNET]: null,
Expand All @@ -57,7 +57,7 @@ export function getV2Subgraphs({ noderealApiKey, theGraphApiKey }: SubgraphParam
[ChainId.LINEA_TESTNET]: 'https://thegraph.goerli.zkevm.consensys.net/subgraphs/name/pancakeswap/exhange-eth/',
[ChainId.ARBITRUM_ONE]: 'https://api.thegraph.com/subgraphs/name/pancakeswap/exchange-v2-arb',
[ChainId.LINEA]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-linea/version/latest',
[ChainId.BASE]: 'https://api.studio.thegraph.com/query/45376/exchange-v2-base/version/latest',
[ChainId.BASE]: `https://gateway-arbitrum.network.thegraph.com/api/${theGraphApiKey}/subgraphs/id/2NjL7L4CmQaGJSacM43ofmH6ARf6gJoBeBaJtz9eWAQ9`,
[ChainId.OPBNB]: `https://open-platform-ap.nodereal.io/${noderealApiKey}/opbnb-mainnet-graph-query/subgraphs/name/pancakeswap/exchange-v2`,
}
}
Expand Down

0 comments on commit edf4640

Please sign in to comment.