Skip to content

Conversation

aalavandhan
Copy link
Member

@aalavandhan aalavandhan commented Oct 4, 2023

  • Policy now gets the cpi adjusted target rate as an output from the cpi oracle (rather than getting the new CPI and scaling it to then compute the current target).
  • Median oracle now has an additional scaling factor parameter (settable by the owner). The final output = median*scalar

@@ -29,6 +29,7 @@ contract UFragmentsPolicy is Ownable {
using SafeMathInt for int256;
using UInt256Lib for uint256;

/// @notice DEPRECATED.
event LogRebase(
Copy link
Member Author

Choose a reason for hiding this comment

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

We need to update and redeploy the subgraph index based on either LogRebase and Rebase.

@aalavandhan aalavandhan force-pushed the target-fix branch 2 times, most recently from ca56426 to ad58b29 Compare October 4, 2023 16:26
Comment on lines 136 to 139
uint256 currentRate;
bool currentRateValid;
(currentRate, currentRateValid) = marketOracle.getData();
require(currentRateValid);
Copy link
Contributor

Choose a reason for hiding this comment

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

can we keep names as is :) ?

@aalavandhan aalavandhan force-pushed the target-fix branch 2 times, most recently from 3403bb9 to 3296e35 Compare October 4, 2023 18:21
@aalavandhan aalavandhan force-pushed the target-fix branch 2 times, most recently from fd5d900 to cf50107 Compare October 5, 2023 12:30
Copy link
Member

@brandoniles brandoniles left a comment

Choose a reason for hiding this comment

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

LGTM

*/
function init(
uint256 reportExpirationTimeSec_,
uint256 reportDelaySec_,
uint256 minimumProviders_
uint256 minimumProviders_,
uint256 scalar_
Copy link
Contributor

Choose a reason for hiding this comment

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

Thinking about this more I think we need different scalar for different providers when using different sources for target price (we can do that in a later change though)

@aalavandhan aalavandhan merged commit a868c40 into master Oct 6, 2023
@aalavandhan aalavandhan deleted the target-fix branch October 6, 2023 17:14
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.

4 participants