Skip to content

Farming

Jacob Pretorius edited this page May 8, 2023 · 9 revisions

With the release of v1.4.0 the bot now supports a simple version of "farming".

image

How It Works

Farming makes it possible for users to "earn" a token or get rewarded by a mechanism of your choice. For this guide (and in code) we call this reward $TOKEN - it can be configured to be called something else in the src/settings.ts file.

In the settings file you can configure how much a user "earns" based on their holdings in their linked wallet(s).

The period to complete farming is set to 1 week (168 hours) by default. Users get credited for every hour they "farm" only if they have enough holdings/points in their wallets for that hour.

If their holdings/points drops below the required value their farming pauses automatically until they increase their holdings again in the future; then progress restores form where it was.

You can customise how much $TOKEN a user earns based on their holdings. By default the following three example levels are configured in the settings file

USER HOLDINGS/POINT : $TOKEN THEY EARN

1 -> 0.1 $TOKEN

5 -> 1 $TOKEN

15 -> 5 $TOKEN

Users can only have one farming timer active at a time. They automatically farm for the highest "level" they qualify based on their holdings. When the timer completes they can start another.

User Commands

Start Farming

Users need to DM the bot "Start farming" to start their farming. The bot automatically picks the "highest" tier for them to farm, so they get the highest possible rewards.

image

Check farming

Users can check their progress for the active farming timer.

image

Stop Farming

If a user wants to stop their farming timer, perhaps to move to a higher or lower tier, they can delete their active/paused session and start again. No progress is kept.

image

Payout

Payout is not automatic. When a users farming timer completes, a message is posted to a Discord channel as defined in src/settings.ts for your mods/admins to action.

image

The user is also sent a direct message.

image

Installation

Make sure to follow the installation and/or upgrade steps. Specifically ensure the CRON task runner endpoint for farming is added. See https://github.com/jacobpretorius/XRPL-Discord-Bot/wiki/Installation-Instructions#automated-task-runners

Need Something Else?

Much more can be done with this, but it quickly gets very project specific so the initial feature is as broad and universal as possible while allowing full flexibility for projects that want to customise their version.

Clone this wiki locally