Staking and Rewards

The staking system is where anyone who adds liquidity to MaltSwap can get their share of the protocol's cashflow.

High-level overview

The protocol profits from various sources such as fees, arbitrage, seigniorage, and swing trading. The profit made varies over time - it can be plentiful at some points and scarce at others. The Malt staking system aims to smooth out these fluctuations by finding a target APR that is sustainable and allows using profit from the good times to pay out during the bad times. Over time as protocol cashflow ebbs and flows the target APRs can adjust dynamically to provide market driven APRs.

Some more details

The staking system is made up of two core contracts:

  • The reward throttle

  • The staking contract

The reward throttle is in charge of managing the APR paid for each pool. It decides on a target APR for the pool based on historical cashflows.

When the reward throttle receives capital from the profit distributor it has to make a choice:

  • Current APR paid to staked users is below the desired target APR? Send profit to staking contract

  • Current APR paid to staked users is at or above the desired target APR? Send profit to the reward overflow. This will be used to make up the difference in the future when the APR is below the target.

The APR is updated every 6 hours. If at the end of a given 6 hour period, the cashflow for that period does not equate to the desired APR then capital will be pulled from the reward overflow to make up the difference if possible.

Target APR

The target APR is set per pool on the reward throttle contract. It is then updated according to a proportional control system that attempts to find an APR that it can sustainably pay while still growing its runway.

The way it achieves this is by monitoring the implied APR from all of its cashflow for a given pool against the total staked value for that pool. The contract tracks a moving average of this APR. The goal is to set the target APR to actually pay LPs at half of this full "cashflow APR". This gives us a 50% buffer for fluctuation in the real cashflow over the coming periods and still be able to pay that target APR. This makes the APR much more sustainable. It also allows us to be growing the runway any time the APR is above that target. Because we have the target at half the moving average of the real cashflow, it is very likely that the next period will also be above that target - hence growing the runway. This runway then allows us to sustain the APR even over periods of very low (or zero) cashflow.

The target APR is updated every 6 hours. The algorithm to decide how to update the target APR is as follows:

  1. Is real cashflow APR higher than 2x the target APR?

    • Move the target APR up

  2. Is the real cashflow APR below the target user APR?

    • Move the target APR down

  3. Otherwise, leave it unchanged.

The amount the APR is adjusted by is proportional to how far above/below the real cashflow was compared to the target, with a max adjustment capping how large that adjustment can be. At the time of writing the max adjustment is 0.1% every 6 hours.

Last updated