You shape it.
We run it.
Pick your events, write handlers, deploy — one TypeScript file. Out comes typed Postgres tables and a public REST API, backfilled from genesis and reorg-safe. We host it, or bring your own database.
Three parts, one file.
Sources, schema, handlers.
The whole subgraph is one TypeScript file. Writes batch and flush atomically per block — on compatible redeploys it reindexes for you (breaking schema changes get a migration plan, never a silent drop).
Read the Subgraphs docs →export default defineSubgraph({
name: "stx-transfers",
sources: {
transfer: { type: "stx_transfer" },
},
schema: {
transfers: {
columns: {
sender: { type: "principal", indexed: true },
recipient: { type: "principal", indexed: true },
amount: { type: "uint" },
},
},
},
handlers: {
transfer: (event, ctx) => {
ctx.insert("transfers", {
sender: event.sender,
recipient: event.recipient,
amount: event.amount,
});
},
},
});Aggregates
Roll up a subgraph table server-side instead of paging every row. The new /aggregate endpoint runs count, sum, min, max, and distinct counts over the same filters as the list endpoint.
Safer schema changes on your own database
For bring-your-own-database subgraphs, a breaking schema change (removed table/column, changed type, or a forced reindex) is now refused, keeping your data intact.
View the changelog →Your schema. Our uptime.
Your data, never silently dropped.
One file, one deploy. Hosted or BYO database, full genesis backfill on paid plans.