UiIncentiveDataProviderV3
UiIncentiveDataProviderV3
Contract that returns an array of all reserve incentives or user claimable rewards within a particular market, used by the SparkLend Interface to display incentives data.
The SparkLend Utilities SDK includes an interface to make calls to this contract, and functions to format the response for frontend use-cases.
Data Structures
AggregatedReserveIncentiveData
Name | Type | Description |
---|---|---|
underlyingAsset | address | Address of the asset supplied/borrowed in Pool |
aIncentiveData | IncentiveData | Details of rewards distributed for supplying to SparkLend Pool i.e. rewards for spToken holders. |
vIncentiveData | IncentiveData | Details of rewards distributed for variable debt borrowed from SparkLend Pool i.e. rewards for vToken holders. |
sIncentiveData | IncentiveData | Details of rewards distributed for stable debt borrowed from SparkLend Pool i.e. rewards for sToken holders. |
IncentiveData
Name | Type | Description |
---|---|---|
tokenAddress | address | Address of corresponding a/s/vToken. |
incentiveControllerAddress | address | Address of Rewards Controller |
rewardsTokenInformation | RewardInfo[] | Array of details for all reward tokens that are available for given a/s/vToken |
RewardInfo
Name | Type | Description |
---|---|---|
rewardTokenSymbol | string | Symbol of Reward Token |
rewardTokenAddress | address | Address of Reward Token |
rewardOracleAddress | address | Price Oracle for Reward token |
emissionPerSecond | uint256 | Reward Token emitted per second |
incentivesLastUpdateTimestamp | uint256 | Unix timestamp of last update made on asset’s reward token. |
tokenIncentivesIndex | uint256 | Latest distribution index of the reward token |
emissionEndTimestamp | uint256 | Unix timestamp of when the Incentive emission of given reward token ends for the corresponding asset |
rewardPriceFeed | int256 | Latest answer/price from reward token price oracle |
rewardTokenDecimals | uint8 | Decimals of reward token |
precision | uint8 | Decimals of asset token (a/s/vToken) |
priceFeedDecimals | uint8 | Decimals of price provided by oracle |
UserReserveIncentiveData
Name | Type | Description |
---|---|---|
underlyingAsset | address | Address of the asset supplied/borrowed in Pool |
spTokenIncentivesUserData | UserIncentiveData | Details of user rewards received for supplying to SparkLend Pool i.e. rewards for spToken. |
vTokenIncentivesUserData | UserIncentiveData | Details of user rewards received for borrowing at variable rate from SparkLend Pool i.e. rewards for vToken. |
sTokenIncentivesUserData | UserIncentiveData | Details of user rewards received for borrowing at stable rate from SparkLend Pool i.e. rewards for sToken. |
UserIncentiveData
Name | Type | Description |
---|---|---|
tokenAddress | address | Address of corresponding a/s/vToken. |
incentiveControllerAddress | address | Address of Rewards Controller for reward claim tx |
userRewardsInformation | UserRewardInfo[] | Array of details for all reward tokens accrued/claimed by user for given a/s/vToken |
UserRewardInfo
Name | Type | Description |
---|---|---|
rewardTokenSymbol | string | Symbol of Reward Token |
rewardOracleAddress | address | Price Oracle for Reward token |
rewardTokenAddress | address | Address of Reward Token |
userUnclaimedRewards | uint256 | User’s unclaimed rewards |
tokenIncentivesUserIndex | uint256 | Latest user distribution index |
rewardPriceFeed | int256 | Latest answer/price from reward token price oracle |
priceFeedDecimals | uint8 | Decimals of price provided by oracle |
rewardTokenDecimals | uint8 | Decimals of reward token |
Methods
getReservesIncentivesData
function getReservesIncentivesData(IPoolAddressesProvider provider)
Returns AggregatedReserveIncentiveData[]
for the pool associated with given provider
.
getUserReservesIncentivesData
function getUserReservesIncentivesData(IPoolAddressesProvider provider, address user)
Returns UserReserveIncentiveData[]
for the given user
for the pool associated with given .
getFullReservesIncentiveData
function getFullReservesIncentiveData(IPoolAddressesProvider provider, address user)
Returns both AggregatedReserveIncentiveData[]
and UserReserveIncentiveData[]
for the given user
for the pool associated with given provider
.
ABI
UiIncentiveDataProviderV3 ABI
[
{
"inputs": [
{
"internalType": "contract IPoolAddressesProvider",
"name": "provider",
"type": "address"
},
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "getFullReservesIncentiveData",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "underlyingAsset",
"type": "address"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "emissionPerSecond",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "incentivesLastUpdateTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "emissionEndTimestamp",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "precision",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]",
"name": "rewardsTokenInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.IncentiveData",
"name": "aIncentiveData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "emissionPerSecond",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "incentivesLastUpdateTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "emissionEndTimestamp",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "precision",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]",
"name": "rewardsTokenInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.IncentiveData",
"name": "vIncentiveData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "emissionPerSecond",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "incentivesLastUpdateTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "emissionEndTimestamp",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "precision",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]",
"name": "rewardsTokenInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.IncentiveData",
"name": "sIncentiveData",
"type": "tuple"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]",
"name": "",
"type": "tuple[]"
},
{
"components": [
{
"internalType": "address",
"name": "underlyingAsset",
"type": "address"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "userUnclaimedRewards",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesUserIndex",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]",
"name": "userRewardsInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData",
"name": "spTokenIncentivesUserData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "userUnclaimedRewards",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesUserIndex",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]",
"name": "userRewardsInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData",
"name": "vTokenIncentivesUserData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "userUnclaimedRewards",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesUserIndex",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]",
"name": "userRewardsInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData",
"name": "sTokenIncentivesUserData",
"type": "tuple"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IPoolAddressesProvider",
"name": "provider",
"type": "address"
}
],
"name": "getReservesIncentivesData",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "underlyingAsset",
"type": "address"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "emissionPerSecond",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "incentivesLastUpdateTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "emissionEndTimestamp",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "precision",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]",
"name": "rewardsTokenInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.IncentiveData",
"name": "aIncentiveData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "emissionPerSecond",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "incentivesLastUpdateTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "emissionEndTimestamp",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "precision",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]",
"name": "rewardsTokenInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.IncentiveData",
"name": "vIncentiveData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "emissionPerSecond",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "incentivesLastUpdateTimestamp",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesIndex",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "emissionEndTimestamp",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "precision",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.RewardInfo[]",
"name": "rewardsTokenInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.IncentiveData",
"name": "sIncentiveData",
"type": "tuple"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.AggregatedReserveIncentiveData[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "contract IPoolAddressesProvider",
"name": "provider",
"type": "address"
},
{
"internalType": "address",
"name": "user",
"type": "address"
}
],
"name": "getUserReservesIncentivesData",
"outputs": [
{
"components": [
{
"internalType": "address",
"name": "underlyingAsset",
"type": "address"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "userUnclaimedRewards",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesUserIndex",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]",
"name": "userRewardsInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData",
"name": "spTokenIncentivesUserData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "userUnclaimedRewards",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesUserIndex",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]",
"name": "userRewardsInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData",
"name": "vTokenIncentivesUserData",
"type": "tuple"
},
{
"components": [
{
"internalType": "address",
"name": "tokenAddress",
"type": "address"
},
{
"internalType": "address",
"name": "incentiveControllerAddress",
"type": "address"
},
{
"components": [
{
"internalType": "string",
"name": "rewardTokenSymbol",
"type": "string"
},
{
"internalType": "address",
"name": "rewardOracleAddress",
"type": "address"
},
{
"internalType": "address",
"name": "rewardTokenAddress",
"type": "address"
},
{
"internalType": "uint256",
"name": "userUnclaimedRewards",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "tokenIncentivesUserIndex",
"type": "uint256"
},
{
"internalType": "int256",
"name": "rewardPriceFeed",
"type": "int256"
},
{
"internalType": "uint8",
"name": "priceFeedDecimals",
"type": "uint8"
},
{
"internalType": "uint8",
"name": "rewardTokenDecimals",
"type": "uint8"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserRewardInfo[]",
"name": "userRewardsInformation",
"type": "tuple[]"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserIncentiveData",
"name": "sTokenIncentivesUserData",
"type": "tuple"
}
],
"internalType": "struct IUiIncentiveDataProviderV3.UserReserveIncentiveData[]",
"name": "",
"type": "tuple[]"
}
],
"stateMutability": "view",
"type": "function"
}
]
Last updated