Indexer of the Starknet AMM pools written in Golang - to be used in Fibrous
sister of Shovel NFT Indexer
The app:
- follows the Starknet blocks and emits events for the new blocks
- when new blocks are emitted, it fetches the recorded pools'
sync
events in order to update the pool reserves - updates recorded tokens' prices and total pool values periodically
- will also track the new pools and tokens when the amm contracts become more mature
(1) Preperation to build
// Prepare the docker network
make docker-network
// Creates Docker container for Postgres
make postgres
// Creates database in the container
make createdb
// Creates Rabbitmq container in Docker
make rabbitmq
(2) Build or install the apps: pickaxe & psocket (optional, changes by the running preferences)
// Build the apps: psocket & pickaxe
make build
// Install the apps: psocket & pickaxe
make install
Run the app directly
// Run the socket block finder (basic version - after step-1)
make psocket
// Run the app (basic version - after step-1)
make pickaxe
// Run the app (if the app has been installed - after `install` in step-2)
pickaxe
// Run the socket (if the app has been installed - after `install` step-2)
psocket
// Run the app (if the code has been built - after `build` in step-2)
./bin/pickaxe
// Run the socket (if the code has been built - after `build` in step-2)
./bin/psocket
Custom app running preferences
// For testnet envs - run with testnet flag, example:
pickaxe -t
pickaxe --testnet
Run the app in docker network (after step-1)
// Build the app containers
make docker-build-psocket
make docker-build-pickaxe
// Create & run the app containers
make docker-container-psocket
make docker-container-pickaxe
Run the app with docker-compose (Recommended to run the app - run directly)
// Create the docker compose network
make docker-compose
Notes:
- You should prepare a initial amms - tokens - pools list for the initial run. The indexer will accept this point as a synced point. Example ones belo for the mainnet configurations:
- amms
- tokens
- pools
- go to this folder to set up testnet configurations
Used Major Requirements & Tools
Check the database tables in DBDocs.