Skip to content

Commit

Permalink
TRUST M-9: pegprice in frxETH (#1006)
Browse files Browse the repository at this point in the history
  • Loading branch information
julianmrodri authored Nov 2, 2023
1 parent d994934 commit 92fbdec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
2 changes: 1 addition & 1 deletion contracts/plugins/assets/frax-eth/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ This function returns rate of `frxETH/sfrxETH`, getting from [pricePerShare()](h

#### tryPrice

This function uses `refPerTok`, the chainlink price of `ETH/frxETH`, and the chainlink price of `USD/ETH` to return the current price range of the collateral.
This function uses `refPerTok` and the chainlink price of `USD/ETH` to return the current price range of the collateral. Once an oracle becomes available for `frxETH/ETH`, this function should be modified to use it and return the appropiate `pegPrice`.
10 changes: 9 additions & 1 deletion contracts/plugins/assets/frax-eth/SFraxEthCollateral.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import "../AppreciatingFiatCollateral.sol";
import "../OracleLib.sol";
import "./vendor/IsfrxEth.sol";

/**
* ************************************************************
* WARNING: this plugin is not ready to be used in Production
* ************************************************************
*/

/**
* @title SFraxEthCollateral
* @notice Collateral plugin for Frax-ETH,
Expand All @@ -32,7 +38,7 @@ contract SFraxEthCollateral is AppreciatingFiatCollateral {
/// Can revert, used by other contract functions in order to catch errors
/// @return low {UoA/tok} The low price estimate
/// @return high {UoA/tok} The high price estimate
/// @return pegPrice {target/ref} The actual price observed in the peg
/// @return pegPrice {target/ref} FIX_ONE until an oracle becomes available
function tryPrice()
external
view
Expand All @@ -51,6 +57,8 @@ contract SFraxEthCollateral is AppreciatingFiatCollateral {
high = p + err;
// assert(low <= high); obviously true just by inspection

// TODO: Currently not checking for depegs between `frxETH` and `ETH`
// Should be modified to use a `frxETH/ETH` oracle when available
pegPrice = targetPerRef();
}

Expand Down

0 comments on commit 92fbdec

Please sign in to comment.