Alchemy Subgraphs
Standardized guide: Overview → Quickstart → Windows & Limits → Backfill → Reorgs → Examples → Troubleshooting.
Overview
Alchemy Subgraphs delivers managed GraphQL indexing with seamless compatibility with The Graph tooling. A dedicated Sei pipeline (v6.1.11+ ) adds:
- Native Sei EVM support with < 2 block lag under steady load.
- Automatic retries for synthetic transaction logs.
- Managed backfills with configurable block windows (default 2,000).
- Integrated monitoring dashboards (error rates, sync status, latency percentiles).
Existing Graph CLI projects can be pointed at Alchemy by switching the gateway endpoint and redeploying without code changes.
Quickstart
- Create an Alchemy account and request access to the Sei Subgraphs beta.
- Install the CLI:
npm install -g @graphprotocol/graph-cli(compatible with Alchemy’s gateway). - Initialise your subgraph:
graph init --from-example sei/my-dapp. - Update the network configuration:
# subgraph.yaml excerpt
dataSources:
- kind: ethereum/contract
network: sei-mainnet
source:
address: '0x...'
startBlock: 12000000
mapping:
apiVersion: 0.0.9
language: wasm/assemblyscript- Authenticate:
graph auth --node https://subgraphs.sei.alchemy.com/api <API_KEY>. - Deploy:
graph deploy --node https://subgraphs.sei.alchemy.com/api sei/my-dapp.
Windows & Limits
- Default backfill window: 2,000 blocks (adaptive). Use CLI flag
--block-windowto customise. - Daily compute quota: 5 hours build time on the free tier; contact support for dedicated workers.
- Concurrent backfills per project: 2.
- Reorg depth assumption: 0 (Sei finality). Payloads auto-commit once ingested; manual rewinds available via dashboard.
- Synthetic event handling: automatically tagged via
synthetic=truemetadata.
Backfill Strategy
- Stage subgraph versions: keep
productionindexing current data whilebackfillversion replays history. - Enable automatic snapshotting every 250k blocks to accelerate restarts.
- Use the CLI
graph buildlocally with--ipfs /tmp/ipfsto catch ABI/schema errors before deploying. - Pair backfills with the Indexing Best Practices guidance for retry behaviour.
Reorg Handling
Sei blocks do not revert, but Alchemy maintains a virtual reorg buffer for consistency:
- Recent blocks (last 20) stay in a mutable buffer for 5 minutes; this allows manual rewinds if upstream data is corrected.
- The dashboard shows
FinalizedvsBufferedheights; monitor and alert if the buffer grows unexpectedly (indicates provider lag). - If a rewind is triggered (rare), redeploy the subgraph to the prior snapshot via the console.
Build Pipeline Snapshot
deployment loop
Sei subgraph lifecycle
1. Generate schema & mappings
Run graph codegen locally; ensure synthetic fields are added to the schema.
2. Build & validate
Use graph build with a local IPFS daemon (or the bundled mock) to catch ABI mismatches fast.
3. Deploy to Alchemy
graph deploy --node https://subgraphs.sei.alchemy.com/api and watch the dashboard until lag shrinks under 2 blocks.
Implementation References
Schema checklist
Ensure every synthetic field is represented in `schema.graphql` before running codegen.
Sei indexing best practices
Align window sizes and backoff strategy with Sei RPC guidance.
Alchemy subgraph dashboard
Monitor buffered vs finalized heights, error counts, and throughput.
Troubleshooting
| Error | Cause | Fix |
|---|---|---|
Deployment stuck at Pending | Missing schema or ABI mismatch | Run graph build locally and fix reported errors before redeploying. |
Lag > 10 blocks | Backfill window too large or rate-limited | Reduce --block-window to 500 and monitor dashboard metrics. |
Synthetic events missing | synthetic field not persisted in schema | Add boolean column in schema.graphql and rerun migrations. |
Invalid API key | CLI auth target incorrect | Ensure you pass the Alchemy subgraphs endpoint to graph auth. |
Last updated on