Staking
If you are a user and want to know how to stake in a token farm, this is the page for you. Note that this page explains some technical stuff about how the contract works. You won't need to worry about most of these details if you are using our front end when you stake.
Please be aware that third-party token contracts are out of our control. A contract owner can adjust balances at their will, or add additional logic that breaks the rules of standard token contracts. Due to these potential issues, we can not guarantee that a farm will always behave as expected. For example, if your token is a tax token that takes a fee on every transfer, our contract may end up with a lower balance than anticipated, resulting in users not getting the proper rewards. We accept no responsibility for issues like this. Please be aware of which tokens you are interacting with, and notify farm owners about potential issues - especially if they have a taxable token.
stake Action
Before you can transfer tokens into a farm and stake them, you first need to make sure you have a row open for that farm. You can do this by calling the stake
action, which takes in the following details.
user
name
The WAX address of the user who wants to stake
farm_name
name
The name of the farm they want to stake tokens into
Depositing Tokens To Stake
After a user has called the stake
action, they can now deposit their tokens. This can be done by sending the staking tokens to tf.waxdao
with the following memo:
|stake|<farm_name>|
For example:
|stake|mynewfarm|
It is worth noting that every time a new deposit is made, it will reset the lock period for your full balance in this farm. This only applies if the farm creator has set a vesting_time
> 0
for their farm, which can be determined by looking at the farms
table on the tf.waxdao
contract.
Ideally, front ends should also be displaying the lock time to users so they can have the full picture before making the decision to stake.
Claiming Rewards
Rewards from a farm are paid out every second. Technically, you could claim rewards every second if you wanted to (as long as you have rewards to claim). In order to claim rewards, you need to call the getreward
action on the contract.
The getreward
action takes in the following details.
user
name
Your WAX address that you are staking from
farm_name
name
The name of the farm you want to claim rewards from
Unstaking
If you want to unstake your tokens from a farm, you can call the unstake
action on the contract. Note that the current time must be > your vesting_end_time
in order to unstake.
The unstake
action takes in the following details.
user
name
Your WAX address
farm_name
name
The name of the farm to unstake from
amount
asset
The amount of tokens you want to unstake from the farm
Last updated