DAO Staking Rewards - DA0-DA0/dao-contracts GitHub Wiki

Staking rewards are a way to gradually distribute tokens to DAO members proportional to the number of tokens they have staked. A legitimate use case for staking rewards is to encourage the "locking up" of a token, which may reduce its circulating supply.

I encourage anyone considering using staking rewards for that purpose read the linked paper, then, consider the price of the token who's staking rewards system it describes.

Staking rewards alone do not make a high value token.

How to add staking rewards to a DAO DAO DAO

There are three smart contracts which coordinate rewards and staking.

  1. stake-cw20 - The smart contract that holds staked governance tokens and updates staked balances. stake-cw20 contract is instantiated during a token-based DAO creation.
  2. stake-cw20-rewards-distributor - A contract for distributing the native governance token as staking rewards. Requires interaction with stake-cw20.
  3. stake-cw20-external-rewards - A contract for distributing any non governance token as staking rewards. Requires interaction with stake-cw20.

Depending on how you'd like to configure your DAO, you can instantiate stake-cw20-rewards-distributor contract or stake-cw20-external-rewards contract or both.

For example, if you are distributing $JUNO as staking rewards and have a governance token called $ONUJ you'll instantiate stake-cw20-external-rewards contract. If you wanted to distribute $ONUJ as staking rewards you'll instantiate stake-cw20-rewards-distributor contract. If you instead want to distribute both $JUNO and $ONUJ as staking rewards, you'll instantiate both stake-cw20-external-rewards and stake-cw20-rewards-distributor

Governance token as staking rewards

When you stake tokens in stake-cw20, you get a percentage ownership of all of the tokens in that contract. When rewards are added your percentage ownership stays the same, but the absolute number of tokens available to you increases.

The Fund {} message adds rewards to a stake-cw20 contract.

Rewards over time

The stake-cw20-rewards-distributor contract can help in providing rewards at a constant rate. In effect it automates the calling of Fund {} with an amount of tokens that brings the total rewards up to the target rewards. To bring the number of tokens distributed up to the target rate, one may executed Distribute {} on the contract.

There are two important things to keep in mind here:

  1. The Distribute {} method must be called periodically for rewards to be distributed. Calling distribute is permissionless, so this could be done as cron job or as a button visitors to a website may press to distribute rewards.
  2. The rewards distributor must be funded with as many tokens as you would like to distribute. There is no special message needed for this and the contract can be funded by sending tokens to it.

The reward rate in the distributor contract is set by the reward_rate field in its instantiate and config update messages. reward_rate has a unit of micro tokens per block (i.e. not considering the token decimals). For example, if one was distributing $JUNO, the reward rate would be specified as $uJUNO per block (1 $uJUNO == $10^{-6}$ $JUNO).

This contract is not supported by the DAO DAO UI, though as staked balances are auto-compounding if a rewards contract is present DAO members will see their staked token balances increase over time in the UI.

External (non-governance) token as staking rewards

To provide staking rewards to stakers in a stake-cw20 contract in terms of a token that is different from the one being staked, we turn to stake-cw20-external-rewards.

To configure this contract, instantiate it and set it as a stake-cw20 hook receiver via the AddHook { addr } message on that contract. To fund this contract, execute a Fund {} message. To claim rewards, execute a Claim {} message. Claiming can not be done until the contract has been funded and added as a hook receiver.

At the time of writing this contract has no support in the DAO DAO UI. DAOs looking to add external rewards to their DAO will need to implement their own interface for claiming rewards.