Vesper Documentation
  • Introduction
  • Vesper Features
  • Vesper Participants
  • Vesper Pools and Strategies
    • Vesper's Modular Pool Architecture
    • Multi-Chain and Cross-Chain Deployments
    • Overview of Vesper Pools
      • Vesper Grow Pools
    • Overview of Vesper Strategies
      • Maker-to-Platform Strategy
      • Direct-to-Lending-Platform
    • Discussion of Risk
  • VSP Economics
    • VSP Token: Supply, Issuance, & Rewards
    • Governance
      • Introduction
      • Locking
      • Unlocking
    • Revenue Model
  • Community Participation
    • Decentralization Plan
    • The Voting Process
    • Governance Principles
  • Vesper Developers
    • Vesper Developer's Guide
      • Introduction
      • Vesper Framework Levels
      • Overview of Flow Control
    • Vesper Pool Metadata
    • Pool and Strategy Creation and Deployment
    • Vesper Contracts API Reference
      • Pool Contracts
        • PoolAccountant
        • PoolAccountantStorage
        • PoolRewards
        • PoolRewardsStorage
        • PoolStorage
        • VETH
        • VPOOL
        • VesperEarnDrip
      • Strategy Contracts
        • Earn
        • Strategy
        • VesperStrategy
        • EarnVesperStrategy
        • EarnVesperStrategyVSPDrip
    • JavaScript Library
    • Contracts Data
    • Vesper Improvement Proposal Template
  • Marketing
    • Brand Guidelines & Assets
  • Reports
    • Quarterly Reports
    • Smart Contract Audits
  • FAQ
  • Glossary of Terms
Powered by GitBook
On this page
  • PoolRewards
  • VERSION
  • initialize
  • notifyRewardAmount
  • notifyRewardAmount
  • addRewardToken
  • claimReward
  • updateReward
  • claimable
  • getRewardTokens
  • lastTimeRewardApplicable
  • rewardForDuration

Was this helpful?

Export as PDF
  1. Vesper Developers
  2. Vesper Contracts API Reference
  3. Pool Contracts

PoolRewards

PoolRewards

Distributes VSP rewards based on the user's Vesper pool balance and the supply of rewards available to that pool.

VERSION

string VERSION

initialize

function initialize(address _pool, address[] _rewardTokens) public

Called by proxy to initialize this contract.

Name
Type
Description

_pool

address

Vesper pool address

_rewardTokens

address[]

Array of reward token addresses

notifyRewardAmount

function notifyRewardAmount(address[] _rewardTokens, uint256[] _rewardAmounts, uint256[] _rewardDurations) external virtual

Notify that reward is added. Only authorized caller can call this function.

Also updates reward rate and reward earning period.

Name
Type
Description

_rewardTokens

address[]

Tokens being rewarded

_rewardAmounts

uint256[]

Rewards amount for token on same index in rewardTokens array

_rewardDurations

uint256[]

Duration for which reward will be distributed

notifyRewardAmount

function notifyRewardAmount(address _rewardToken, uint256 _rewardAmount, uint256 _rewardDuration) external virtual

addRewardToken

function addRewardToken(address _newRewardToken) external

Add new reward token in existing rewardsToken array

claimReward

function claimReward(address _account) external virtual

Claim earned rewards.

This function claims rewards for all tokens being rewarded

updateReward

function updateReward(address _account) external

Updated reward for given account.

claimable

function claimable(address _account) external view virtual returns (address[] _rewardTokens, uint256[] _claimableAmounts)

Returns claimable reward amount.

Name
Type
Description

_rewardTokens

address[]

Array of tokens being rewarded

_claimableAmounts

uint256[]

Array of claimable for token on same index in rewardTokens

getRewardTokens

function getRewardTokens() external view returns (address[])

Provides easy access to all rewardTokens

lastTimeRewardApplicable

function lastTimeRewardApplicable(address _rewardToken) public view returns (uint256)

Returns timestamp of last reward update

rewardForDuration

function rewardForDuration() external view returns (address[] _rewardTokens, uint256[] _rewardForDuration)

rewardPerToken

function rewardPerToken() external view returns (address[] _rewardTokens, uint256[] _rewardPerTokenRate)

Rewards rate per pool token

Name
Type
Description

_rewardTokens

address[]

Array of tokens being rewarded

_rewardPerTokenRate

uint256[]

Array of Rewards rate for token on same index in rewardTokens

PreviousPoolAccountantStorageNextPoolRewardsStorage

Last updated 2 years ago

Was this helpful?