馃 Autonomous Twitter bot that posts analytics of the APYs available on the Solend Protocol.

Overview

Logo

Solend APY Twitter Bot

Solana Ignition Hackathon 2021

View DemoReport BugRequest Feature


Table of Contents


About The Project

@SolendAPY_bot is an autonomous Twitter bot that posts analytics of the APYs available in the Solend Protocol. Since a picture is worth a thousand words, instead of posting the APYs as a text we built an image generator to make the data more appealing for the followers. On Sundays, a weekly chart is automatically sent to better show the trend of the data for each token. Discord and Telegram bots can automatically mirror tweets right into a channel, making data accessible for users on other platforms.

The idea came from a tweet where the Solend creators proposed valuable projects for the community.

screenshot

Go to @SolendAPY_bot to see the bot in action

Motivation

  • Give Solend users updated and transparent APY information on their Twitter feed, so that they can make decisions on how to efficiently lend and borrow their tokens
  • Build the foundation of an analytics website for Solend to show the trends on APYs and other stats. Solend does not currently provide any official solution for this.
  • Contribute to Solend's growth
  • Learn new technologies by building a project
apy_table apy_table

Example images generated by the bot

Challenges

Generating images programatically can be quite challenging, most of the tools and libraries available are not very flexible and definitely not as responsive as the web can be. That's why we decided to go the extra mile, create a frontend, launch a server locally and take screenshots of the tables and charts using headless chrome. This choice increased the dependencies the bot relies on, hence the needed of dockerizing it to make it robust and portable.

Architecture

The bot lives inside a docker image for portability and simplicity reasons. The container has all the required dependencies for the ./solend-apy-bot rust binary to run successfully, such as the static files for the frontend or headless chrome to take the screenshots. Once execution has finished, all the artifacts generated by the bot are thrown away. In order to save the data points needed to generate the weekly summary chart, a mongodb database is hosted outside of the docker container.

diagram

Future work

  • Retrieve other useful information such as TVL, total borrow and supply quantities, etc.
  • Eventually evolve into an interactive analytics website for Solend
  • Keep adding new tokens as soon as they are listed on solend.fi
  • Clean the code and make it bulletproof since some errors are currently not being handled

Feel free to submit any feature request you would like to see implemented


Installation

To get a local copy up and running follow these simple steps.

Prerequisites

Building

  1. Clone the repo
    git clone https://github.com/manugildev/solend-apy-bot.git
  2. Build docker image
    docker build -t solend-apy-bot:1.0 .

Usage

Once the docker image has been built, run it with the .env file.

docker run -it --env-file=.env solend-apy-bot:1.0 <args>

Possible arguments that you can pass when running the docker image:

FLAGS:
    -h, --help                Prints help information
    -s, --screenshot          Takes screenshot and saves it locally
    -c, --chart               Generates a chart and saves it locally
    -t, --twitter             Posts screenshot to Twitter
    --server                  Launches a local server for debugging purposes

OPTIONS:
    -d, --data 
   
        Saves data in database [default: MINUTE]
                              [possible values: MINUTE, HOUR, DAY, WEEK]

   

You can checkout how we are running the bot in our server using cron jobs

License

Distributed under the MIT License. See LICENSE for more information.

Acknowledgements


Made with 馃挏 by HyperManu

You might also like...
A Rust library for parsing the SOME/IP network protocol (without payload interpretation).

someip_parse A Rust library for parsing the SOME/IP network protocol (without payload interpretation). Usage Add the following to your Cargo.toml: [de

The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL.

Graph Node The Graph is a protocol for building decentralized applications (dApps) quickly on Ethereum and IPFS using GraphQL. Graph Node is an open s

Yet Another File Transfer Protocol.

yaftp Yet Another File Transfer Protocol. Build & Run $ cargo build --release Features C2C Lightweight Per something per session High performence Res

An End-to-End Privacy Computing Protocol on Layer 2

Eigen Network Eigen Network is an end-to-end privacy computation network for a better digital economy based on hybrid privacy computation protocols an

Shade Protocol is an array of connected privacy-preserving dApps built on Secret Network

Shade Protocol Core Contracts Contract Reference Description mint doc Handles asset burning and silk minting oracle doc Handles asset price queries tr

IDP2P is a peer-to-peer identity protocol which enables a controller to create, manage and share its own proofs as well as did documents
IDP2P is a peer-to-peer identity protocol which enables a controller to create, manage and share its own proofs as well as did documents

IDP2P Experimental, inspired by ipfs, did:peer and keri Background See also (related topics): Decentralized Identifiers (DIDs) Verifiable Credentials

Rustus - TUS protocol implementation in Rust.

Rustus Tus protocol implementation written in Rust. Features This implementation has several features to make usage as simple as possible. Rustus is r

Peer-to-peer communications library for Rust based on QUIC protocol

qp2p Crate Documentation MaidSafe website SAFE Dev Forum SAFE Network Forum Overview This library provides an API to simplify common tasks when creati

UDP proxy with Proxy Protocol and mmproxy support
UDP proxy with Proxy Protocol and mmproxy support

udppp UDP proxy with Proxy Protocol and mmproxy support. Features Async Support Proxy Protocol V2 SOCKET preserve client IP addresses in L7 proxies(mm

Owner
Manuel Gil
software engineer by day, software engineer by night
Manuel Gil
A minimalistic encryption protocol for rust async streams/packets, based on noise protocol and snow.

Snowstorm A minimalistic encryption protocol for rust async streams / packets, based on noise protocol and snow. Quickstart Snowstorm allows you to se

Black Binary 19 Nov 22, 2022
Jyoti - A simple IRC bot for use with shell scripts

Jyoti - A simple IRC bot for use with shell scripts Zero dependencies. Simple usage. Hackable. Usage The idea is that Jyoti can be repurposed easily w

Lee 15 Aug 13, 2022
A Matrix Server Stats bot

A bot running trough the matrix network to find all rooms.

Marcel 14 Dec 8, 2021
A Markov chain based Discord chat bot.

A Markov chain based Discord chat bot. Building It is recommended to use cargo.

Dominik Miedzi艅ski 1 Dec 26, 2021
Bot creating DNS-01 challenged certificates. This is useful for automating wildcard certificates.

ACME Client Automating DNS-01 Challenge for Alfahosting Domains This is an ACME (letsencrypt by default) client that performs DNS-01 proofs agains an

hardworking 4 Apr 11, 2024
Easy protocol definitions in Rust

protocol Documentation Easy protocol definitions in Rust. This crate adds a custom derive that can be added to types, allowing structured data to be s

Dylan McKay 157 Dec 30, 2022
A Constrained Application Protocol(CoAP) library implemented in Rust.

coap-rs A fast and stable Constrained Application Protocol(CoAP) library implemented in Rust. Features: CoAP core protocol RFC 7252 CoAP Observe optio

Covertness 170 Dec 19, 2022
馃ェ Savoury implementation of the QUIC transport protocol and HTTP/3

quiche is an implementation of the QUIC transport protocol and HTTP/3 as specified by the IETF. It provides a low level API for processing QUIC packet

Cloudflare 7.1k Jan 8, 2023
馃 brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers

brwrs is a new protocol running over TCP/IP that is intended to be a suitable candidate for terminal-only servers (plain text data). That is, although it can be accessed from a browser, brwrs will not correctly interpret the browser's GET request.

daCoUSB 3 Jul 30, 2021
A multi-protocol network relay

A multi-protocol network relay

zephyr 43 Dec 13, 2022