discord-stock-ticker

Live stock and crypto tickers for your discord server.

Now with five different types of tickers!

400+ public tickers with over 15k installs across 3k discord servers!

Are you just looking to add free tickers to your discord server? Click the discord icon below to join the support server and get the list of avalible bots!

Preview

image
TICKERS
BOARDS
image
HOLDERS

Premium

Discord Sidebar w/ Premium Bots

For advanced features like faster update times and color changing names on price changes you can subscribe to my premuim offering. I will host individual instances for your discord server at a cost of $1 per bot per month. You can choose a mix of cryptos and stocks and cancel at any time.

If you wish to host your bots on your own hardware, but need help getting set up, I also offer setup services for $20. I will install the service on your hardware and set you up with my internal tools to help manage your instances. This requires a running linux server.

If you are interested please see the contact info on my github page and send me a messgae via your platform of choice (discord perferred). For a live demo, join the support discord linked at the top or bottom of this page.

                                                                     +-----+    
                                                               ----> |yahoo|    
                                                     ---------/      +-----+    
               +--------------------+      ---------/                         
               |discord-stock-ticker|-----/                          +-------+  
+---------+    |                    |------------------------------> |discord|  
|ticker db|--->|                    |-----\                          +-------+  
+---------+    |                    |--\   ---------\                           
               +--------------------+   -----\       ---------\      
                                              --> +-----+      ----> +---------+
                                                  |redis|            |coingecko|
                                              --> +-----+      ----> +---------+
                    +---------------+   -----/       ---------/                 
                    |coingecko-cache|--/   ---------/                           
                    |               |-----/                                     
                    +---------------+                                           

Self-Hosting

This bot is distributed as a docker image and a binary.

The program acts as a manager of one to many bots. You can have one running instance of the program and have any number of bots running within it.

Click here to watch a quick video tutorial on how to self-host these bots on linux.

Roles for colors

To enable color changing you will need to create three roles.

The first role is the role the tickers will appear under. It can be named anything you want. You need to check the Display role members seperatly from other online members option for this role, but do not assign a custom color for this role, leave it default.

Then you need to make two other roles. These roles need to be named exactly tickers-red & tickers-green. Do not check the Display role members seperatly from other online members option for these roles, but do assign colors to these roles, red and green (or whatever color you want to represent gain/loss) respectively.

The last two roles tickers-green and tickers-red need to be below the first role in the role list in your server settings. You should then add all your ticker bots to the first role.

roles example

Using the binary

Pull down the latest release for your OS here.

wget https://github.com/rssnyder/discord-stock-ticker/releases/download/v2.0.0/discord-stock-ticker-v3.3.0-linux-amd64.tar.gz

tar zxf discord-stock-ticker-v3.3.0-linux-amd64.tar.gz

./discord-stock-ticker

Setting options

There are options you can set for the service using flags:

  -address string
        address:port to bind http server to. (default "localhost:8080")
  -cache
        enable cache for coingecko
  -logLevel int
        defines the log level. 0=production builds. 1=dev builds.
  -redisAddress string
        address:port for redis server. (default "localhost:6379")

Systemd service

The script here (ran as root) will download and install a discord-stock-ticker service on your linux machine with an API avalible on port 8080 to manage bots.

wget https://github.com/rssnyder/discord-stock-ticker/releases/download/v3.3.0/discord-stock-ticker-v3.3.0-linux-amd64.tar.gz

tar zxf discord-stock-ticker-v3.3.0-linux-amd64.tar.gz

mkdir -p /etc/discord-stock-ticker

mv discord-stock-ticker /etc/discord-stock-ticker/

wget https://raw.githubusercontent.com/rssnyder/discord-stock-ticker/master/discord-stock-ticker.service

mv discord-stock-ticker.service /etc/systemd/system/

systemctl daemon-reload

systemctl start discord-stock-ticker.service

If you need to make modifications to the setting of the service, just edit the /etc/systemd/system/discord-stock-ticker.service file on the line with ExecStart=.

Now that you have the service running, you can add bots using the API exposed on the addres and port that the service runs on (this address is shown when you start the service).

Stock and Crypto Price Tickers

List current running bots

curl localhost:8080/ticker

Add a new bot

Stock Payload:

{
  "ticker": "pfg",                                  # string: symbol for the stock from yahoo finance
  "name": "2) PFG",                                 # string/OPTIONAL: overwrites display name of bot
  "set_color": true,                                # bool/OPTIONAL: requires set_nickname
  "decorator": "@",                                 # string/OPTIONAL: what to show instead of arrows
  "currency": "aud",                                # string/OPTIONAL: alternative curreny
  "activity": "Hello;Its;Me",                       # string/OPTIONAL: list of strings to show in activity section
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "twelve_data_key": "xxx",                         # string/OPTIONAL: use twelve data as source, pass in api key
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Crypto Payload:

{
  "name": "bitcoin",                                # string: name of the crypto from coingecko
  "crypto": true,                                   # bool: always true for crypto
  "ticker": "1) BTC",                               # string/OPTIONAL: overwrites display name of bot
  "set_color": true,                                # bool/OPTIONAL: requires set_nickname
  "decorator": "@",                                 # string/OPTIONAL: what to show instead of arrows
  "currency": "aud",                                # string/OPTIONAL: alternative curreny
  "pair": "binancecoin",                            # string/OPTIONAL: pair the coin with another coin, replaces activity section
  "pair_flip": true,                                # bool/OPTIONAL: show <pair>/<coin> rather than <coin>/<pair>
  "activity": "Hello;Its;Me",                       # string/OPTIONAL: list of strings to show in activity section
  "decimals": 3,                                    # int/OPTIONAL: set number of decimal places
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Example:

curl -X POST -H "Content-Type: application/json" --data '{
  "ticker": "pfg",
  "name": "PFG",
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxxx"
}' localhost:8080/ticker

Remove a bot

curl -X DELETE localhost:8080/ticker/pfg
curl -X DELETE localhost:8080/ticker/bitcoin

Stock and Crypto Price Tickerboards

Tickerboards are tickers that rotate though several stocks or cryptos. This bot is a newer release, and is not as stable as the rest of the bots.

BOARDS

List current running Boards

curl localhost:8080/tickerboard

Add a new Board

Stock Payload:

{
  "name": "Stocks",                                 # string: name of your board
  "items": ["PFG", "GME", "AMC"],                   # list of strings: symbols from yahoo finance to rotate through
  "header": "1. ",                                  # string/OPTIONAL: adds a header to the nickname to help sort bots
  "set_color": true,                                # bool/OPTIONAL: requires set_nickname
  "arrows": true,                                   # bool/OPTIONAL: show arrows in ticker names
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Crypto Payload:

{
  "name": "Cryptos",                                # string: name of your board
  "crypto": true,                                   # bool: always true for crypto
  "items": ["bitcoin", "ethereum", "dogecoin"],     # list of strings: names from coingecko to rotate through
  "header": "2. ",                                  # string/OPTIONAL: adds a header to the nickname to help sort bots
  "set_color": true,                                # bool/OPTIONAL: requires set_nickname
  "arrows": true,                                   # bool/OPTIONAL: show arrows in ticker names
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Example:

curl -X POST -H "Content-Type: application/json" --data '{
  "name": "Stocks",
  "frequency": 3,
  "set_nickname": true,
  "set_color": true,
  "percentage": true,
  "arrows": true,
  "discord_bot_token": "xxxxxxx",
  "items": ["PFG", "GME", "AMC"]
}' localhost:8080/tickerboard

Remove a Board

curl -X DELETE localhost:8080/tickerboard/stocks

Ethereum, BSC, and Polygon Gas Prices

These bots shows the current recommended gas prices for three types of transactions. You can choose either the ethereum, binance smart chain, or polygon blockchain.

image

List current running Gas

curl localhost:8080/gas

Add a new Gas

Payload:

{
  "network": "ethereum",                            # string: one of: ethereum, binance-smart-chain, or polygon
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Example:

curl -X POST -H "Content-Type: application/json" --data '{
  "network": "polygon",
  "frequency": 3,
  "set_nickname": true,
  "discord_bot_token": "xxxxxxx"
}' localhost:8080/gas

Remove a Gas

curl -X DELETE localhost:8080/gas/polygon

Ethereum, BSC, or Polygon Token Holders

This bot lists the number of addresses that hold a particular token. You can choose from the ethereum or binance smart chain blockchains.

HOLDERS

List current running Holders

curl localhost:8080/holders

Add a new Holder

Payload:

{
  "network": "ethereum",                            # string: one of: ethereum, binance-smart-chain, or polygon
  "address": "0x00000000000000000000000000",        # string: address of contract for token
  "activity": "ethereum",                           # string: text to show in activity section of the bot
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Example:

curl -X POST -H "Content-Type: application/json" --data '{
  "network": "ethereum",
  "address": "0x00000000000000",
  "activity": "Holders of MyToken",
  "set_nickname": true,
  "frequency": 120,
  "discord_bot_token": "xxxxxxx"
}' localhost:8080/holders

Remove a Holder

curl -X DELETE localhost:8080/holders/ethereum-0x00000000000000

ETH/BSC/MATIC Token Price

This bot gets the current rate for a given token. You can choose another token to pair with on price, or by default USDC is used. You can choose either the ethereum, binance smart chain, or polygon blockchain.

List current running Tokens

curl localhost:8080/token

Add a new Token

Payload:

{
  "network": "ethereum",                            # string: network of token, options are ethereum, binance-smart-chain, or polygon
  "name": "my token",                               # string: display name of token
  "contract": "0x00000",                            # string: contract address of token
  "currency": "0x00000",                            # string/OPTIONAL: contract address of token to price against, default is USDC
  "set_nickname": true,                             # bool/OPTIONAL: display information in nickname vs activity
  "set_color": true,                                # bool/OPTIONAL: requires set_nickname
  "decorator": "@",                                 # string/OPTIONAL: what to show instead of arrows
  "activity": "Hello;Its;Me",                       # string/OPTIONAL: list of strings to show in activity section
  "source": "pancakeswap",                          # string/OPTIONAL: if the token is a BSC token, you can set pancakeswap here to use it vs 1inch; you can also set dexlab for solana tokens
  "frequency": 10,                                  # int/OPTIONAL: seconds between refresh
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx"   # string: dicord bot token
}

Example:

curl -X POST -H "Content-Type: application/json" --data '{
  "network": "polygon",
  "contract": "0x0000000",
  "frequency": 3,
  "set_nickname": true,
  "discord_bot_token": "xxxxxxx"
}' localhost:8080/token

Remove a Token

curl -X DELETE localhost:8080/token/polygon-0x0000000

Docker

To run a simple version without any bots on startup (can add via the API as shown above) you can simply run with:

docker run -p "8080:8080" ghcr.io/rssnyder/discord-stock-ticker:3.0.1

Kubernetes

Thanks to @jr0dd there is a helm chart for deploying to k8s clusters. His chart can be found here

You can also use a simple deployment file:

apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    environment: public
  name: ticker-cardano
spec:
  replicas: 1
  selector:
    matchLabels:
      environment: public
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        environment: public
    spec:
      containers:
        - env:
            - name: CRYPTO_NAME
              value: cardano
            - name: DISCORD_BOT_TOKEN
              value: xxxxxxxxxxxxxxxxxxxxxx
            - name: FREQUENCY
              value: "1"
            - name: SET_COLOR
              value: "1"
            - name: SET_NICKNAME
              value: "1"
            - name: TICKER
              value: ADA
            - name: TZ
              value: America/Chicago
          image: ghcr.io/rssnyder/discord-stock-ticker:1.8.1
          name: ticker-cardano
          resources: {}
      restartPolicy: Always
status: {}
GitHub - rssnyder/discord-stock-ticker: Add live stock & crypto prices to your discord sidebar.
Add live stock & crypto prices to your discord sidebar. - GitHub - rssnyder/discord-stock-ticker: Add live stock & crypto prices to your discord sidebar.