-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat/ui-stake-helpers #32
Closed
Closed
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
dfca36d
init
foodaka 4586228
optimize generic functions
foodaka 2a359d4
debug
foodaka 6a65458
hh
foodaka 661739f
add minor tests
foodaka 572902e
constants
foodaka 4656dcc
init tests
foodaka 0f37d98
remove debug
foodaka 759743d
stateless contract
foodaka aa2f426
pr feedback
foodaka File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ interface IStakedTokenDataProvider { | |
uint256 rewardTokenPriceEth; | ||
uint256 stakeApy; | ||
uint128 distributionPerSecond; | ||
bool inPostSlashingPeriod; | ||
uint256 distributionEnd; | ||
} | ||
|
||
|
@@ -40,12 +41,6 @@ interface IStakedTokenDataProvider { | |
*/ | ||
function AAVE_PRICE_FEED() external returns (address); | ||
|
||
/** | ||
* @notice Return the address of the BPT price feed, ETH denominated | ||
* @return The address of the BPT price feed, ETH denominated, expressed with 18 decimals | ||
*/ | ||
function BPT_PRICE_FEED() external returns (address); | ||
|
||
/** | ||
* @notice Return the address of the AAVE token | ||
* @return The address of the AAVE token | ||
|
@@ -59,83 +54,67 @@ interface IStakedTokenDataProvider { | |
function STAKED_AAVE() external returns (address); | ||
|
||
/** | ||
* @notice Return the address of the BPT token | ||
* @return The address of the BPT token | ||
*/ | ||
function BPT() external returns (address); | ||
|
||
/** | ||
* @notice Return the address of the Staked BPT token | ||
* @return The address of the StkBPT token | ||
* @notice Returns data of Staked assets | ||
* @param stakedAsset The address of the stakedAsset | ||
* @param oracleAddress The address of the oracle denominated in 18 decimals | ||
* @return stakedAssetData An object with staked asset data | ||
*/ | ||
function STAKED_BPT() external returns (address); | ||
|
||
/** | ||
* @notice Returns data of all Staked Tokens | ||
* @return stkAaveData An object with StkAave data | ||
* @return stkBptData An object with StkBpt data | ||
* @return ethPrice The price of ETH, USD denominated (expressed with 8 decimals) | ||
*/ | ||
function getAllStakedTokenData() | ||
function getStakedAssetData(address stakedAsset, address oracleAddress) | ||
external | ||
view | ||
returns ( | ||
StakedTokenData memory stkAaveData, | ||
StakedTokenData memory stkBptData, | ||
uint256 ethPrice | ||
); | ||
|
||
/** | ||
* @notice Returns data of Staked Aave | ||
* @return stkAaveData An object with StkAave data | ||
*/ | ||
function getStkAaveData() external view returns (StakedTokenData memory stkAaveData); | ||
returns (StakedTokenData memory stakedAssetData); | ||
|
||
/** | ||
* @notice Returns data of Staked Bpt Aave | ||
* @return stkBptData An object with StkBpt data | ||
* @notice Retrieves staked token data and user-specific data for a given user, staked asset, and its associated oracle. | ||
* @param user The address of the user for whom the data is to be fetched. | ||
* @param stakedAsset The address representing the staked token. | ||
* @param oracleAddress The address representing the oracle associated with the staked token denominated in 18 decimals. | ||
* @return stakedTokenData `StakedTokenData` struct with details about the staked asset. | ||
* @return stakedUserData `StakedTokenUserData` struct containing user-specific details related to the staked asset. | ||
*/ | ||
function getStkBptData() external view returns (StakedTokenData memory stkBptData); | ||
function getStakedUserData( | ||
address user, | ||
address stakedAsset, | ||
address oracleAddress | ||
) | ||
external | ||
view | ||
returns (StakedTokenData memory stakedTokenData, StakedTokenUserData memory stakedUserData); | ||
|
||
/** | ||
* @notice Returns user data of all Staked Tokens | ||
* @param user The address of the user | ||
* @return stkAaveData An object with StkAave data | ||
* @return stkAaveUserData An object with user data of StkAave | ||
* @return stkBptData An object with StkBpt data | ||
* @return stkBptUserData An object with user data of StkBpt | ||
* @return ethPrice The price of ETH, USD denominated (expressed with 8 decimals) | ||
* @notice Retrieves data for a batch of staked assets given their addresses and the addresses of their associated oracles. | ||
* @param stakedTokens An array of addresses representing the staked tokens. | ||
* @param oracleAddresses An array of addresses representing the oracles associated with the staked tokens denominated as 18 decimals. | ||
* @return stakedData An array containing data about the staked assets. | ||
* @return prices An array containing the latest price data from the oracles for the staked tokens. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why is this array needed? |
||
* @return ethPrice A uint256 with the latest ETH price for the staked tokens. | ||
*/ | ||
function getAllStakedTokenUserData(address user) | ||
function getStakedAssetDataBatch( | ||
address[] calldata stakedTokens, | ||
address[] calldata oracleAddresses | ||
) | ||
external | ||
view | ||
returns ( | ||
StakedTokenData memory stkAaveData, | ||
StakedTokenUserData memory stkAaveUserData, | ||
StakedTokenData memory stkBptData, | ||
StakedTokenUserData memory stkBptUserData, | ||
StakedTokenData[] memory stakedData, | ||
uint256[] memory prices, | ||
uint256 ethPrice | ||
); | ||
|
||
/** | ||
* @notice Returns user data of Staked Aave | ||
* @param user The address of the user | ||
* @return stkAaveData An object with StkAave data | ||
* @return stkAaveUserData An object with user data of StkAave | ||
*/ | ||
function getStkAaveUserData(address user) | ||
external | ||
view | ||
returns (StakedTokenData memory stkAaveData, StakedTokenUserData memory stkAaveUserData); | ||
|
||
/** | ||
* @notice Returns user data of Staked Bpt Aave | ||
* @param user The address of the user | ||
* @return stkBptData An object with StkBpt data | ||
* @return stkBptUserData An object with user data of StkBpt | ||
* @notice Retrieves data for a batch of staked users and their assets given the addresses of staked tokens, associated oracles, and users. | ||
* @param stakedTokens An array of addresses representing the staked tokens. | ||
* @param oracleAddresses An array of addresses representing the oracles associated with the staked tokens denominated as 18 decimals. | ||
* @param userAddress An addresses representing the user whose data should be retrieved. | ||
* @return stakedTokenData An array containing data about the staked assets. | ||
* @return stakedUserData An array containing user-specific data about the staked assets. | ||
*/ | ||
function getStkBptAaveUserData(address user) | ||
function getStakedUserDataBatch( | ||
address[] calldata stakedTokens, | ||
address[] calldata oracleAddresses, | ||
address userAddress | ||
) | ||
external | ||
view | ||
returns (StakedTokenData memory stkBptData, StakedTokenUserData memory stkBptUserData); | ||
returns (StakedTokenData[] memory stakedTokenData, StakedTokenUserData[] memory stakedUserData); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarify the format and unit denomination of oracles on every @param please.