Step-by-Step Guide: Optimize Yieldly (YLDY) rewards with yieldly-compounder

Jeremy Tong
6 min readNov 27, 2021

Yieldly.Finance allows you to stake YLDY tokens for various rewards, with generous APY. You can learn how to start yield farming on Yieldly in a few simple steps with my other guide here.

After staking your tokens, you might wonder what the best strategy is for claiming rewards. The general consensus is to claim and re-stake rewards between 4:30–4:52 UTC. Here’s a thread explaining why.

The following is a tutorial to set up a dedicated Ubuntu server on AWS (free-tier) to automate the re-staking process, so you won’t have to manually claim your rewards every night.

DISCLAIMERS:

  1. Crypto projects discussed here are in early stages. Yieldly has been audited, but nonetheless, there is a chance you will lose all your money.
  2. This information is purely educational and is not meant to be taken as investment advice or endorsement of any project. The strategies discussed are temporary at best and none of the outcomes are guaranteed. Please do your own research before making any decisions
  3. Yieldly-compounder relies on web-scraping methods to automate the claiming process. Supposing any of the underlying HTML attributes change, this most likely will just crash the process, but there is a change of negative adverse effects.

Prerequisites:

  1. You need an Algorand Wallet, it’s easiest to use the Official Algorand Wallet for this imo
  2. Set up yield farming in Yieldly.finance, any of the pools will work (e.g. ALGO lottery, or YLDY regular pools)
  3. A personal AWS account

Step 1: Set up yieldly-compounder on your local machine

You need to set it up locally first because this script relies on running a virtual browser (Chromium) which must first have cookie-based access to your Algorand Wallet. Once you’ve imported your wallet, that data will be stored in the directory under /user_data which can then be uploaded to the automated server in the next steps. It is “safe” so long as you do not share this folder or the settings.js file with anyone.

Follow the usage steps on the yieldly-compounder README.md for your local machine. This compounder relies on My Algo Wallet, a more advanced Algorand Wallet for Desktop, which is why I recommend using the Official Algorand Wallet and then importing it to the Chromium browser window.

If using the Official Algorand Wallet, import it into My Algo Wallet using your mnemonic phrase

I recommend running the service in debug mode after you’ve linked your wallet, so you can verify that everything works without accidentally claiming your rewards.

node index.js

The following should be logged.

YIELDLY AUTO COMPOUNDER v1.1.3 => [DEBUG] No transactions will be made!
Claimed NLL Assets: 0 YLDY
Claimed Pool Assets: 0 ALGO | 0 YLDY
Staked Amount: 0 YLDY

Step 2: Set up AWS

If you haven’t already, sign up for a personal account in AWS.

Once you’re signed in and on the AWS dashboard, go to the EC2 service to launch a new VM instance.

Click the orange “Launch instances” button. Select the Ubuntu server. In this tutorial, we’re using Ubuntu Server 20.04.

Select the t2.micro (always free) or t3.micro (initially free, but not forever) instance size, and complete the instance launch with default settings.

You can add Security Group settings to limit incoming requests to your server to certain IP addresses if you’d like added security.

Store your <username>.cer file on your machine. This will be used for all ssh and scp requests to follow.

Step 3: Install Required Packages on Ubuntu Instance

Select your instance and click connect.

Follow the instructions to connect via SSH-client.

ssh -i /Users/Me/Downloads/<username>.cer ubuntu@<instance-address>

Once successfully connected in an ssh session, install node via nvm version manager.

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash. ~/.nvm/nvm.shnvm install node

Additionally, we’re gonna need some packages to make Puppeteer work on Ubuntu, the core npm package that yieldly-compounder relies on.

From their README:

“I had to install a lot of dependencies on Ubuntu server to get puppeteer working, you might have to as well.”

The following should resolve issues with Ubuntu 20.04.

sudo apt update && sudo apt install -y gconf-service libgbm-dev libasound2 libatk1.0–0 libc6 libcairo2 libcups2 libdbus-1–3 libexpat1 libfontconfig1 libgcc1 libgconf-2–4 libgdk-pixbuf2.0–0 libglib2.0–0 libgtk-3–0 libnspr4 libpango-1.0–0 libpangocairo-1.0–0 libstdc++6 libx11–6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget

Step 4: Upload local yieldly-compounder folder to Ubuntu Server

First, compress your folder to a single file using the following command.

tar -czvf yieldly-compounder-zipped ./yieldly-compounder

Next, upload the compressed file to your Ubuntu instance.

scp -i /Users/Me/Downloads/<username>.cer -r ./yieldly-compounder-zipped ubuntu@<instance-address>:yieldly-compounder-zipped

Step 5: Unzip folder on Ubuntu Server, verify functionality

In your ssh session, unzip the newly uploaded file and navigate to the folder.

tar -zxvf yieldly-compounder-zipped
cd yieldly-compounder

Using the terminal editor, alter the settings.js so that you’re back in debug and headless mode.

Verify functionality on Ubuntu server. There shouldn’t be any errors.

node index.js

The following should be logged.

YIELDLY AUTO COMPOUNDER v1.1.3 => [DEBUG] No transactions will be made!
Claimed NLL Assets: 0 YLDY
Claimed Pool Assets: 0 ALGO | 0 YLDY
Staked Amount: 0 YLDY

You can then turn off debug mode so that the claims will actually occur.

Step 6: Set up Cronjob to run at 4:45 UTC everyday

crontab -e

Add the following line to the bottom of the file, substituting the node version .

45 4 * * * cd /home/ubuntu/yieldly-compounder && /home/ubuntu/.nvm/versions/node/<node-version>/bin/node /home/ubuntu/yieldly-compounder/index.js

To get the node version, you can run

node -v

Save the file and you’re all set. At that time each day, your claims script will run and optimize Yieldly rewards!

Bonus: Set up Telegram for Notifications

You can also set up notifications to be sent automatically to your phone when the claims script runs.

Install and sign up for Telegram on your phone.

Once installed, go to BotFather. Message /start and /newbot, then follow the instructions until you are given the API token.

It should look something like: 123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11

Next, go to get id bot. Message /start to get your own chat id.

It should look something like: 2110302939

Add these to settings.js on your Ubuntu server’s yieldly-compounder.

Finally, in the newly created bot, message /start to activate it. It should broadcast the same messages that your console shows in the Ubuntu server. At 4:45 UTC each day, you’ll receive a notification letting you know the claims update.

You can verify this if you’d like by again turning debug mode on and running the script.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

Jeremy Tong
Jeremy Tong

Written by Jeremy Tong

Startup-Focused Software Developer

No responses yet

Write a response