Utilities to get data directly on chain using UniswapV2Query contract.
Choose a consistent network name across the two configuration files.
PROVIDER_URL_POLYGON="https://polygon-mainnet.g.alchemy.com/v2/..."
ACCOUNT_KEY="5fa...9f39"
UV2QUERY_ADDRESS_POLYGON="0x460...7e67"
{ "network": "polygon", "dex": "quickswap", "pairsChunkSize": 500, "cooldownMs": 2000, "cooldownAfterFailSec": 3, "tokensChunkSize": 10, "quickswapFactoryPolygon": "0x5757371414417b8C6CAad45bAeF941aBc7d3Ab32", "outputPath": "./output" }
-
Deploy the contract:
npx hardhat run .\scripts\deploy.js --network polygon
. -
Set all needed configuration values.
-
Use querypairs to get token pairs data from the configured DEX.
-
Use querytokens to get tokens data using querypairs output.
-
Use jointokensfiles to join querytokens output into a single file.
-
Use addtokenstopairs to add token data to pairs file and normalize reserves.
-
Use refinepairs to remove not meaningful pairs.