Skip to content
This repository was archived by the owner on Dec 16, 2022. It is now read-only.

🤖 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-ts

Repository files navigation

🦙 Alpaca Excerpt Bot

Deprecated, because I suck at TS, for maintained version of this bot, see this repo.

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

Requirements

Service/API used in this bot.

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

Obtain a Telegram bot token and store it in Google Cloud Secret Manager.

Deploy

  1. yarn lint: code formatting and linting.
  2. yarn deploy: build and deploy the bot.
  3. yarn trigger: manually trigger the bot function (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