Examples
info
Any GitHub repo can be used as a template for sqd init. Simply pass the repo URL to the --template
flag.
To learn by example, inspect these squids:
EVM Processor
Browse a dedicated repository with EVM squid examples. It contains:
- A squid indexing transfers by extracting
Transfer(address,address,uint256)
logs emitted by a given contract - A squid indexing token swaps from dynamically created AMM pools.
- A squid that additionally queries the historical state of the contract.
Additionally, inspect the following benchmark squids:
- A Gravatar squid a simple squid migrated from a subgraph
- Exosama Marketplace squid A squid indexing Exosama NFT metadata to power the Exosama NFT marketplace.
- A Uniswap v3 squid. A complex squid showcasing contract state calls, wildcard filters and optimizations for batch saving.
Substrate Processor
Browse a dedicated repository with Substrate squid examples:
- A simple squid tracking Kusama transfers. Illustrates a basic usage of
SubstrateBatchProcessor
. - A complex squid tracking balances across multiple parachains. This complex squid illustrates the usage of
SubstrateBatchProcessor
, storage calls and custom resolvers. - Simple EVM squid. Illustrates how to use
SubstrateBatchProcessor
to index EVM logs. See EVM tutorial for details. - Simple WASM squid. Illustrates how to use
SubstrateBatchProcessor
to index WASM smart contract data. See WASM tutorial for details. - An advanced squid tracking all the historical ERC20 and NFT transfers on Moonbeam. Illustrates the usage of wildcard selectors and a possible way to organize a growing squid codebase into submodules.
More examples can be found by browsing the gallery of the public squids in the Aquairum. Inspect the squid sources by following the GitHub link on the squid page.