Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.moralis.com/llms.txt

Use this file to discover all available pages before exploring further.

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.
The Graph exposes blockchain data three ways: subgraphs (custom GraphQL APIs you define with a schema and mappings, then deploy and wait to index), the Token API (a prebuilt REST service for balances, transfers, holders, prices, and NFTs), and Substreams (high-throughput streaming extraction). Moralis delivers the same data through a prebuilt REST Web3 Data API plus Streams — with no subgraph to write, deploy, or keep in sync, and no indexing lead time. For standard token, NFT, wallet, and price data, the migration is mostly search-and-replace; most subgraphs exist to reindex exactly this kind of data.

Quick reference: The Graph → Moralis

Token API (REST)

The Graph endpointMoralis equivalent
GET /v1/evm/balancesGet Token Balances by Wallet
GET /v1/evm/transfersGet ERC20 Transfers · Get Wallet History
GET /v1/evm/tokensGet Token Metadata
GET /v1/evm/holdersGet Token Holders
GET /v1/evm/swapsGet Swaps by Token Address
GET /v1/evm/pools/ohlcGet OHLCV by Pair Address
GET /v1/evm/nft/ownershipsGet NFTs by Wallet
GET /v1/evm/nft/itemsGet NFTs by Contract
GET /v1/evm/nft/collectionsGet NFT Collection Metadata
GET /v1/evm/nft/holdersGet NFT Owners by Contract
GET /v1/evm/nft/salesGet NFT Trades by Contract
GET /v1/evm/nft/transfersGet NFT Contract Transfers

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.
Common subgraph use caseMoralis prebuilt equivalent
Account / wallet token balancesGet Token Balances by Wallet
Transfer event indexingGet Wallet History · Get ERC20 Transfers
Token holder / holder-count trackingGet Token Holders · Token Holder Stats
NFT ownership & transfer indexingGet NFTs by Wallet · NFT Contract Transfers
DEX pool / swap indexingGet Swaps by Token Address · Pair Stats
Price / OHLC from pool eventsGet Token Price · Get OHLCV by Pair Address
Portfolio value / PnL aggregationWallet Net Worth · Wallet PnL

Substreams & real-time → Streams

The Graph featureMoralis equivalent
Substreams (real-time extraction)EVM Streams / Solana Streams
Polling a subgraph for new eventsEVM Streams — push delivery via webhooks
Contract / log event handlingEVM Streams — contract-event + smart-filter expressions
Stream / subscription managementStreams API Reference

Solana (SVM)

The Graph capabilityMoralis equivalent
GET /v1/svm/balancesGet SPL Token Balances · Get Portfolio
GET /v1/svm/tokensGet Token Metadata
GET /v1/svm/swaps / /v1/svm/transfersGet Wallet Swaps
Solana NFTsGet NFTs by Wallet
Solana token pricesGet Token Price
Real-time eventsSolana Streams

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 against https://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
ChainMoralis EquivalentMoralis URLDocumentation
EVMGet Native & ERC20 Balanceshttps://deep-index.moralis.io/api/v2.2/wallets/:address/tokensDocumentation
SolanaGet Portfolio (native + SPL)https://solana-gateway.moralis.io/account/:network/:address/portfolioDocumentation
# The Graph (Token API)
curl "https://token-api.thegraph.com/v1/evm/balances?network=mainnet&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer $THEGRAPH_API_TOKEN"

# Moralis
curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/tokens?chain=eth" \
  -H "X-API-Key: $MORALIS_API_KEY"
Notes: Moralis returns balance, decimals, USD price, USD value, and token metadata (symbol, name, logo, verified flag, spam flag) in one call.

Token transfers

The Graph: GET /v1/evm/transfers
ChainMoralis EquivalentMoralis URLDocumentation
EVMGet ERC20 Transfershttps://deep-index.moralis.io/api/v2.2/erc20/:address/transfersDocumentation
EVMGet Wallet Historyhttps://deep-index.moralis.io/api/v2.2/wallets/:address/historyDocumentation
# The Graph
curl "https://token-api.thegraph.com/v1/evm/transfers?network=mainnet&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \
  -H "Authorization: Bearer $THEGRAPH_API_TOKEN"

# Moralis
curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \
  -H "X-API-Key: $MORALIS_API_KEY"
Notes: For transfers of one token, use Get ERC20 Transfers; for a full decoded, chronological feed of native, ERC20, NFT, swap, and contract activity for a wallet, use Get Wallet History.

Token holders

The Graph: GET /v1/evm/holders
ChainMoralis EquivalentMoralis URLDocumentation
EVMGet Token Holdershttps://deep-index.moralis.io/api/v2.2/erc20/:address/ownersDocumentation
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
ChainMoralis EquivalentMoralis URLDocumentation
EVMGet Swaps by Token Addresshttps://deep-index.moralis.io/api/v2.2/erc20/:address/swapsDocumentation
EVMGet OHLCV by Pair Addresshttps://deep-index.moralis.io/api/v2.2/pairs/:address/ohlcvDocumentation
EVMGet Token Pricehttps://deep-index.moralis.io/api/v2.2/erc20/:address/priceDocumentation
SolanaGet Token Pricehttps://solana-gateway.moralis.io/token/:network/:address/priceDocumentation
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
ChainMoralis EquivalentMoralis URLDocumentation
EVMGet NFTs by Wallethttps://deep-index.moralis.io/api/v2.2/:address/nftDocumentation
EVMGet NFTs by Contracthttps://deep-index.moralis.io/api/v2.2/nft/:addressDocumentation
SolanaGet NFTs by Wallethttps://solana-gateway.moralis.io/account/:network/:address/nftDocumentation
# The Graph
curl "https://token-api.thegraph.com/v1/evm/nft/ownerships?network=mainnet&address=0xd8da6bf26964af9d7eed9e03e53415d37aa96045" \
  -H "Authorization: Bearer $THEGRAPH_API_TOKEN"

# Moralis
curl "https://deep-index.moralis.io/api/v2.2/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/nft?chain=eth&format=decimal&normalizeMetadata=true&media_items=true" \
  -H "X-API-Key: $MORALIS_API_KEY"
Notes: Moralis returns ERC721 and ERC1155 holdings with normalized metadata, hosted media previews, and a 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.
# The Graph — subgraph GraphQL query
{
  transfers(where: { from: "0xd8da6bf26964af9d7eed9e03e53415d37aa96045" }, first: 100) {
    id
    from
    to
    value
    blockNumber
  }
}
# Moralis — prebuilt REST equivalent
curl "https://deep-index.moralis.io/api/v2.2/wallets/0xd8da6bf26964af9d7eed9e03e53415d37aa96045/history?chain=eth" \
  -H "X-API-Key: $MORALIS_API_KEY"

Substreams & real-time → Moralis Streams

The Graph: Substreams / polling a subgraph for new entities
FeatureMoralis EquivalentDocumentation
Address activity eventsEVM StreamsDocumentation
Contract / log eventsEVM StreamsDocumentation
Solana account eventsSolana StreamsDocumentation
Stream management APIStreams API ReferenceDocumentation
# Moralis Streams — create one stream, then attach many addresses to it
curl -X POST "https://api.moralis-streams.com/streams/evm" \
  -H "X-API-Key: $MORALIS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "webhookUrl": "https://your.app/webhooks/moralis",
    "description": "Wallet activity",
    "tag": "wallet-activity",
    "chainIds": ["0x1", "0x2105"],
    "includeNativeTxs": true,
    "includeContractLogs": true
  }'
Notes: Where Substreams is a streaming-extraction primitive you wire into your own sink, Moralis Streams pushes decoded events to an HTTP webhook with retries and dynamic address management, plus ABI-decoded contract events and smart-filter expressions.
The 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

  1. Get an API keyGet your API key.
  2. Map Token API calls — replace each /v1/... REST call with the Moralis equivalent above. Field names differ; most teams write a thin response adapter.
  3. 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.
  4. Move Substreams / polling to Streams — create one Stream per event class and attach addresses dynamically for push delivery.
  5. Verify chain coverage — diff your indexed chains against Supported Chains.
  6. (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:

Need help migrating off The Graph?

If you’re moving production subgraphs or Token API traffic to Moralis, the support team can help size the migration and review which subgraphs map cleanly to prebuilt endpoints — reach out via moralis.com.