Skip to main content

Intro

This guide shows you how to index and query USDT0 on Stable using Ormi’s 0xGraph. By the end, you’ll have a live subgraph that tracks transfers, mints, burns and related events, and you’ll be able to query USDT0 activity with GraphQL.

Prerequisites

1. Create and configure your subgraph project

1.1 Get your Ormi API key

  1. Log in to Ormi and go to your dashboard.
  2. From the dashboard, create an API key for deployments.
Create an API key
Keep this page open, we will need the API key to deploy a subgraph.

1.2 Install Graph CLI

On your local machine, run the following in your terminal:

1.3 Create a directory for your subgraph

We will call the folder usdt0-stable in this example.

1.4 Initialize the project

Run bash in the directory folder

1.5 Install dependencies

1.6 Create the required files

You will need:
  • subgraph.yaml
  • schema.graphql
  • mappings/USDT0.ts
  • abis/USDT0.json
After creating these files, put them in the usdt0-stable folder.

Directory layout

You will also see node_modules/ after installing dependencies - that is expected.

1.7 subgraph.yaml

1.8 schema.graphql

1.9 Mapping files in typescript

1.9 ABIs

2. Build the Subgraph

Generate types:
Run codegen
Now run:
Build graph

3. Deploy the Subgraph to Ormi

Return to your API key from the dashboard. Replace <graph-name> and <API key> with your actual values
Deploy graph

Track sync status

You can check syncing in the dashboard by going to the Subgraphs tab:
Track sync status

4. Query USDT0

Click on the button where the red arrow is pointing.
Click on graphql icon
Once synced, click the GraphQL endpoint link in the dashboard.
Graphql link

Sample query

Run this query to fetch the latest transfers
Query graphql

Done!

You now have a live subgraph indexing USDT0 on Stable via Ormi’s 0xGraph. Want the full walkthrough with context? Check out the USDT0 Subgraph Tutorial on the Ormi Blog.