Skip to content

web3index/web3index-org

Repository files navigation

The Web3 Index

The Web3 Index reports on the fees being paid into web3 network protocols in an effort to showcase real usage across the web3 stack. Stay up to date on the latest web3 trends whether you’re a supply-side participant keeping tabs on in-demand networks, a developer interested in building on top of the most promising web3 infrastructure, or simply a crypto-enthusiast passionate about the web3 movement.

Unlike most indexes in defi (a sector of web3) that weight listings based on market capitalization or "total value locked (TVL)", The Web3 Index uses a fundamental index methodology. A key belief behind the fundamental index methodology is that underlying valuation figures (i.e. network fees and usage) are more accurate estimators of a network's intrinsic value, rather than the listed market value of the protocol.

Protocol Application Instructions

Step 1: Submit an application

As the web3 ecosystem of applications continues to grow, there's been a surge in interest to be listed on this site. In order for a protocol to be considered for the index, we ask that you first submit this application.

Step 2: Complete an integration

Protocol fee data must be surfaced in a format that's consumable by The Web3 Index site. This data can be provided using one of several different methods.

Method #1: The Graph (recommended)

If the protocol you'd like to add to the index is built on Ethereum or any other blockchain supported by The Graph, we recommend adding it to The Web3 Index subgraph. You can find the subgraph here and instructions on how to add a protocol's fee data to it here.

Once you've successfully added your protocol to the subgraph, make sure to add the protocol to the Web3 Index registry using its subgraph protocol entity id as the key and set its subgraph field to true.

Method #2: The Web3 Index Database

If a protocol's blockchain is not supported by The Graph, you can index its fee data using the Web Index's own database.

Step 1: Create a command line script inside cmd/[your_protocol_name].ts. This endpoint will get called every hour by a Github action (create your Github action in .github/workflows/[your_protocol_name].yml). When executed, it should store the protocol's paid fees using the Prisma ORM according to the database schema.

Step 2: Add your protocol to The Web3 Index registry using the protocol and directory name you created. Make sure to set the set its subgraph field to false.

Method #3: A Publically Accessible API Endpoint

If a protocol's blockchain is not supported by The Graph and you can't use the Web3 Index's own database for some reason, you can provide fee data via your own publically accessible API endpoint. Its json response should return data in the following format, updated at least twice a day:

{
  // Revenue should be denominated in USD at time of payout
  "revenue": {
    "now": 61779.07, // total revenue as of now
    "oneDayAgo": 60579.17, // total revenue as of 1 day ago
    "twoDaysAgo": 60390.5, // total revenue as of two days ago
    "oneWeekAgo": 58620.2, // total revenue as of one week ago
    "twoWeeksAgo": 53635.26 // total revenue as of two weeks ago
    "thirtyDaysAgo": 48620.2, // total revenue as of thirty days ago
    "sixtyDaysAgo": 33635.26 // total revenue as of sixty days ago,
    "ninetyDaysAgo": 23635.26 // total revenue as of ninety days ago
  },
  "days": [
    {
      "date": 1578960000, // timestamp representing start of day at 12:00 am UTC
      "revenue": 843.22 // total revenue accrued during this day
    }
    // provide as many days available, up to 1,000 until pagination is supported.
  ]
}

Once this endpoint is available add your protocol to The Web3 Index registry, and include a usage field that points to your endpoint.

Note: your API codebase must be open sourced in order to be considered for the index.

Running App Locally

First, install the project dependencies:

yarn

Next, rename .env.example to .env and replace DATABASE_URL with your own Postgres database url.

After that, run the Prisma ORM database schema migration tool:

npx prisma migrate dev --name init

Finally, run the development server:

yarn dev

Open http://localhost:3000 with your browser to see the result.