Supplying ETH (fixed duration)
Provisioning Pool (PP) Contract
Unless otherwise indicated, the PP contract only deals with ERC-20s. Currently, we support WETH only.
Stake WETH
Users can stake WETH to share the protocol’s earnings when profits are made from transaction fees and auctions. However, users cannot withdraw this deposit until the lockup period has passed. They may suffer from losses if there were defaulted positions liquidated at losses.
After staking WETH, users receive ERC-721s that denotes the following stake data:
struct StakeData {
// @notice The time when the staking expires
uint256 expireTime;
// @notice The amount of underlying token staked
uint256 stakedUnderlying;
// @notice The virtual amount that keeps tracks the proportional underlying token share of this staking unit
uint256 virtualBalance;
// @notice The duration of this staking unit
uint256 duration;
}To stake WETH, users have to specify a lock duration and amount:
// @notice This function allows a user to stake 'amount' of underlying token for 'time' duration
// @param amount The amount of underlying token to be staked
// @param time The duration of the staking unit
// @return The provisioningPool Nft tokenId minted
function stake(uint256 amount, uint256 duration) external override nonReentrant returns (uint256) Unstake WETH
After the lockup period, users can unstake WETH and earn the accumulated protocol fee and auction profits. The total redeemable from a PP ERC-721 is calculated by:
To obtain the exchange rate:
To unstake:
Helper functions
The following functions are helpful in getting the maximum redeemable WETH after lockups.
Last updated