Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ETP6: Drop Farms #7

Open
svanurin opened this issue Jul 15, 2021 · 0 comments
Open

ETP6: Drop Farms #7

svanurin opened this issue Jul 15, 2021 · 0 comments

Comments

@svanurin
Copy link
Member

On drop farms

Metadata

  • Status: draft
  • Date: 2021 Apr
  • Author: Zhidanov

Summary

The document describes drop farms functioning.

Key Points

Drop farm is a mechanic for distributing tokens as a reward for a stake. In general there are two tokens involved: token distributed as rewards and token to be staked to pretend for rewards. In a particular case both functions can be fulfilled by the same asset. There is one creator of a farm. Creator determines assets involved in a farm and deposits full amount of tokens for distribution. There are multiple stakers (farmers). Each farmer can stake arbitrary amount of staked token. Drop farms are interacted with by calling corresponding smart contracts.

Asset Management

To manage assets, the user must send a transaction with the necessary parameters to genesis address.

Create a drop farm (farm_create)

Parameters:

  • stake_token — hash of a token that should be staked for incoming rewards;
  • reward_token — hash of a token to be distributed as a reward;
  • block_reward — amount of a reward token distributed each block (entered as integer units: human-readable amount multiplied by decimals power of ten);
  • emission — amount of a reward token to be distributed during the hole drop farm lifetime which is not less than (emission/block_reward) blocks. "Not less" covers no rewards in case of no stake at the drop farm.

Transaction with a farm_create call to be rejected if:

  • sender has stake_token balance less than emission parameter.

Stake (farm_increase_stake)

Parameters:

  • farm_id — hash of a transaction with the create_farm contract call;
  • amount — amount of a stake token to be locked from the sender balance as a drop farm stake (entered as integer units: human-readable amount multiplied by decimals power of ten);

Transaction with a farm_increase_stake call to be rejected if:

  • the sender has stake_token balance less than the amount parameter;
  • no farm with the farm_id specified.

Unstake (farm_decrease_stake)

Parameters:

  • farm_id — hash of a transaction with the create_farm contract call;
  • amount — amount of a stake token to be unlocked from the sender farm stake balance (entered as integer units: human-readable amount multiplied by decimals power of ten);

Transaction with a farm_decrease_stake call to be rejected if:

  • no farm with the farm_id specified;
  • the sender has stake_token staked amount at the farm less than the amount parameter.

Unstake and receive rewards (farm_close_stake)

Parameters:

  • farm_id — hash of a transaction with the create_farm contract call.

Transaction with a farm_close_stake call to be rejected if:

  • no farm with the farm_id specified.

Harvest reward (farm_get_reward)

Parameters:

  • farm_id — hash of a transaction with the create_farm contract call.

Transaction with a farm_get_reward call to be rejected if:

  • no farm with the farm_id specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant