/discord-stock-ticker

Add live stock & crypto prices to your discord sidebar.

Primary LanguageGoMIT LicenseMIT

discord-stock-ticker

Live stock tickers for your discord server.

🍾 250+ tickers with over 6,000 installs across 900 discord servers!

Releases MIT License

GitHub last commit GitHub stars GitHub watchers

Preview

Discord Sidebar w/ Bots

Join the discord server

Discord Chat

Support this project

Buy Me a Coffee

Love these bots? You can support this project by subscribing to the premium version or maybe buy me a coffee or hire me to write/host your discord bot!

Related Projects

Discord bot to create new tickers (avalible on the support server): https://github.com/rssnyder/discord-stock-ticker-bot

Cache-like system to get around coingecko api limits: https://github.com/rssnyder/coingecko-cache

Add free tickers to your servers (click the stock/crypto symbol in the charts below to add)

Don't see a stock or crypto that you need? Open a github issue or join our discord server to use the broker bot!

Ticker creation bot

Stocks

x x x
aa arch lac.to
x scr.to bb
amc nok pfg
aapl amzn goog
gspc dji ixic
tsla dkng spy
sprq acic bmbl
plug fcel ipod
ipof amd nio
esgc gc=f si=f
cl=f pltr qqqj
pypl apha sndl
hut.to nhic rty=f
vix tnx cciv
hcmc ctrm etfm
sens ftcv mvis
cake chwy cmcsa
mstr ethe arkk
discb nvta msft
nflx fcx bidu
ttd gme scr
fubo dis buzz
bngo uavs arkg
es=f nq=f ym=f
arkx arkw arkf
v sq jpm
ma bac wfc
zb=f crl mnmd
c nvda comp
nsei brk-a nsebank
fb sol sos
mara ebon riot
ocgn bfarf hutmf
rkt btc tlry
ogi cidm roku
btbt omx tcnnf
trul adbe docu
lmt wmt cost
nya gold hd
iwm nkla sklz
coin snow li
ldos goev ctxr
ndaq wkhs clov
vti fsr qqq
es si

Crypto

x x x
bitcoin-cash ethereum dogecoin
monero litecoin ripple
polkadot cardano chainlink
stellar 0x balancer
iota reef-finance algorand
tezos ethereum-classic ravencoin
binancecoin ethernity-chain ecomi
reserve-rights-token aave ruler-protocol
polkamon uniswap bittorrent-2
tron vechain vethor-token
siacoin bitcoin illuvium
cosmos zilliqa pangolin
orion-protocol matic-network basic-attention-token
wink shiba-inu pancakeswap-token
graphlinq-protocol solana banano
raydium cope safemoon
nerve-finance lightning-protocol ftx-token
enjincoin quick decentraland
fantom spookyswap apeswap-finance
locgame coti casper-network
luck hbar wex
rope woo sushi
lyxe ele ksm
eos moonstar pekc
est luna arrr
grt xrune dfyn
celo pussy titan
xch clu steel
theta force ice
tomb aqu amp
uncx cummies kmd
wexpoly iron xdo
xusd evai chee
fish spirit comfy
hodl prtcle 1inch
dero zep

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.

When running the binary, it servers as a manager of one to many bots. You can have one running instance of the binary (service) and have any number of bots running within it.

For the docker version, you can also have one docker instance manage many bots. You can also use docker environment variables to configure one bot in startup, and still be able to add more via the manager later.

Roles for colors

To enabled 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.

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-v2.0.0-linux-amd64.tar.gz

tar zxf discord-stock-ticker-v2.0.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 below script (ran as root) will download and install a discrod-stock-ticker service on your linux machine with the API avalible on port 8080 to manage bots.

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

tar zxf discord-stock-ticker-v2.2.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
Adding bots

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).

List current running bots
curl localhost:8080/ticker
Add a new bot

Stock Payload:

{
  "ticker": "pfg",
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx",
  "name": "2) PFG",  # string/OPTIONAL: overwrites display name of bot
  "frequency": 10,  # int/OPTIONAL: default 60
  "set_nickname": true,  # bool/OPTIONAL
  "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
}

Crypto Payload:

{
  "name": "bitcoin",
  "crypto": true,
  "discord_bot_token": "xxxxxxxxxxxxxxxxxxxxxxxx",
  "ticker": "1) BTC",  # string/OPTIONAL: overwrites display name of bot
  "frequency": 10,  # int/OPTIONAL: default 60
  "set_nickname": true,  # bool/OPTIONAL
  "set_color": true,  # bool/OPTIONAL: requires set_nickname
  "decorator": "@",  # string/OPTIONAL: what to show instead of arrows
  "currency": "aud",  # string/OPTIONAL: alternative curreny
  "bitcoin": true,  # bool/OPTIONAL: show prices in BTC
  "activity": "Hello;Its;Me",  # string/OPTIONAL: list of strings to show in activity section
}

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

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:2.6.1

Here is an example docker compose file with environment variables set for adding a bot on startup. Notice the environment variables are the same as the JSON payload above, but in capital letters:

---
version: "2"
services:

  ticker-stock:
    image: ghcr.io/rssnyder/discord-stock-ticker:2.6.1
    container_name: discord-stock-ticker
    environment:
      - DISCORD_BOT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
      - TICKER=gme
      - FREQUENCY=10  # OPTIONAL / seconds between price updates
      - STOCK_NAME=1. GME  # OPTIONAL / overrides name of bot
      - SET_NICKNAME=1  # OPTIONAL / uses server nickname to set price in bot name / requires "change nickname" perms
      - SET_COLOR=1  # OPTIONAL / change colors based on day change / requires "manage roles" perms and tickers-green & ticker-red roles
      - 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

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: {}

Support

If you have a request for a new ticker or issues with a current one, please open a github issue or find me on discord at jonesbooned#1111 or join the support server.

Love these bots? Maybe buy me a coffee! Or send some crypto to help keep these bots running:

eth: 0x27B6896cC68838bc8adE6407C8283a214ecD4ffE

doge: DTWkUvFakt12yUEssTbdCe2R7TepExBA2G

bch: qrnmprfh5e77lzdpalczdu839uhvrravlvfr5nwupr

btc: 1N84bLSVKPZBHKYjHp8QtvPgRJfRbtNKHQ