From 0c2b9425913c9b292e75e99b3ccf964fab95bd51 Mon Sep 17 00:00:00 2001 From: Nabarun Date: Mon, 14 Aug 2023 18:27:50 +0530 Subject: [PATCH] Add steps for generating sushiswap events --- app/data/stacks/sushiswap-subgraph/README.md | 53 ++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/app/data/stacks/sushiswap-subgraph/README.md b/app/data/stacks/sushiswap-subgraph/README.md index 4f82711b..d21b69a1 100644 --- a/app/data/stacks/sushiswap-subgraph/README.md +++ b/app/data/stacks/sushiswap-subgraph/README.md @@ -38,6 +38,59 @@ laconic-so --stack sushiswap-subgraph deploy --cluster sushigraph logs -f sushis # sushigraph-sushiswap-subgraph-v3-1 | Done ``` +## Run + +To check graph-node logs: +```bash +laconic-so --stack sushiswap-subgraph deploy --cluster sushigraph logs -f graph-node +``` + +To deploy tokens run: +```bash +docker exec -it sushigraph-sushiswap-v3-periphery-1 yarn hardhat --network docker deploy --tags TestERC20 +``` +This can be run multiple times to deploy ERC20 tokens + +Take note of the deployed token addresses to use later + +Get contract address of factory deployed: +```bash +docker exec -it sushigraph-sushiswap-v3-core-1 jq -r '.address' /app/deployments/docker/UniswapV3Factory.json +``` +Set it to environment variable `FACTORY_ADDRESS` to use later + +To create a pool: +```bash +docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:create:docker --factory $FACTORY_ADDRESS --token0 $TOKEN1_ADDRESS --token1 $TOKEN2_ADDRESS --fee 500 +``` + +Set the created pool address to environment variable `POOL_ADDRESS` to use later + +To initialize pool: +```bash +docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:initialize:docker --sqrt-price 4295128939 --pool $POOL_ADDRESS +``` + +Set the recipient address to the contract deployer: +```bash +export RECIPIENT=0xD375B03bd3A2434A9f675bEC4Ccd68aC5e67C743 +``` + +Trigger pool mint event: +```bash +docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:mint:docker --pool $POOL_ADDRESS --recipient $RECIPIENT --amount 10 +``` + +Trigger pool burn event: +```bash +docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:burn:docker --pool $POOL_ADDRESS --amount 10 +``` + +Trigger pool swap event: +```bash +docker exec -it sushigraph-sushiswap-v3-core-1 pnpm run pool:swap:docker --pool $POOL_ADDRESS --recipient $RECIPIENT --sqrt-price 4295128939 +``` + ## Clean up Stop all the services running in background run: