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 basic version of "farming".

How It Works

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

In the settings file you can also configure how much users "earn" based on their holdings.

The period to complete farming is set to 1 week (168 hours) by default. Users get credited for every hour they complete 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 where it was.

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

USER HOLDINGS/POINT : $TOKEN THEY EARN

1 -> 0.1 $TOKEN

5 -> 1 $TOKEN

15 -> 5 $TOKEN

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

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