Coder Social home page Coder Social logo

aditya-todi / subgraphs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from messari/subgraphs

0.0 1.0 0.0 60.99 MB

Standardized subgraphs for blockchain data

License: MIT License

Shell 0.01% JavaScript 47.19% Python 0.82% TypeScript 49.83% CSS 0.01% Makefile 0.03% HTML 0.02% Jupyter Notebook 2.03% Dockerfile 0.01% Mustache 0.06%

subgraphs's Introduction

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.5 / 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
Ellipsis Finance ๐Ÿ›  1.2.1 / 1.0.0 / 1.0.0 Ellipsis Finance BSC
DODO v2 ๐Ÿ”จ
Honeyswap ๐Ÿ›  1.3.0 / 1.0.2 / 1.0.1 Honeyswap Gnosis
MM Finance ๐Ÿ›  1.3.0 / 1.0.1 / 1.0.0 VVS Finance Cronos
Platypus Finance โœ… 1.3.0 / 1.3.0 / 1.0.0 Platypus Avalanche
Quickswap ๐Ÿ›  1.3.0 / 1.0.2 / 1.0.0 Quickswap Polygon
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.1.3 / 1.0.0 Solarbeam Moonriver
SpiritSwap ๐Ÿ›  1.3.0 / 1.1.3 / 1.0.0 SpiritSwap Fantom
SpookySwap ๐Ÿ›  1.3.0 / 1.1.4 / 1.0.0 SpookySwap Fantom
SushiSwap ๐Ÿ›  1.3.0 / 1.1.7 / 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.1.4 / 1.0.0 Trader Joe Avalanche
Ubeswap ๐Ÿ›  1.3.0 / 1.1.5 / 1.0.0 Ubeswap Celo
Uniswap v2 ๐Ÿ›  1.3.0 / 1.1.5 / 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
Velodrome ๐Ÿ”จ
VVS Finance ๐Ÿ›  1.3.0 / 1.1.5 / 1.0.0 VVS Finance Cronos
Lending Protocols
Aave v2 ๐Ÿ›  2.0.1 / 1.2.6 / 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 โœ… 2.0.1 / 1.0.1 / 1.0.0 Aave V3 Optimism Aave V3 Polygon Aave V3 Harmony Aave V3 Fantom Aave V3 Avalanche Aave V3 Arbitrum
Aurigami ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 Aurigami Aurora
Alpaca Finance (Lend) ๐Ÿ”จ
Bastion Protocol ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 Bastion Protocol Aurora
Banker Joe ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 Banker Joe Avalanche
BENQI โœ… 2.0.1 / 1.1.0 / 1.0.0 BENQI Avalanche
Compound โœ… 2.0.1 / 1.7.0 / 1.0.0 Compund Ethereum
CREAM Finance ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 CREAM Finance Arbitrum CREAM Finance Polygon CREAM Finance BSC CREAM Finance Ethereum
dForce ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 dforce Arbitrum dforce Avalanche dforce BSC dforce Ethereum dforce Optimism dforce Polygon
Euler Finance โœ… 1.2.1 / 1.0.2 / 1.0.0 Euler Finance
Geist Finance ๐Ÿ›  2.0.1 / 1.0.3 / 1.0.0 Geist Protocol
Iron Bank ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 Iron Bank Fantom Iron Bank Avalanche Iron Bank Ethereum
Maple Finance โœ… 1.3.0 / 1.1.0 / 1.0.0 Maple Finance Ethereum
Moonwell Finance ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 Moonwell Moonriver Moonwell Moonbeam
Notional Finance ๐Ÿ”จ
Rari Fuse ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 Rari Fuse Ethereum Rari Fuse Arbitrum
SCREAM ๐Ÿ›  2.0.1 / 1.1.0 / 1.0.0 SCREAM Fantom
Tectonic ๐Ÿ›  2.0.1 / 1.1.1 / 1.0.0 Tectonic Cronos
Venus Protocol โœ… 2.0.1 / 1.1.1 / 1.0.0 Venus Protocol BSC
Yeti Finance ๐Ÿ”จ
CDPs
Abracadabra ๐Ÿ›  2.0.1 / 1.2.3 / 1.0.0 Abracadabra Money Abracadabra Money Abracadabra Money Abracadabra Money Abracadabra Money
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.2.0 / 1.0.1 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
Synthetix ๐Ÿ”จ
Yield Aggregators
Alchemix ๐Ÿ”จ
Arrakis Finance โœ… 1.3.0 / 1.0.1 / 1.0.0 Arrakis Ethereum
BadgerDAO ๐Ÿ›  1.3.0 / 1.0.0 / 1.0.0 BadgerDAO Ethereum
Beefy Finance ๐Ÿ›  1.2.1 / 1.0.2 / 1.1.0 Beefy Finance Harmony Beefy Finance Moonbeam Beefy Finance Celo Beefy Finance Aurora Beefy Finance Fuse Beefy Finance Moonriver Beefy Finance Arbitrum Beefy Finance Avalanche Beefy Finance Polygon Beefy Finance BSC Beefy Finance Fantom
Belt Finance ๐Ÿ›  1.2.1 / 1.0.0 / 1.0.0 Belt BSC
Convex Finance โœ… 1.3.0 / 1.2.0 / 1.0.0 Convex Finance Ethereum
Gamma Strategy ๐Ÿ›  1.2.1 / 1.0.0 / 1.0.0 Gamma Ethereum Gamma Polygon
Harvest Finance ๐Ÿ”จ
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
Others
Lido โœ… 1.3.0 / 1.0.0 / 1.0.0 Lido Ethereum
Rocket Pool ๐Ÿ”จ
Tornado Cash ๐Ÿ”จ
Governance
Fei Governor ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 Fei Governor
ENS Governor ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 ENS Governor
Hop Governor ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 Hop Governor
TrueFi Governor ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 TrueFi Governor
Euler Governor ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 Euler Governor
Silo Governor ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 Silo Governor
Unlock Governor ๐Ÿ”จ 1.0.0 / 1.0.0 / 1.0.0 Unlock Governor
Angle Governor ๐Ÿ”จ 1.0.0 / 1.0.0 / 1.0.0 Angle Governor
Code4rena Governor ๐Ÿ”จ 1.0.0 / 1.0.0 / 1.0.0 Code4rena Governor
Network Subgraph
EVM ๐Ÿ›  1.1.1 / 1.1.2 / 1.0.0 Network Ethereum Network Arbitrum Network Aurora Network Avalanche Network Boba Network BSC Network Celo Network Clover Network Fantom Network Fuse Network Gnosis Network Harmony Network Moonbeam Network Moonriver Network Optimism Network Polygon Network Cronos
Cosmos ๐Ÿ›  1.1.1 / 1.1.2 / 1.0.0 Network Cosmos Network Osmosis Network Juno
NEAR ๐Ÿ›  1.1.1 / 1.1.2 / 1.0.0 Network Near
Arweave ๐Ÿ›  1.1.1 / 1.1.2 / 1.0.0 Network Arweave
ERC20 Subgraphs
ERC20 ๐Ÿ”จ 1.0.0 / 1.0.0 / 1.0.0 ERC20 Ethereum
NFT Subgraphs
OpenSea (Wyvern v1)
OpenSea (Wyvern v2) ๐Ÿ”จ
OpenSea (Seaport)
LooksRare ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 LooksRare
X2Y2 ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 X2Y2

โ€  Versions are schema version, subgraph version, methodology version respectively

subgraphs's People

Contributors

this-username-is-taken avatar steegecs avatar melotik avatar danielkhoo avatar harsh9200 avatar 0xbe1 avatar michaelc1999 avatar mmnavarr avatar jihok avatar tannishmango avatar spitko avatar tnkrxyz avatar sevenshi avatar subtledrift avatar nemani avatar rickyroller avatar jaimehgb avatar amritkumarj avatar l0c4t0r avatar corerouter avatar serenityfund avatar cbrzn avatar aditya-todi avatar ap-atul avatar spennyp avatar ken-m-1 avatar patstiles avatar fortysevenlabs avatar bye43 avatar riccardogalbusera avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.