GithubHelp home page GithubHelp logo

naturaldeflections / subgraphs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from messari/subgraphs

0.0 0.0 0.0 2.28 MB

Standardized subgraphs for DeFi data

License: MIT License

TypeScript 99.55% Dockerfile 0.05% HTML 0.26% CSS 0.14%

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.
  • 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.0.1 / 1.0.0 / 1.0.0 Apeswap BSC Apeswap Polygon
Balancer v2 ๐Ÿ”จ
Bancor v2 ๐Ÿ”จ
Bancor v3
Curve ๐Ÿ”จ
DODO v2 ๐Ÿ”จ
Ellipsis Finance
Platypus Finance ๐Ÿ”จ
Saddle Finance ๐Ÿ”จ
Sushiswap ๐Ÿ”จ
Uniswap v2 ๐Ÿ›  1.0.1 / 1.0.1 / 1.0.0 Uniswap V2
Uniswap v3 ๐Ÿ›  1.0.1 / 1.0.0 / 1.0.0 Uniswap V3 Uniswap V3 Polygon Uniswap V3 Optimism Uniswap V3 Arbtitrum
Lending Protocols
Aave v2 ๐Ÿ”จ
Aave v3
Bastion Protocol ๐Ÿ”จ
Benqi ๐Ÿ”จ
Compound ๐Ÿ›  1.0.1 / 1.0.0 / 1.0.0 Compund Ethereum
CREAM ๐Ÿ”จ
Geist ๐Ÿ”จ
Hundred Finance ๐Ÿ”จ
Maple Finance ๐Ÿ”จ
Moola Market ๐Ÿ”จ
Moonwell Finance ๐Ÿ”จ
TrueFi
CDPs
Abracadabra ๐Ÿ›  1.1.0 / 0.0.6 / 1.0.0 Abracadabra Money
Alchemix
Inverse Finance ๐Ÿ”จ
Liquity ๐Ÿ›  1.1.0 / 1.0.0 / 1.0.0 Liquity Ethereum
MakerDAO ๐Ÿ”จ
QiDAO
Yield Aggregators
Autofarm
Badger DAO ๐Ÿ”จ
Beefy Finance
Belt Finance ๐Ÿ›  1.1.0 / 1.0.0 / 1.0.0 Belt BSC
Convex Finance ๐Ÿ”จ
Harvest Finance ๐Ÿ”จ
Liquid Driver ๐Ÿ”จ
Pancakebunny ๐Ÿ”จ
Rari Aggregator ๐Ÿ”จ
Reaper Farm ๐Ÿ”จ
Stake DAO ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 Stake DAO
Tokemak ๐Ÿ›  1.0.0 / 1.0.0 / 1.0.0 Tokemak
Vesper Finance ๐Ÿ”จ
Yield Yak ๐Ÿ”จ
Yearn v2 ๐Ÿ›  1.2.0 / 1.0.0 / 1.0.0 Yearn

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

subgraphs's People

Contributors

0xbe1 avatar amritkumarj avatar ap-atul avatar cbrzn avatar dineshpinto avatar harsh9200 avatar ken-m-1 avatar kg-messari avatar masterbid avatar melotik avatar michaelc1999 avatar spitko avatar steegecs avatar tannishmango avatar this-username-is-taken avatar yulesa 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.