Skip to content

Prime storage

Storage layout for the PrimeV2 contract with leaderboard-based Prime token distribution

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;
}

Whether a user holds a Prime token

mapping(address => bool) isPrimeHolder

Total count of Prime tokens

uint256 totalTokens

Maximum number of Prime tokens allowed

uint256 tokenLimit

Mapping of vToken to its market configuration

mapping(address => struct PrimeV2StorageV1.Market) markets

Mapping of vToken -> user -> interest info

mapping(address => mapping(address => struct PrimeV2StorageV1.Interest)) interests

Internal array of all Prime-participating markets. This field is stored between interests and vTokenForAsset.

address[] _allMarkets

Mapping of underlying token to vToken address (used to check if an asset is part of Prime markets)

mapping(address => address) vTokenForAsset

numerator of alpha. Ex: if alpha is 0.5 then this will be 1

uint128 alphaNumerator

denominator of alpha. Ex: if alpha is 0.5 then this will be 2

uint128 alphaDenominator

The address of the PrimeLiquidityProvider contract

address primeLiquidityProvider

The address of the ResilientOracle contract

contract ResilientOracleInterface oracle

Address of the core pool comptroller contract

address corePoolComptroller

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) unreleasedPLPIncome

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) undistributedReward

Mapping to check if an account’s score was updated in a round

mapping(uint256 => mapping(address => bool)) isScoreUpdated

Current score update round ID

uint256 nextScoreUpdateRoundId

Number of pending score updates in the current round

uint256 pendingScoreUpdates

Address of the PrimeLeaderboard contract for permissionless eligibility checks

address primeLeaderboard

Minimum Prime Score required for permissionless Prime minting

uint256 mintThreshold

Unix timestamp after which permissionless minting is closed (0 = no deadline)

uint256 mintDeadline

Reserved storage for future upgrades.

uint256[40] __gap