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.
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.
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.
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.
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.
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.
Install dependencies (using the pinned Node/Yarn toolchain):
nvm use
npm install -g corepack
corepack enable
corepack prepare yarn@1.22.22 --activate
yarn installCopy .env.example to .env and fill all required values (database URL, API
keys, subgraph env variables).
If you don't already have Postgres running, the quickest option is to spin up a disposable Docker container:
docker run --name web3index-postgres \
-e POSTGRES_USER=web3index \
-e POSTGRES_PASSWORD=web3index \
-e POSTGRES_DB=web3index \
-p 5432:5432 \
-d postgres:15Then point Prisma to it via .env:
DATABASE_URL="postgresql://web3index:web3index@localhost:5432/web3index?schema=public"You can stop/remove the container when you're done:
docker stop web3index-postgres
docker rm web3index-postgresPrisma's migration/schema engines expect OpenSSL 1.1 by default. On newer
distros (Ubuntu ≥22.04, Debian ≥12, etc.) only OpenSSL 3 is available, so we
ship yarn scripts that download and point Prisma to the OpenSSL-3 compatible
binaries for you:
# Install client w/ OpenSSL 3 engine
yarn prisma:generate:ossl3
# Run migrations with OpenSSL 3 engine
yarn prisma:migrate:dev:ossl3 --name initIf you're deploying migrations, use yarn prisma:migrate:ossl3 instead.
(You only need to re-run the prisma:generate:ossl3 script after deleting
node_modules or upgrading Prisma.)
Then run the development server (use yarn dev:ossl3 on hosts that require the
OpenSSL 3 engine):
yarn devOpen http://localhost:3000 with your browser to see the result.
-
Configure env vars (
DATABASE_URL,CMC_API_KEY,POKTSCAN_API_KEY, etc.), run the relevant Prisma commands (yarn prisma:generate/yarn pry:generate:ossl3,yarn prisma:migrate:dev/yarn prisma:migrate:dev:ossl3) depending on your host. -
Run the desired importer via the helper scripts:
DATABASE_URL=postgres://... yarn cmd cmd/pocket.ts
On OpenSSL‑3 hosts use
yarn cmd:ossl3 cmd/pocket.ts. Swapcmd/pocket.tsforcmd/akash.ts,cmd/arweave.ts, orcmd/filecoin.tsas needed. -
Optional debugging aids:
DEBUG=prisma:queryorPRISMA_LOG_LEVEL=infofor verbose Prisma logs.NODE_OPTIONS="--inspect-brk" yarn cmd cmd/akash.ts(oryarn cmd:ossl3 cmd/akash.ts) to use the Node inspector.psql "$DATABASE_URL" -c 'select date, revenue from "Day" where "projectId" = … order by date desc limit 5'(oryarn prisma studio) to confirm results.
These scripts mirror the scheduled GitHub Actions jobs, so a successful local run means the cron run will behave the same.