Skip to content

tuomasoksa/tokenterminal-subgraph-exercise

Repository files navigation

Welcome to the Token Terminal subgraph challenge!

About this repository

If you are reading this, you are probably already familiar with Token Terminal. We provide fundamental data on blockchains and Web3 applications.

One of the various tools that helps us achieve this is The Graph protocol. The Graph is a decentralized indexing protocol for querying data from blockchains like Ethereum. We use The Graph protocol extensively on Token Terminal to ensure we have control over the entire data pipeline (from querying smart contract data to calculating high-level aggregate business metrics).

This repository contains a number of subgraph development tasks we use to assess candidates interested in joining our growing team. These tasks range from simply deploying existing subgraphs, modifying them, of developing subgraphs from scratch based on specifications we'll provide.

Our goal is to assess how efficiently you can get up to speed with a technology stack you may be unfamiliar with, so we will guide you through setting up your local environment for subgraph development. We will also try to fill you in with some background knowledge about the concepts related to these tasks, which may be especially useful if your are new to the crypto space.

Pre-requisites

You will deploy subgraphs on The Graph’s hosted service, which you can login into using your GitHub account. To get you started quickly, here’s a summary of the steps to install The Graph CLI and initialize/deploy subgraphs (tested on Ubuntu 20.04.3 LTS).

Install npm

One possibility to do this is using the Node Version Manager:

$ sudo apt update
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash # from https://github.com/nvm-sh/nvm#install--update-script
$ source ~/.bashrc

Now we can choose a specific version to install (you can use nvm list-remote to see available versions). Let's install v17.2.0:

$ nvm install v17.2.0

# Confirm installation worked
$ node --version
v17.2.0
$ npm --version
8.1.4

Install The Graph CLI

$ npm install -g @graphprotocol/graph-cli

# Confirm installation worked
$ graph --version
0.25.1

The tasks

You'll attempt 5 tasks which involve modifying and deploying existing subgraphs and creating and deploying your own subgraphs from scratch:

  • Task 1: Introduction to subgraphs.
  • Task 2: Add total reserves to a Compound subgraph.
  • Task 3: Track ENS token transfers.
  • Task 4: Create a subgraph that tracks fees generated by the ENS protocol.
  • Task 5: Create a subgraph that tracks premiums and settlement fees from ETH call options traded on Hegic.

Each of the directories linked above provide instructions specific for each task.

General instructions

  • Fork this repository, try to solve as many tasks as you can and push the solutions (source code) into your fork.
  • Ensure you have a meaningful commit history and please adhere to the commitlint convention (to setup commitlint locally, run npx husky install from the root of this repository).
  • The tasks are roughly in increasing order of difficulty so we suggest you tackle them in the order they are presented.
  • We don't expect that solving these tasks will take more than 1 or 2 days.
  • If you get stuck or find it difficult to finish any task on your own, reach out to us at [email protected]. We're happy to hop on a call and help out!
  • We will discuss your solutions during a technical interview.

Good luck! 💪

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages