Skip to content

Standardized subgraphs for blockchain data

License

Notifications You must be signed in to change notification settings

danieloadebimpe/subgraphs

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Subgraphs

This repo contains subgraphs defined using a set of standardized schemas. These subgraphs are used to extract raw blockchain data and transform them into meaningful metrics, for products and analytics. Our goal is to build a subgraph for every DeFi protocol in the space.

Contribution Guidelines

  • Decide which protocol you want to build a subgraph for.
  • Fork this repository.
  • Add a folder under subgraphs with the name of the protocol you want to work on.
  • Copy over the corresponding schema from the root folder. For example, if you are working on a yield aggregator, you should copy over schema-yield.graphql to your folder and rename it to schema.graphql. Note schema-common.graphql is used for schema design and reference, and should never be used for implementation.
  • Build the subgraph within that folder. Feel free to use the reference subgraph as a reference.
  • Submit a PR (pull request) to this repo after you are done. Make sure you submit your PR as a draft if it's a work-in-progress. Include a link to your deployment in your PR description.

Recommended Development Workflow

  • Start with understanding the protocol. An easy start could be interacting with the protocol UI on testnets, check transaction details on Etherscan and pay attention to key events that are emitted.
  • Go over the smart contracts. Identify the ones that we need to pull data from.
    • Usually each protocol has a factory contract that's responsible for tracking other contracts (e.g. Uniswap's Factory contract, Aave's Lending Pool Registry, Yearn's Registry).
    • Also a pool/vault contract that's responsible for pool level bookkeeping and transactions (e.g. Uniswap's Pair contract, Yearn's Vault contract, Aave's Lending Pool contract).
  • Go over the schema and think about what data are needed from smart contract events/calls to map to the fields in each entity.
    • It's easiest to start with more granular entities and build up to aggregated data.
    • For example, usually it's easier to start writing mappings for transactions and usage metrics.
  • Go over the documents in the docs folder. That should answer lots of questions you may have.
  • Implement the mappings, deploy and test your data using either Hosted Service or The Graph Studio.
  • For metrics calculation (e.g. revenue, fees, TVL), please refer to the README.md in the protocol's subgraph folder for methodology. There is also a broader explanation of how different fields are defined in the schema in docs/Schema.md. Feel free to reach out to me if anything isn't clear.
  • We've built a handy debugging/validation dashboard for you to quickly visualize the data in your subgraph. It's deployed to subgraphs.xyz and the source code is under dashboard if you want to spin it up locally.
  • Verify your subgraph against other sources and include specific links to these sources in the README. Below are some common sources:

Resources

Introductory

Intermediate

Advanced

Development Status

πŸ”¨ = In progress.
πŸ›  = Feature complete. Additional testing required.
βœ… = Production-ready.

Protocol Status Versions † Deployments
DEX AMM
Apeswap πŸ›  1.3.0 / 1.1.2 / 1.0.0 Apeswap BSC Apeswap Polygon
Balancer v2 πŸ›  1.3.0 / 1.1.2 / 1.0.0 Balancer V2 Ethereum Balancer V2 Arbitrum Balancer V2 Polygon
Bancor v3 πŸ›  1.3.0 / 1.0.0 / 1.0.0 Bancor V3 Ethereum
Beethoven X πŸ›  1.3.0 / 1.1.2 / 1.0.0 Beethoven X Fantom Beethoven X Optimism
Curve πŸ›  1.2.1 / 1.0.0 / 1.0.0 Curve Finance Gnosis Curve Finance Polygon Curve Finance Arbitrum Curve Finance Optimism Curve Finance Fantom Curve Finance Avalanche Curve Finance Ethereum
DODO v2 πŸ”¨
Ellipsis Finance πŸ›  1.2.1 / 1.0.0 / 1.0.0 Ellipsis Finance BSC
Quickswap πŸ›  1.3.0 / 1.0.0 / 1.0.0 Quickswap Polygon
Honeyswap πŸ”¨ 1.3.0 / 1.0.0 / 1.0.0 Honeyswap Gnosis
Platypus Finance πŸ›  1.3.0 / 1.3.0 / 1.0.0 Platypus Avalanche
Saddle Finance πŸ›  1.3.0 / 1.1.0 / 1.0.0 Saddle Finance Ethereum Saddle Finance Arbitrum Saddle Finance Fantom Saddle Finance Optimism
Solarbeam πŸ›  1.3.0 / 1.0.0 / 1.0.0 Solarbeam Moonriver
SpiritSwap πŸ›  1.3.0 / 1.0.0 / 1.0.0 SpiritSwap Fantom
SpookySwap πŸ›  1.3.0 / 1.1.1 / 1.0.0 SpookySwap Fantom
Ubeswap πŸ›  1.3.0 / 1.1.1 / 1.0.0 Ubeswap Celo
VVS Finance πŸ›  1.3.0 / 1.1.2 / 1.0.0 VVS Finance Cronos
SushiSwap πŸ›  1.3.0 / 1.1.1 / 1.0.0 SushiSwap Ethereum SushiSwap Celo SushiSwap Fuse SushiSwap Moonriver SushiSwap Moonbeam SushiSwap Avalanche SushiSwap BSC SushiSwap Arbitrum SushiSwap Fantom SushiSwap Polygon SushiSwap Gnosis
Trader Joe πŸ›  1.3.0 / 1.0.0 / 1.0.0 Trader Joe Avalanche
Uniswap v2 πŸ›  1.3.0 / 1.1.1 / 1.0.0 Uniswap V2
Uniswap v3 πŸ›  1.3.0 / 1.1.1 / 1.0.0 Uniswap V3 Uniswap V3 Polygon Uniswap V3 Optimism Uniswap V3 Arbtitrum
Lending Protocols
Aave v2 πŸ›  1.3.0 / 1.2.3 / 1.0.0 Aave V2 Ethereum Aave V2 Ethereum ARC Aave V2 Ethereum RWA Aave V2 Ethereum AMM Aave V2 Avalanche Aave V2 Polygon
Aave v3 πŸ”¨ 1.3.0 / 1.0.0 / 1.0.0 Aave V3 Optimism Aave V3 Polygon Aave V3 Harmony Aave V3 Fantom Aave V3 Avalanche Aave V3 Arbitrum
Aurigami πŸ›  1.3.0 / 1.0.6 / 1.0.0 Aurigami Aurora
Bastion Protocol πŸ›  1.3.0 / 1.0.9 / 1.0.0 Bastion Protocol Aurora
Banker Joe πŸ›  1.3.0 / 1.0.5 / 1.0.0 Banker Joe Avalanche
BENQI πŸ›  1.3.0 / 1.0.6 / 1.0.0 BENQI Avalanche
Compound βœ… 1.3.0 / 1.6.7 / 1.0.0 Compund Ethereum
CREAM Finance πŸ›  1.3.0 / 1.0.6 / 1.0.0 CREAM Finance Arbitrum CREAM Finance Polygon CREAM Finance BSC CREAM Finance Ethereum
dForce πŸ›  1.3.0 / 1.0.2 / 1.0.0 dforce Arbitrum dforce Avalanche dforce BSC dforce Ethereum dforce Optimism dforce Polygon
Euler Finance πŸ”¨
Geist πŸ›  1.3.0 / 1.0.1 / 1.0.0 Geist Protocl
Iron Bank πŸ›  1.3.0 / 1.0.8 / 1.0.0 Iron Bank Fantom Iron Bank Avalanche Iron Bank Ethereum
Maple Finance πŸ›  1.2.1 / 1.1.0 / 1.0.0 Maple Finance Ethereum
Moonwell Finance πŸ›  1.3.0 / 1.0.10 / 1.0.0 Moonwell Moonriver Moonwell Moonbeam
Notional Finance πŸ”¨
Rari Fuse πŸ”¨ 1.3.0 / 1.0.18 / 1.0.0 Rari Fuse Ethereum Rari Fuse Arbitrum
SCREAM πŸ›  1.3.0 / 1.0.6 / 1.0.0 SCREAM Fantom
Tectonic πŸ›  1.3.0 / 1.0.0 / 1.0.0 Tectonic Cronos
Venus Protocol πŸ›  1.3.0 / 1.0.6 / 1.0.0 Venus Protocol BSC
Yeti Finance πŸ”¨
CDPs
Abracadabra πŸ›  1.3.0 / 1.0.5 / 1.0.0 Abracadabra Money Abracadabra Money Abracadabra Money Abracadabra Money Abracadabra Money
Alchemix
Inverse Finance πŸ›  1.3.0 / 1.2.2 / 1.0.0 Inverse Finance Ethereum
Liquity πŸ›  1.3.0 / 1.1.4 / 1.0.1 Liquity Ethereum
MakerDAO πŸ›  1.3.0 / 1.1.0 / 1.0.0 MakerDAO Ethereum
QiDAO βœ… 1.3.0 / 1.1.0 / 1.0.0 QiDAO Arbitrum QiDAO Avalanche QiDAO BSC QiDAO Fantom QiDAO Polygon QiDAO Moonriver QiDAO Optimism QiDAO Gnosis
Yield Aggregators
Arrakis Finance πŸ›  1.3.0 / 1.0.0 / 1.0.0 Arrakis Ethereum
BadgerDAO πŸ›  1.3.0 / 1.0.0 / 1.0.0 BadgerDAO Ethereum
Beefy Finance πŸ› 
Belt Finance πŸ›  1.2.1 / 1.0.0 / 1.0.0 Belt BSC
Convex Finance πŸ›  1.3.0 / 1.1.1 / 1.0.0 Convex Finance Ethereum
Gamma Strategy πŸ›  1.2.1 / 1.0.0 / 1.0.0 Gamma Ethereum Gamma Polygon
Harvest Finance πŸ”¨
Liquid Driver πŸ”¨
Rari Vaults πŸ›  1.3.0 / 1.4.0 / 1.0.0 Rari Vaults Ethereum
Stake DAO πŸ›  1.3.0 / 1.3.0 / 1.0.0 Stake DAO
Tokemak πŸ›  1.2.1 / 1.0.0 / 1.0.0 Tokemak
Vesper Finance. πŸ›  1.3.0 / 1.0.0 / 1.0.0 Vesper Finance Ethereum
Yield Yak πŸ”¨
Yearn v2 πŸ›  1.3.0 / 1.2.0 / 1.0.0 Yearn V2 Ethereum Yearn V2 Arbitrum Yearn V2 Fantom
Governance
ENS Governor πŸ›  1.0.0 / 1.0.0 / 1.0.0 ENS Governor
FEI Governor πŸ”¨
Silo Finance Governor πŸ”¨
Hop Protocol Governor πŸ”¨
Network Subgraph
EVM πŸ”¨
Cosmos πŸ”¨
NEAR πŸ”¨
Arweave πŸ”¨
ERC20 Subgraph
ERC20 πŸ”¨ 1.0.0 / 1.0.0 / 1.0.0 ERC20 Ethereum
ERC721 Subgraph
TBD πŸ”¨

† Versions are schema version, subgraph version, methodology version respectively

About

Standardized subgraphs for blockchain data

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • TypeScript 50.7%
  • JavaScript 46.6%
  • Jupyter Notebook 1.8%
  • Python 0.8%
  • Mustache 0.1%
  • HTML 0.0%