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

fix sfrxETH Collateral, add new oracle #1026

Merged
merged 11 commits into from
Jan 20, 2024
Prev Previous commit
Next Next commit
need to fix oracle manipulation in tests.
  • Loading branch information
pmckelvy1 committed Jan 16, 2024
commit bfeb22d6a27354507ab34c84f22f665a7076c762
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ contract CurvePoolEmaPriceOracleWithMinMax is ICurvePoolEmaPriceOracleWithMinMax
address public immutable CURVE_POOL_EMA_PRICE_ORACLE;

/// @notice Precision of Curve pool price_oracle()
uint256 public constant CURVE_POOL_EMA_PRICE_ORACLE_PRECISION = 1e18;
uint256 public constant CURVE_POOL_EMA_PRICE_ORACLE_DECIMALS = 18;

/// @notice Maximum price of token1 in token0 units of the EMA
/// @dev Must match precision of EMA
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ pragma solidity 0.8.19;
interface ICurvePoolEmaPriceOracleWithMinMax {
function CURVE_POOL_EMA_PRICE_ORACLE() external view returns (address);

function CURVE_POOL_EMA_PRICE_ORACLE_PRECISION() external view returns (uint256);
function CURVE_POOL_EMA_PRICE_ORACLE_DECIMALS() external view returns (uint256);

function getCurvePoolToken1EmaPrice() external view returns (uint256 _emaPrice);

Original file line number Diff line number Diff line change
@@ -222,7 +222,7 @@ const getExpectedPrice = async (ctx: SFrxEthCollateralFixtureContext): Promise<B

const collateral = ctx.collateral as unknown as SFraxEthCollateral
const clTpRData = await collateral.getCurvePoolToken1EmaPrice()
const clTpRDecimals = await collateral.CURVE_POOL_EMA_PRICE_ORACLE_PRECISION()
const clTpRDecimals = await collateral.CURVE_POOL_EMA_PRICE_ORACLE_DECIMALS()

const refPerTok = await ctx.sfrxEth.pricePerShare()