Skip to content
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

multiple new collateral pricefeeds #318

Open
wants to merge 23 commits into
base: development
Choose a base branch
from
Open

Conversation

0xosama
Copy link
Contributor

@0xosama 0xosama commented Feb 27, 2023

No description provided.

@0xosama 0xosama marked this pull request as ready for review March 22, 2023 20:44
@0xosama 0xosama requested review from Drypto13 and yanga128 March 22, 2023 20:44

import "contracts/feeds/IPriceFeedsExt.sol";

contract ATokenPriceHelper_ARB is IPriceFeedHelper {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we could use mapping and few configuration transactions instead of hardcode all these addresses

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mapping is going to be more expensive to use

IAToken private constant aArbWETH = IAToken(0xe50fA9b3c56FfB159cB0FCA61F5c9D750e8128c8);

address private constant DAI = 0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1;
address private constant ERUS = 0xD22a58f79e9481D1a88e00c343885A588b34b68B;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is EURS, not ERUS

function latestAnswer(address token) external view returns (uint256) {
require(token == CURVE_USDT_USDC_TOKEN, "unsupported");
uint256 balanceUSD = USDT.balanceOf(CURVE_USDT_USDC_TOKEN) * uint256(USDT_PRICE_FEED.latestAnswer()) / 1e8;
balanceUSD += USDC.balanceOf(CURVE_USDT_USDC_TOKEN) * uint256(USDC_PRICE_FEED.latestAnswer()) / 1e8;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better to value by using the virtual price and using the lowest priced token, whether that is USDT or USDC to value the virtual price

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fully agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants