Self-Service Farming
Add the farming feature to your pool and reward LPs with an additional yield!
Last updated
Add the farming feature to your pool and reward LPs with an additional yield!
Last updated
You can only add farming to liquidity pools that you have created via the ALEX Self-Service Listing. If you don't have your own pool yet and want to create one, check the page to find out how.
The pool owner creates the farm by specifying the number of cycles and depositing the total reward amount. These two inputs determine the rewards distributed per cycle, which are equal for each cycle.
The pool's liquidity providers stake their LP tokens in the newly created farm, earning rewards at the end of each cycle, just like any other farm within the ALEX Lab Platform.
For further details on how farms operate within ALEX, refer to the section of the docs.
Before you start, familiarize yourself with the basic rules of Self-Service Farming.
Only the pool creator can use Self-Service Farming to add farming to their pool.
When creating a liquidity pool, an anchor token (Token X) and a listing token (Token Y) are defined. Self-Service Farming only allows the listing token to be used as the farming reward.
The total amount of rewards for the entire farm lifecycle must be deposited at the time of farm creation.
A "gathering" period occurs between the creation of the farm and the start of the first emission cycle. Farmers who stake their LP tokens during this period will be eligible to receive the farming rewards associated with the first emission cycle.
In this guide we are assuming that you already have a pool, so select the Creating a new farm
option and click Continue
.
Select a pool from the ones you've created.
Enter the total amount of rewards that will be distributed in your farm. This amount is deposited at farm creation. Also, remember that in Self-Service Farming, the reward token has to be the same as the listing token.
Select the Reward Cycle Length, which is the number of cycles in which your farm will be active and distributing rewards. This number, along with the total farming rewards, determines the Est. Farming Rewards Per Cycle.
At this point, you will also be able to see the number of the cycles in which your farm will be officially open, displayed as Farm Opening Cycle. The farm will be created instantly once the farm creation transaction is confirmed. However, the Emission Start Cycle will be the next upcoming cycle.
The time gap between the farm creation and the start of the first emission cycle is the so-called "gathering" period, during which users can begin staking their LP tokens in the farm.
Caution: To maximize the gathering period, it is advisable to create your farm at the start of a new farming cycle.
From the screenshot above, the Total Farming Rewards is 15,000 DOGGY
, and Reward Cycle Length is 10
, meaning that 15,000 DOGGY / 10 = 1,500 DOGGY
will be the Farming Rewards Per Cycle.
If the user submits, the farm will be created at Cycle #80, leaving 33 blocks for the gathering period (approximately 5 hours and 29 minutes). In these cases, it is recommended to wait for the next cycle, as indicated in the alert box. This prevents LP tokens from being committed to the farm too late for the next reward distribution cycle.
If the user decides to proceed, the Farm Opening Cycle will run from Cycle #81 to Cycle #90, lasting approximately 35 days.
Once you're ready to move ahead, select the Submit Rewards
button which will bring up the Confirmation panel. This panel provides a final overview of the farm creation, allowing you to double-check the total rewards and the farm opening period. If everything looks good, click Confirm
😎.
After clicking Confirm
, you will need to confirm the transaction in your wallet. Here, your Stacks wallet is interacting with the ALEX smart contract and is asking you for approval. Remember, in this farm creation transaction, you are transferring the total amount of rewards to the ALEX smart contract.
Scroll through the wallet transaction window, review it and confirm the transaction. By doing this, you are allowing the wallet to sign and broadcast the transaction.
It may take up to 20–40 minutes for changes to be visible on ALEX and in your wallet.
Thanks for launching your farm through ALEX Lab! 🌽 🌾 🚜
Go to the and click on the Create
button.
The transfer amount, covered by . Note that the amount you transfer to the smart contract is exactly determined (DOGGY in the example). If this condition is not met, the transaction will abort.
Search for the transaction on the .
Once the transaction is completed, your farm will have been successfully created. Your farm will appear on the page and from that moment is open to the first farmers who want to join during the gathering period.
For assistance, please reach out to our Community Managers on and .