A Discord bot that gets data from descentralized exchanges such as uniswap and sushiswap using data from The Graph. It can be used to list pools, get their info and also get prices against popular stablecoins.
First you need to install the dependencies:
npm install
The bot will expect 2 environment variables: BOT_TOKEN
, which is a token you can get from the Discord Developer Portal. It needs bot permissions and the ability to generate commands. You'll end up with a link like this:
You will also need the THE_GRAPH_API_KEY
which you can get on The Graph's studio.
Once there's an .env
file, run the commands:
npm install
npm run tsc
node bot.js
Returns the list of supported exchanges. For now, only uniswap
and sushiswap
.
Returns a list of pools in an exchange for a given symbol.
exchange
must besushiswap
oruniswap
.symbol
must be something likeWETH
,USDC
,LINK
.
e.g /list_pools uniswap LINK
Returns the name, symbol, price and volume for a pair of tokens in an exchange.
exchange
must besushiswap
oruniswap
.pair
must be two symbols separated by a slash (e.gLINK/USDT
)
e.g /get_pool_info uniswap LINK/USDT
Returns the price against a stablecoin. It will use sushiswap by default, and if there's no stable, it will return the price against USDT, USDC and DAI.
exchange
must besushiswap
oruniswap
.stable
must be something likeUSDC
,DAI
.
e.g /get_price LINK uniswap