Venus Prime - jamshed's results

Earn, borrow & lend on the #1 Decentralized Money Market on the BNB chain.

General Information

Platform: Code4rena

Start Date: 28/09/2023

Pot Size: $36,500 USDC

Total HM: 5

Participants: 115

Period: 6 days

Judge: 0xDjango

Total Solo HM: 1

Id: 290

League: ETH

Venus Protocol

Findings Distribution

Researcher Performance

Rank: 71/115

Findings: 1

Award: $17.24

Analysis:
grade-b

🌟 Selected for report: 0

πŸš€ Solo Findings: 0

Findings Information

Labels

analysis-advanced
grade-b
low quality report
A-10

Awards

17.244 USDC - $17.24

External Links

Overview:

Venus Protocol is rolling out something called Venus Prime, which is like a super cool incentive program. Their goal is to get more people involved and boost the protocol's growth. Venus Prime is a big deal in Venus Tokenomics v3.1β€”it's all about making things more rewarding and encouraging people to stake $XVS. They're honing in on markets involving USDT, USDC, BTC, and ETH.

Venus Prime has three Main contracts:

  1. Prime.

Soulbound Token: - This is a special token created within the context of the Venus Protocol. It seems to have a unique purpose, likely tied to special privileges or rewards. - Accruing Rewards: - Holders of the Soulbound token will gradually accumulate rewards. These rewards are generated using a portion of the income derived from specific markets within the Venus Protocol. - Staking Requirement for Regular Users: - Regular users who want to get their hands on the Soulbound token need to stake a minimum of 1,000 XVS (Venus native token) for a period of at least 90 days. - Eligibility for Prime Token: - After staking the required amount of XVS for the specified duration, users become eligible for a Prime token. This token likely signifies a higher or privileged status within the protocol. - Claiming the Prime Token: - Once users meet the staking requirements, they can claim their Prime token. This might involve executing a specific transaction or interacting with a smart contract. - Commencement of Reward Accrual: - Upon successfully claiming the Prime token, the process of accruing rewards begins for the token holder. These rewards are likely a share of the income generated by designated markets. - Flexibility in Claiming Rewards: - Prime token holders have the flexibility to claim their accrued rewards at a time of their choosing. This implies that they are not bound by a specific timeframe and can decide when it's most advantageous for them to claim the rewards.

  1. Libs Scores, FixedMathand FixedMath0x.

    • Used in the calculations needed to accrue rewards for Prime holders.
  2. PrimeLiquidityProvider

    1. Prime Program:

      • There's a program referred to as the "Prime program." This program likely involves some benefits, rewards, or privileges for participants.
    2. Sources of Tokens:

      • The program has multiple sources of tokens. The first source mentioned is the Venus markets, suggesting that the program generates tokens from these markets.
    3. Second Source: PrimeLiquidityProvider Contract:

      • The second source of tokens for the Prime program is a contract called "PrimeLiquidityProvider." This contract is designed to provide a specific amount of tokens.
    4. Distribution Method:

      • The tokens from the PrimeLiquidityProvider contract will be distributed in a specific manner. It mentions that a fixed amount of tokens will be distributed uniformly to Prime holders over a defined period of time.
    5. Uniform Distribution:

      • "Uniformly" suggests that the distribution will be equal among Prime holders. Each eligible participant will receive an equal share of the fixed amount of tokens during the specified time period.

    In summary, the PrimeLiquidityProvider contract serves as a dedicated source of tokens for the Prime program. It will distribute a fixed quantity of tokens evenly among Prime holders over a set timeframe. This additional source complements the tokens generated from Venus markets, providing a diverse mechanism for token distribution within the Prime program.

Recommendations:

- What is the overall line coverage percentage provided by your tests?: 96%

Due to its capacity, test coverage is expected to be 100%.

Rewards

for rewards, they use Goldfinch rewards mechanism. for simplicity, I like to explain Goldfinch rewards in the following way.

Goldfinch has a system that appreciates your involvement. Here's the scoop: When you lend money using Goldfinch or do other helpful things in their world, they shower you with extra tokens as a way of saying, "Thanks for being awesome!" It's like getting a bonus for being an active member of the Goldfinch community. The process encourages people to participate more and contributes to the overall growth and success of Goldfinch. So, the more you engage, the more rewards you can rack upβ€”it's a pretty sweet deal!

Income collection and distribution of Venus Prime

this whole mechanism ensures a smooth and fair distribution of rewards to Prime token holders, with careful consideration of configuration changes and timely accrual of interest.

let's see step-by-step :

  1. Interest Reserves and PSR:

    • The protocol generates income from core pool markets, and a portion of this income is stored in interest reserves.
    • These interest reserves are then sent to the PSR (Protocol Share Reserve) contract.
  2. Configuration and Prime Markets:

    • A specific percentage of the spread income from Prime markets is set aside for Prime token holders.
    • The interest reserves are sent to the PSR at regular intervals, specifically every 10 blocks (subject to community adjustment via VIP).
  3. PSR Functions:

    • The PSR has two main functions:
      • releaseFunds: This function needs to be activated to release the funds from the PSR to the Prime contract.
      • getUnreleasedFunds: This function retrieves the unreleased funds for a specified destination target.
  4. Prime Contract and Distribution:

    • The Prime contract calculates the total of released and unreleased funds.
    • These funds are distributed to Prime token holders in each block, and the distribution is proportionate to the score of the Prime token holders.
  5. Claiming Rewards and Triggering Fund Release:

    • When a user claims their rewards, and if the contract doesn't have sufficient funds, the release of funds from PSR to Prime contract is triggered within the same transaction.
  6. Integration Points with PSR and Prime Contract:

    • When there's a change in distribution configuration, the PSR contract initiates a call to accrueInterest on the Prime contract. It releases funds to Prime, ensuring that pending funds are distributed based on the existing configuration before applying new changes.
    • Prior to releasing funds to the Prime contract, the PSR contract calls accrueInterest, and after sending funds, it calls updateAssetsState.

Time:

The analysis process spanned approximately 15-17 hours, encompassing initial project familiarization, compiling this comprehensive report

Time spent:

17hours

Time spent:

17 hours

#0 - c4-pre-sort

2023-10-07T06:15:06Z

0xRobocop marked the issue as low quality report

#1 - c4-judge

2023-11-03T20:18:38Z

fatherGoose1 marked the issue as grade-b

AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax Β© 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter