Terra rust bot

Overview

terra-rust-bot

⚠️ You will need to provide your seed phrase to let the bot create and sign transactions.

⚠️ Terra-rust-bot will not save your seed phrase, make sure you do not lose it. Make sure you clear your copy/paste clipboard.

➡️ Terra-rust-bot can be used without a seed phrase, view only mode. It is recommended to test this first ⬅️

➡️ It is always a good idea to use a dedicated wallet. ⬅️

⚠️ No security audit has been performed.

Why

  • Rust is a great programming language.
  • Keep It Simple, Stupid.
  • Power to the people.
  • Reducing transaction fees to a minimum.
  • Easy to use. One executable.

What

Anchor Auto Stake Rewards

Anchor Auto Loan Repay

Anchor Auto Borrow

Anchor Auto Replenish (not yet implemented)

Anchor Auto Exchange Rewards (not yet implemented)

Anchor aUST <--> bLuna Strategy (not yet implemented)

Anchor Auto Bid (in consideration)

Market Dashboard

Anchor Dashboard

How

  • Sensitive information is gathered at runtime via user input. This avoids storing sensitive information within config files.
  • The seed phrase is stored safely in memory with secstr.
  • Requests are either made directly to the Terra FCD or LCD. For that terra-rust-bot mainly relies on the Terra-Rust-API. In some cases api.anchorprotocol.com is used.
  • The Anchor Web App or AnchorHODL have rather high gas fees hard coded into the application. This ensures each transaction goes through, but this also means some money is unnecessarily being spent. Looking at past transactions terra-rust-bot estimates a reasonable transaction fee. In particually by calculating a decent gas adjustment derived from past transactions. To not stale a transaction the user provides a maximum transaction fee. For each transaction the fees are simulated and double checked with the set maximum transaction fee. This way there are no static fees.
  • If possible transactions are grouped together, to further reduce the gas fees.
  • The configuration can be customized via the terra-rust-bot.json file. It will be loaded at startup.
  • The current state is written to terra-rust-bot-display.txt instead of the console.

Disclaimer

This may steal your money. Do your own research. Take a look at the code.

Manual - Just Read The Instructions

Run terra-rust-bot

Configue terra-rust-bot.json

⚠️ If this file does not exist hard coded values from the terra-rust-bot implementation are used.

➡️ This file needs to be in the working directory, from where you execute the command to run terra-rust-bot.

  • trigger_percentage: at which point you want to repay (1 equals a LTV of 60%).
  • borrow_percentage: at which point you want to borrow (1 equals a LTV of 60%).
  • target_percentage: the LTV do you want to maintain (1 equals a LTV of 60%).
  • max_tx_fee: the maximum UST amount you want to spend per transaction per fee.
  • max_gas_adjustment: the maximum gas_adjustment you are willing to use.
  • gas_adjustment_preference: has an influence on the gas_adjustment you end up with.
  • min_ust_balance: the minimum UST balance, if below this value no further transactions will be made.
  • wallet_acc_address: if empty you may be asked at runtime to provide a wallet address.

Provide command line arguments and run

Command line args

  • -i show info dashboards: market or anchor.
  • -a show account dashboards: anchor_account.
  • -b enable bot: anchor_auto_stake, anchor_auto_borrow or anchor_auto_repay.
  • -d enable additional development/debugging output. Currently test and dev are available. test will only simulate or estimate transaction fees. dev will output additional information to show what is happening in the background.

Examples

  • ./terra-rust-bot -b anchor_auto_stake -d test dev (read only, remove test to let the bot sign transactions)

  • ./terra-rust-bot -b anchor_auto_repay -d test dev

  • ./terra-rust-bot -b anchor_auto_borrow -d test dev

  • ./terra-rust-bot -b anchor_auto_stake anchor_auto_repay anchor_auto_borrow -d test dev

  • ./terra-rust-bot -i market (market information)

  • ./terra-rust-bot -i anchor (anchor information)

  • ./terra-rust-bot -i anchor -a anchor_account (for account specific information)

View the current state

  • while sleep 0.1; do cat terra-rust-bot-display.txt; done

Build it yourself

Tested on Linux, if you have issues on macOS or Windows please let me know.

Install Rust

  • Get started here.
  • On Linux: Download the file with curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs -o rust.sh, view it: less ./rust.sh, and run the script ./rust.sh to start rustup installation. The script makes PATH changes only to login shell configuration files. You need to source ~/.cargo/env until you logout and login back into the system. To update rustup afterwards, run rustup self update.

Clone the repository

  • git clone https://github.com/Philipp-Sc/terra-rust-bot.git

  • cd terra-rust-bot

Build

  • cargo build (fast build)
  • cargo build --release (optimized build)
  • RUSTFLAGS="-C target-cpu=native" cargo build --release (optimize the build for your CPU)

Run

  • ./target/debug/terra-rust-bot or

  • ./target/release/terra-rust-bot

  • Command line arguments are discribed in the text above.

Similar projects

You might also like...
🦜 A hassle-free, highly performant, host it yourself Discord music bot built with Serenity in Rust. Powered by youtube-dl and Genius.

🦜 A hassle-free, highly performant and fast evolving Discord music bot built with Serenity in Rust. Deployment Usage Just create a bot account, copy

Telegram bot for searching in Arch User Repository ( AUR ); Implemented using rust.

AurSearchBot A Telegram Inline Search Bot Written in Rust Introduction Telegram Bot that can search AUR ( Arch User Repository ) in inline mode. This

A discord bot that safely executes whatever rust you throw at it. Remote code execution as a service
A discord bot that safely executes whatever rust you throw at it. Remote code execution as a service

RustBot Bot is still under development and not ready for production use RustBot is a discord bot that executes whatever rust code you throw at it. In

This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity.
This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity.

bottom-bot This is a Discord bot written in Rust to translate to and from the Bottom Encoding Standard using bottom-rs and Serenity. Ever had this pro

Chains - a bot written in Rust using the serenity crate

Chains (Rusty) Chains is a bot written in Rust using the serenity crate. Chains primarily focuses on easy to set up, easy to use moderation tools such

A trading bot written in Rust based on the orderbook delta volume.

The strategy based on the concept of mean reversion. We look for large deviations in the volume delta of BTC-PERP on FTX at a depth of 1. These deviations could be caused by over-enthusiastic and over-leveraged market participants.

Autogenerated wrapper for the Telegram Bot API written in Rust.
Autogenerated wrapper for the Telegram Bot API written in Rust.

An Elegant Rust Client for Telegram Bot API crates.io • docs.rs Table of contents Introduction Key Features Installation Getting Started Documentation

A simple Telegram bot that eats anonymous channel messages, written in Rust.

tgbot-nochanmsg By Asuna Right Control When creating your bot from botfather, it's not bad to disable privacy mode, because it needs to access the mes

A multipurpose (including music) Discord bot written in Rust

filloabot-rs A multipurpose (including music) Discord bot. This is a full rewrite using Rust of the original FilloaBot. Some features that were consid

Comments
  • Feature Request Optimal Compounding & LP

    Feature Request Optimal Compounding & LP

    Have the bot only stake ANC for optimal compounding factoring gas fee's Have an option for the bot to stake LP of ANC with optimal compounding factoring gas fee's

    enhancement 
    opened by PowerPress 14
Owner
Philipp
Philipp
Matrix bot inspired by Shirt Bot.

matrix-openai-bot Matrix bot inspired by Shirt Bot. Usage Run the bot after building it or grabbing the latest release $ matrix-openai-bot Edit the ge

null 5 Oct 26, 2021
Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers.

Arcadia Rewrite of the Discord Bot used for Managing the Infinity Bot List Servers. Contributing Always run fmt.sh before making a Pull Request! MacOS

InfinityBotList 3 Dec 15, 2022
Showing how to deploy a Terra smart contract using Chainlink Data Feeds

Chainlink Terra Developing Requirements This demo requires the following components: Rust: rustup with cargo 1.44.1+. rustc and cargo 1.44.1+. Install

SmartContract 6 Aug 22, 2022
Terra development suite

rover Terra development suite Planned features Usage Commands Planned features Includes a starter smart contract, can be cw-template or similar. Has a

Jason Stallings 3 Nov 9, 2021
Telegram bot help you to run Rust code in Telegram via Rust playground

RPG_BOT (Rust Playground Bot) Telegram bot help you to run Rust code in Telegram via Rust playground Bot interface The bot supports 3 straightforward

TheAwiteb 8 Dec 6, 2022
A Simple, But amazing telegram bot, Made using the Rust language!

Telegram bot in Rust A fun Telegram bot made using Rust language.

Deep Alchemy 2 Dec 21, 2021
This is a Telegram bot I'm working on in my free time to learn Rust.

Maldness Bot This is a Telegram bot I'm working on in my free time to learn Rust. Building docker build -t . should be enough.

Sergey Kislyakov 10 May 13, 2022
Rust telegram bot library for many runtimes

Telbot Telbot provides telegram bot types and api wrappers. Specifically, telbot now supports: telbot-types: basic telegram types / requests / respons

kiwiyou 17 Dec 3, 2022
Music bot written in Rust

Akasuki What is Akasuki? Akasuki is a simple discord music bot written in rust. Highlights Select your music using discord's new select menu feature,

Forbidden A 0 Dec 19, 2021
A Discord bot for sending GeoGuessr challenge links that uses the GeoGuessr API written in rust.

GeoGuessr-bot-rs This is a simple implementation of a discord bot that send GeoGuessr-challenge links on demand. Features: Slash-commands Lightning-fa

Luukas Pörtfors 6 Nov 18, 2022