🔓Hardstake and Hardlock
For the first time, users can lock/burn their liquidity and still earn rewards. Stakers receive payouts in ETH, not tokens, eliminating unnecessary selling pressure and inflation.
Introduction
To safely manage LPs and prevent exploits within the Euler model, the Ethervista Router introduces three key functions: updateSelf
, safeTransferLp
, and hardstake
.
safeTransferLp
This function ensures secure transfer of LP tokens:
Updates the
msg.sender
's provider struct in the pair contract when transferring LP tokensPrevents liquidity providers from manipulating their reward share through balance duplication
Requires all LP transfers to go through the router
hardstake
Enables staking/locking of any ERC20 and LP tokens in compliance with the Euler model:
Process:
Transfers tokens to a contract implementing the external function:
Verifies if the token is a VISTA-LP token
If verification passes, updates the
msg.sender
's provider struct to reflect reduced balance and shareCalls the contract's custom stake implementation
Important Notes:
stake
ensures consistency between tokens/amounts passed to the external stake function and those transferred by thehardstake
functionDevelopers must restrict stake calls to this router for guaranteed token receipt verification (router is a variable stored in the factory's contract)
Receivers (users/contracts) must call
updateSelf(address _pair)
to begin accruing rewards for received LP-tokensThis can be done directly inside the
stake
implementation
Liquidity staking contracts must accurately allocate and distribute rewards to stakers based on their contributions
Staking/locking contracts can use the Euler model to distribute rewards in paid in ETH. For example, Ethervista leverages the protocol fee alongside the Euler model to reward $VISTA stakers based on their share of the total staked amount. It also rewards liquidity providers who lock their liquidity for at least two weeks, ensuring more stable liquidity pools
Templates
We provide two templates for staking:
Standard ERC-20 tokens (Hardstake). This template allows users to stake their tokens and earn ETH rewards from the protocol fee or other ETH contribution using the Euler model
LP tokens (Hardlock) : This is a specialized case of Hardstake for LP tokens that ensures proper allocation and distribution of rewards to liquidity stakers based on their contributions to the pair contract. This contract maintains its own Euler sequence, which is based on the liquidity fees accrued by the pair contract
Note: In these template contracts, staking or unstaking actions will reset the lock time. Additionally, staking or unstaking will reset the rewards balance to zero. Therefore, users are advised to claim any accumulated rewards before performing these actions to avoid losing unclaimed earnings.
Last updated