Skip to content

Stake LP

pSTAKE employs a unique mechanism named Stake LP to enable protocol’s users to use their staked representative tokens (stkTOKENs) in DeFi products, and to be able to retain the staking rewards on their underlying staked assets, all the while generating additional yields from the Defi protocols.

For the user to earn both staking rewards and additional Defi yields, she needs to use her stkTOKENs only on a whitelisted Defi pool, and stake the LP tokens received from the protocol back on the pSTAKE application.

Whitelisted Contracts

To enable pSTAKE stakers to generate a further yield from their stkTOKENs by using their tokens within various DeFi applications, the Deposit contracts (Pool Contracts) of the DeFi products need to be whitelisted in pStake. This will make sure that once you deposit the stkTOKENs (as liquidity provision or as swapping operation), the PoS reward pTOKENs are not locked inside these contracts.

Currently whitelisted pools are * stkATOM/ETH on Sushiswap

Holder Contract

The holder contract is instituted in pSTAKE to make the PoS rewards redeemable by the stakers, even after their stkTOKENs have been dispatched to various Defi protocol’s pool contracts. The contract primarily collects and distributes the staking rewards (pTOKENs) accrued on the staked assets supplied in any of the whitelisted Defi pools.

Screenshot 2021-09-20 at 5 31 45 PM

The reward calculation for the user has three key aspects which have been explained taking the example of a Sushiswap stkTOKEN-ETH pool.

Reserve Reward re-calculations

There are four key operations governing a Uniswap token-pool:

Screenshot 2021-09-20 at 5 32 48 PM

Since the stkTOKEN reserve balance is altered by all four operations, the Reserve reward re-calculation for the pool contract (complete stkTOKEN reserve balance) must happen for all four operations. This calculation is a function of three variables: * stkTOKEN reserve in pool contract * The time interval from turrent timestamp to the last re-calculation timestamp, and * Rate of interest as per the moving reward rate

Reserve Reward Re-Calculation = fn(SToken reserve balance, moving reward rate, Time since the last re-calculation)

These calculated rewards are not dispatched as pTOKENs to the pool contract itself but stored as a value in the Holder Contract.

LP-Time Share

The above-calculated pool of pTOKEN rewards now must be distributed among the liquidity providers. This depends on, not only the share of LP tokens that each liquidity provider holds but also the time duration for which those LP tokens were being held. These ‘Time-Shares’ are a function of the user’s share of LP tokens owned (percentage LP amount compared to total LP shares in supply), and the time interval for which that specific balance was held.

Reward Proportion for a User = fn(LP-Time-Shares of the user)

LP-Time-Shares of user = Time-Shares of Users LP Balance / Time-Shares of Total LP Supply

Time-Shares of User LP Balance = fn(LP Token Balance, Time since the last re-calculation of time-shares of User)

Time Shares of Total LP Supply = fn(LP Token Total Supply, Time since the last re-calculation of time-shares of LP Total Supply

The reward recalculation is triggered automatically whenever the LP Token Balance (and hence total supply within the deposit pool) is updated. These calculated proportional rewards are then dispatched as pTOKENs to all liquidity providers from the Holder Contract.

stkTOKEN transfer scenarios

This section highlights the 8 scenarios of stkTOKEN transfers, including both user-initiated and holder-logic based transfers. _calculateRewards function denotes the user-initiated reward calculation and _calculateHolderRewards denotes the holder logic-initiated reward calculation.

Scenario From To Logic for Scenario
Wallet Transfer User User _calculateRewards(from), _calculateRewards(to)
Add Liquidity, Swap STokens User Whitelisted contract _calculateRewards(from), _calculateHolderRewards(to, from)
Remove Liquidity, Swap Eth Whitelisted contract User _calculateHolderRewards(from, to), _calculateRewards(to)
Automated Pool Strategies Whitelisted contract Whitelisted contract _calculateHolderRewards(from, 0), _calculateHolderRewards(to, 0)
Burn STokens User address(0) _calculateRewards(from)
Burn Stokens by Pool address(0) Whitelisted contract _calculateHolderRewards(to, 0)
Mint STokens address(0) User _calculateRewards(to)
Mint Stokens by Pool Whitelisted Contract address(0) _calculateHolderRewards(from, 0)

The following architecture diagram summarizes the StakeLP feature:

image