TheGraph exposes a GraphQL endpoint to query the events and entities within the Binance Smart Chain and PancakeSwap ecosystem.
Currently, there are multiple subgraphs, but additional subgraphs can be added to this repository, following the current architecture.
-
Blocks: Tracks all blocks on Binance Smart Chain.
- BSC https://thegraph.com/legacy-explorer/subgraph/pancakeswap/blocks
- zkSync https://api.studio.thegraph.com/query/45376/blocks-zksync/version/latest
- zkSync testnet https://api.studio.thegraph.com/query/45376/blocks-zksync-testnet/version/latest
- Polygon zkEVM https://api.studio.thegraph.com/query/45376/polygon-zkevm-block/version/latest
- opBNB https://opbnb-mainnet-graph.nodereal.io/subgraphs/name/pancakeswap/blocks
-
Exchange V2: Tracks all PancakeSwap V2 Exchange data with price, volume, liquidity, ...
- BSC https://nodereal.io/meganode/api-marketplace/pancakeswap-graphql
- ETH https://api.thegraph.com/subgraphs/name/pancakeswap/exhange-eth
- ARB
- ARB GRO https://api.thegraph.com/subgraphs/name/chef-jojo/exchange-v2-arb-goerli
- Polygon zkEVM https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm/version/latest
- Polygon zkEVM testnet https://api.studio.thegraph.com/query/45376/exchange-v2-polygon-zkevm-test/version/latest
- zkSync https://api.studio.thegraph.com/query/45376/exchange-v2-zksync/version/latest
- zkSync testnet https://api.studio.thegraph.com/query/45376/exchange-v2-zksync-testnet/version/latest
- Linea https://graph-query.linea.build/subgraphs/name/pancakeswap/exhange-v2
- Base https://api.studio.thegraph.com/query/45376/exchange-v2-base/version/latest
- Base testnet https://api.studio.thegraph.com/query/45376/exchange-v2-base-testnet/version/latest
- Scroll https://api.studio.thegraph.com/query/45376/exchange-v2-scroll/version/latest
- Scroll Sepolia https://api.studio.thegraph.com/query/45376/exchange-v2-scroll-sepolia/version/latest
- opBNB https://opbnb-mainnet-graph.nodereal.io/subgraphs/name/pancakeswap/exchange-v2
-
Farm Auctions: Tracks all PancakeSwap Farm Auctions with auctions and bids.
-
Lottery: Tracks all PancakeSwap Lottery with rounds, draws and tickets.
-
NFT Market (v1): Tracks all PancakeSwap NFT Market for ERC-721.
-
Pairs: Tracks all PancakeSwap Pairs and Tokens.
-
Pancake Squad: Tracks all Pancake Squad metrics with Owners, Tokens (including metadata), and Transactions.
-
Prediction (v1): Tracks all PancakeSwap Prediction (v1) with market, rounds, and bets.
-
Prediction (v2): Tracks all PancakeSwap Prediction (v2) with market, rounds, and bets.
-
Profile: Tracks all PancakeSwap Profile with teams, users, points and campaigns.
-
SmartChef: Tracks all PancakeSwap SmartChef (a.k.a. Syrup Pools) with tokens and rewards.
-
Timelock: Tracks all PancakeSwap Timelock queued, executed, and cancelled transactions.
-
Trading Competition (v1): Tracks all metrics for the Easter Battle (April 07โ14, 2021).
-
MasterChef (v2): Tracks data for MasterChefV2.
-
MasterChef (v3): Tracks data for MasterChefV3.
- BSC https://thegraph.com/hosted-service/subgraph/pancakeswap/masterchef-v3-bsc
- BSC testnet https://thegraph.com/hosted-service/subgraph/pancakeswap/masterchef-v3-chapel
- ETH https://thegraph.com/hosted-service/subgraph/pancakeswap/masterchef-v3-eth
- GOR https://thegraph.com/hosted-service/subgraph/pancakeswap/masterchef-v3-goerli
- Polygon zkEVM https://api.studio.thegraph.com/query/45376/masterchef-v3-polygon-zkevm/version/latest
- Polygon zkEVM testnet https://api.studio.thegraph.com/query/45376/masterchef-v3-zkevm-testnet/version/latest
- ARB https://api.thegraph.com/subgraphs/name/pancakeswap/masterchef-v3-arb
- zkSync https://api.studio.thegraph.com/query/45376/masterchef-v3-zksync/version/latest
- Base https://api.studio.thegraph.com/query/45376/masterchef-v3-base/version/latest
-
Exchange (v3): Tracks all PancakeSwap V3 Exchange data with price, volume, liquidity
- BSC https://thegraph.com/hosted-service/subgraph/pancakeswap/exchange-v3-bsc
- BSC testnet https://thegraph.com/hosted-service/subgraph/pancakeswap/exchange-v3-chapel
- ETH https://thegraph.com/hosted-service/subgraph/pancakeswap/exchange-v3-eth
- GOR https://thegraph.com/hosted-service/subgraph/pancakeswap/exchange-v3-goerli
- ARB
- ARB GOR https://api.thegraph.com/subgraphs/name/chef-jojo/exhange-v3-arb-goerli
- Polygon zkEVM https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm/version/latest
- Polygon zkEVM testnet https://api.studio.thegraph.com/query/45376/exchange-v3-polygon-zkevm-test/version/latest
- zkSync https://api.studio.thegraph.com/query/45376/exchange-v3-zksync/version/latest
- zkSync testnet https://api.studio.thegraph.com/query/45376/exchange-v3-zksync-testnet/version/latest
- Linea https://graph-query.linea.build/subgraphs/name/pancakeswap/exchange-v3-linea
- Base https://api.studio.thegraph.com/query/45376/exchange-v3-base/version/latest
- Base testnet https://api.studio.thegraph.com/query/45376/exchange-v3-base-testnet/version/latest
- Scroll https://api.studio.thegraph.com/query/45376/exchange-v3-scroll/version/latest
- Scroll Sepolia https://api.studio.thegraph.com/query/45376/exchange-v3-scroll-sepolia/version/latest
- opBNB https://opbnb-mainnet-graph.nodereal.io/subgraphs/name/pancakeswap/exchange-v3
- Graph CLI
- Required to generate and build local GraphQL dependencies.
yarn global add @graphprotocol/graph-cli
For any of the subgraph: blocks
as [subgraph]
-
Run the
cd subgraphs/[subgraph]
command to move to the subgraph directory. -
Run the
yarn codegen
command to prepare the TypeScript sources for the GraphQL (generated/*). -
Run the
yarn build
command to build the subgraph, and check compilation errors before deploying. -
Run
graph auth --product hosted-service '<ACCESS_TOKEN>'
-
Deploy via
yarn deploy
.
To access subgraphs related to PancakeSwap v1 ecosystem (article), use v1
branch.