WeChart is a tool aiming to provide a software capable to detect whenever a token change it's prices on the most common dexes alive ( pancakeswap/biswap/uniswap/etc.. ), based on the chain where the scraper is running, in the most efficient way possibile and track it as a record on a database (mongodb)
:warning: To run this tool you will need a commercial full-node provider.
The price scraper
listens for the latest swap made to blockchain, based on the token's liquidity pair reserves you can calculate the tokens prices, the router of the swap and the pair of the tokens.
sudo apt install -y mongodb
sudo apt install nodejs
sudo apt install npm
cd /path/to/tokenChartingRepo
npm i
.env
and a config.js
file based on the provided examplesStart the scraper
If you want it to restart on crash follow this commands:
sudo npm install pm2 -g
pm2 startup
pm2 start npm --name "charting-bot-restarter" -- run restarter
pm2 save
pm2 status
pm2 logs charting-bot
If you don't want it to restart on crash
npm run scraper
If you know a more efficent way, or any other better than this please let the community know this by opening an issue with infos about your ideas! :heart: . This repo can be used not only with pancakeswap but also with any kind of other exchange platform on any chain that is similar to pancakeswap.
expressjs
that you can use to query the scraped pricesnpm run server
/token/price/:contract
: Retrun the token price/token/history/:contract?from=<>&to=<>
: Return the history of the token in the specified time range ( use unix timestaps to specify the time ranges )For anyu bug or issue please report it, i'll try to reply as soon as i can :thumbsup: