Skip to content

🤖 A Telegram bot that extracts dev alpha from DefiLlama Round Up.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

0xYYY/alpaca-excerpt-bot

Repository files navigation

🦙 Alpaca Excerpt Bot 🤖

Extract news under topics of interest (MEV, security, development) from DefiLlama Round Up and forward to DefiLlama Round Up for Devs.

Requirements

Python Packages

Tools

Service/API

Google Cloud

  1. Create a Google Cloud account and a project.
  2. Set up a Scheduler for the daily cron job.
  3. Set up a Pub/Sub topic.
  4. Install the gcloud command line tool.
Architecture

The script itself is quite simple. Actually, more work is done on figuring out and setting up the environment where it runs. I chose to deploy the bot on Google Cloud Functions (a serverless platform). The following chart describe the overall architecture.

flowchart LR
    A("Daily Cron Jub<br>(Cloud Scheduler)")
    B("Topic<br>(Cloud Pub/Sub)")
    C("Bot Script<br>(Cloud Functions)")
    A -- publish --> B
    C -- subscribe --> B
Loading

The cron job will publish an event to the topic daily, triggering the bot function to execute its logic to crawl the Round Up content from DefiLlama's website, extract relevant news, and then send an excerpt to the channel.

Telegram

  1. Create a bot account.
  2. Create a user account with no-SIM signup. (We'll be uploading the secret credentials to Google Cloud to log in as this user, so better not use the personal account.)
  3. Follow the instructions from Telethon to create session keys for both of the above accounts.

Deploy

  1. just deploy: deploy the bot.
  2. just trigger: manually trigger the deployed bot (often used for testing).

Note The first time deploying the bot to Google Cloud, some warnings and errors will pop up asking for permissions, e.g. granting default service account access to Secret Manager. Simply follow the hints and set up the required permissions to proceed.

Contribution

Absolutely welcome. Also feel free to reach out to discuss the project or anything else!

License

Dual licensed under either MIT License or Apache License, Version 2.0.

About

🤖 A Telegram bot that extracts dev alpha from DefiLlama Round Up.

Topics

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks