/staking

StakingRewards.sol allows users to deposit "userShares" of some asset and in turn receive SALT rewards for doing so. What the shares represent is dependent on the contract that derives from StakingRewards.

Regarding virtualRewards: the idea is that the ratio of totalRewards/totalShare before the user increases share needs to equal (totalRewards+virtualRewards)/(totalShare+shareIncrease).

Namely that the ratio of rewards to shares before and after needs to remain the same. It's akin to a liquidity pool where the two tokens are "rewards" and "shares". When a user want add shares they borrow the rewards needed to create the correct proportion of virtualRewards / addedShares.

When rewards are added, it increases the value of the shares, in terms of the rewards.

On claim, users pay back any "borrowed" rewards (the virtual rewards).

Staking.sol derives from StakingRewards and allows users to stake and unstake SALT. Staked SALT is deposited immediately for the user and grants them an equal amount of xSALT.

Unstaking xSALT requires a default unstaking period of one year. Expedited unstaking is possible with a penalty - with the fastest default unstaking period being two weeks with a default penalty of 80%. Intermediate unstaking period penalties are interpolated up to the one year no penalty maximum.

Liquidity.sol derives from StakingRewards and provides functionality for users to deposit liquidity into the liquidity pools and in turn receive SALT rewards for doing so. Liquidity deposited to the Pools.sol contract is owned by the Liquidity contract and withdrawals are done by the contract and then sent to the user.

Last updated