Prime storage
PrimeV2StorageV1
Section titled “PrimeV2StorageV1”Storage layout for the PrimeV2 contract with leaderboard-based Prime token distribution
Solidity API
Section titled “Solidity API”struct Market { uint256 supplyMultiplier; uint256 borrowMultiplier; uint256 rewardIndex; uint256 sumOfMembersScore; bool exists;}struct Interest { uint256 accrued; // Accrued rewards pending claim (reset to 0 on claim) uint256 score; // User's score in this market uint256 rewardIndex; // Last recorded reward index uint256 lifetimeAccrued; // Monotonic running total of all rewards ever accrued to this // user in this market; never decremented on claim. Lets the // off-chain cycle pipeline compute per-cycle earnings as the // diff between two snapshots.}struct PendingReward { address vToken; address rewardToken; uint256 amount;}isPrimeHolder
Section titled “isPrimeHolder”Whether a user holds a Prime token
mapping(address => bool) isPrimeHoldertotalTokens
Section titled “totalTokens”Total count of Prime tokens
uint256 totalTokenstokenLimit
Section titled “tokenLimit”Maximum number of Prime tokens allowed
uint256 tokenLimitmarkets
Section titled “markets”Mapping of vToken to its market configuration
mapping(address => struct PrimeV2StorageV1.Market) marketsinterests
Section titled “interests”Mapping of vToken -> user -> interest info
mapping(address => mapping(address => struct PrimeV2StorageV1.Interest)) interests_allMarkets
Section titled “_allMarkets”Internal array of all Prime-participating markets. This field is stored between interests and vTokenForAsset.
address[] _allMarketsvTokenForAsset
Section titled “vTokenForAsset”Mapping of underlying token to vToken address (used to check if an asset is part of Prime markets)
mapping(address => address) vTokenForAssetalphaNumerator
Section titled “alphaNumerator”numerator of alpha. Ex: if alpha is 0.5 then this will be 1
uint128 alphaNumeratoralphaDenominator
Section titled “alphaDenominator”denominator of alpha. Ex: if alpha is 0.5 then this will be 2
uint128 alphaDenominatorprimeLiquidityProvider
Section titled “primeLiquidityProvider”The address of the PrimeLiquidityProvider contract
address primeLiquidityProvideroracle
Section titled “oracle”The address of the ResilientOracle contract
contract ResilientOracleInterface oraclecorePoolComptroller
Section titled “corePoolComptroller”Address of the core pool comptroller contract
address corePoolComptrollerunreleasedPLPIncome
Section titled “unreleasedPLPIncome”Unreleased income from the PLP per token that has already been accounted for — either indexed into rewardIndex for Prime holders, or recorded in undistributedReward while the market had no scored members
mapping(address => uint256) unreleasedPLPIncomeundistributedReward
Section titled “undistributedReward”Income accrued while no scored members existed in the market. Tracked per underlying so governance can reclaim the slice via sweepUndistributed without touching user-owed funds.
mapping(address => uint256) undistributedRewardisScoreUpdated
Section titled “isScoreUpdated”Mapping to check if an account’s score was updated in a round
mapping(uint256 => mapping(address => bool)) isScoreUpdatednextScoreUpdateRoundId
Section titled “nextScoreUpdateRoundId”Current score update round ID
uint256 nextScoreUpdateRoundIdpendingScoreUpdates
Section titled “pendingScoreUpdates”Number of pending score updates in the current round
uint256 pendingScoreUpdatesprimeLeaderboard
Section titled “primeLeaderboard”Address of the PrimeLeaderboard contract for permissionless eligibility checks
address primeLeaderboardmintThreshold
Section titled “mintThreshold”Minimum Prime Score required for permissionless Prime minting
uint256 mintThresholdmintDeadline
Section titled “mintDeadline”Unix timestamp after which permissionless minting is closed (0 = no deadline)
uint256 mintDeadlineReserved storage for future upgrades.
uint256[40] __gap