Skip to content

Latest commit

 

History

History
34 lines (25 loc) · 1.15 KB

File metadata and controls

34 lines (25 loc) · 1.15 KB

Showcase squid 05: DEX pair creation and swaps

This squid captures pair creation and Swap events emitted by Pancakeswap contracts. It follows the factory pattern. See more examples of requesting data with squids on the showcase page of Subsquid documentation.

Dependencies: Node.js, Docker.

Quickstart

# 0. Install @subsquid/cli a.k.a. the sqd command globally
npm i -g @subsquid/cli

# 1. Retrieve the template
sqd init showcase05 -t https://github.com/subsquid-labs/showcase05-dex-pair-creation-and-swaps
cd showcase05

# 2. Install dependencies
npm ci

# 3. Start a Postgres database container and detach
sqd up

# 4. Build and start the processor
sqd process

# 5. The command above will block the terminal
#    being busy with fetching the chain data, 
#    transforming and storing it in the target database.
#
#    To start the graphql server open the separate terminal
#    and run
sqd serve

A GraphiQL playground will be available at localhost:4350/graphql.