DEV Community

Lucas Gragg
Lucas Gragg

Posted on

Portfolio value tracker with PnL calculation

I've been working on crypto price alert bot for a while and wanted to share what I learned.

The problem

Never miss a price move again. Set custom alerts for any cryptocurrency across major exchanges and get instant notifications via Telegram, email, or Discord when your targets hit.

What I built

Here are the main features I ended up shipping:

  • Real-time price monitoring across 10+ exchanges
  • Custom alert conditions (above, below, percent change)
  • Telegram, Discord, and email notifications
  • Portfolio watchlist with live price tracking
  • Historical alert log and price snapshots

Code sample

# Basic structure
class Bot:
    def __init__(self, config):
        self.config = config

    def run(self):
        while True:
            self.scan()
            self.execute()
Enter fullscreen mode Exit fullscreen mode

If you want the full working version with all the battle-tested edge cases
handled, I packaged it here: Crypto Price Alert Bot

Happy to answer questions about the architecture in the comments.

Top comments (0)