Skip to content

gsscoder/chainquery

Repository files navigation

chainquery

Utilities to get data from from a blockchain using UniswapV2Query contract.

Configuration

Choose a consistent network name across the two configuration files.

.env

PROVIDER_URL_POLYGON="https://polygon-mainnet.g.alchemy.com/v2/..."
ACCOUNT_KEY="5fa...9f39"
UV2QUERY_ADDRESS_POLYGON="0x460...7e67"

appconfigs.json

{
  "network": "polygon",
  "dex": "quickswap",
  "pairsChunkSize": 500,
  "cooldownMs": 2000,
  "cooldownAfterFailSec": 3,
  "tokensChunkSize": 10,
  "quickswapFactoryPolygon": "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32",
  "outputPath": "./output"
}

Usage

  • Deploy the contract: npx hardhat run .\scripts\deploy.js --network polygon.

  • Set all needed configuration values.

  • Run querypairs script to get token pairs from the configured DEX.

  • Run querytokens to get tokens data using querypairs output.

After running the querytokens script, the querypairs output file will be updated with tokens data.

About

Queries pairs and tokens data directly on chain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published