Migrating from The Graph to Moralis
Moralis is a drop-in alternative to The Graph. Moralis combines RPC node access, an enriched Web3 Data API, and real-time Streams behind a single API key — so you can replace The Graph’s Token API, retire the custom subgraphs you maintain for standard token/NFT/wallet data, and move Substreams real-time workloads to webhooks. This page maps the The Graph surface to Moralis endpoint-by-endpoint so the swap is mostly search-and-replace.
Quick reference: The Graph → Moralis
Token API (REST)
Subgraphs (custom GraphQL) → prebuilt Moralis endpoints
Most subgraphs reindex standard token, NFT, wallet, and DeFi data. Those become a single prebuilt Moralis call — no schema, mappings, deployment, or indexing wait.Substreams & real-time → Streams
Solana (SVM)
Endpoint details
Each section shows the The Graph call, the Moralis URL(s) that replace it by chain, and a runnable example. The Graph Token API calls are REST againsthttps://token-api.thegraph.com with a Bearer token; the Moralis equivalents are plain REST with an X-API-Key header.
Token balances by wallet
The Graph:GET /v1/evm/balances
Token transfers
The Graph:GET /v1/evm/transfers
Token holders
The Graph:GET /v1/evm/holders
Notes: For aggregate metrics (holder count, distribution, acquisition over time) use Token Holder Stats and Historical Token Holders — common targets for custom holder-tracking subgraphs.
Swaps & OHLC prices
The Graph:GET /v1/evm/swaps and GET /v1/evm/pools/ohlc
Notes: Moralis pricing is sourced from on-chain DEX liquidity with USD conversion. For pair-level analytics see Pair Stats and Token Pairs.
NFTs by wallet & by contract
The Graph:GET /v1/evm/nft/ownerships and GET /v1/evm/nft/items
possible_spam flag inline. For owner sets use Get NFT Owners by Contract or by Token ID; for sales/trades use Get NFT Trades by Contract.
Replacing a subgraph GraphQL query
A typical subgraph query for a wallet’s token transfers maps to one Moralis REST call — no subgraph deploy or indexing wait.Substreams & real-time → Moralis Streams
The Graph: Substreams / polling a subgraph for new entitiesThe Graph’s fully custom subgraphs — indexing bespoke protocol state, derived entities, or arbitrary contract business logic — have no prebuilt Moralis equivalent. Moralis ships standard token, NFT, wallet, price, and DeFi data out of the box; it is not a general-purpose custom indexer. If a subgraph encodes domain-specific logic you can’t express as standard data, keep that on Streams plus your own processing, or retain it on The Graph and use Moralis for everything standard. The decentralized network, curation, and GRT query economics likewise have no Moralis counterpart — Moralis is a managed API with a single key.
Chain coverage
The Graph Token API covers Ethereum, BNB Smart Chain, Polygon, Optimism, Arbitrum, Base, Unichain, Avalanche, and Solana; subgraphs can index many more chains via custom deployments. Moralis covers a comparable footprint across EVM, Solana, and Bitcoin — see Supported Chains. Before cutover, diff the chains you index on The Graph against the supported list and flag any gaps.Migration checklist
- Get an API key — Get your API key.
- Map Token API calls — replace each
/v1/...REST call with the Moralis equivalent above. Field names differ; most teams write a thin response adapter. - Retire standard subgraphs — any subgraph that indexes balances, transfers, holders, NFTs, prices, or swaps can be replaced by a prebuilt Moralis endpoint. Delete the schema/mappings you were maintaining and drop the deploy + indexing wait.
- Move Substreams / polling to Streams — create one Stream per event class and attach addresses dynamically for push delivery.
- Verify chain coverage — diff your indexed chains against Supported Chains.
- (Optional) Add RPC — The Graph isn’t a JSON-RPC provider; if you also need RPC, Moralis RPC Nodes consolidate it onto the same key.
Beyond The Graph: what Moralis adds
Once migrated, teams commonly adopt Moralis endpoints that would each require a separate custom subgraph on The Graph:- Wallet PnL — realized and unrealized PnL per wallet with token-level breakdown. See Wallet PnL Summary and Wallet PnL by Token.
- Wallet Net Worth — full USD net worth in one call. See Wallet Net Worth.
- DeFi positions — protocol positions with USD value and breakdown. See Wallet DeFi Positions.
- Token discovery — Trending Tokens.
- Token holder analytics — Token Holder Stats and Historical Token Holders.
- DEX & pair analytics — Pair Stats and Token Pairs.

