A contract for moving reweighting Uniswap prices to the peg from a Uniswap PCV Deposit. ETH specific implementation.
Reweights are used to return the Uniswap spot price of an associated PCV Deposit to the peg. The algorithm is as follows:
withdraw 99% of the ETH from the UniswapPCVDeposit
execute a trade with held ETH to bring the spot price back up to peg
deposit remaining ETH balance back into the Uniswap PCV Deposit
burn excess held FEI
The reweight is open to a keeper when both of the following conditions are met:
the distance below the peg is at least the minimum (currently 0.5%)
The frequency window has passed (currently 4h)
Governor⚖️and Guardian🛡contracts can force a reweight at any time
Governor⚖️ contracts can also update the minimum distance and frequency.
Reweight executions are incentivized with 200 FEI if the controller is appointed as a Minter💰. Governance can adjust this incentive amount.
A Uniswap Reweight event
the address triggering the reweight
Change the PCV Deposit contract
new pcv deposit contract
Change the FEI reward for reweighting
FEI reward amount
Change the min distance for a reweight
Minimum reweight amount in basis points (i.e. 1/10000)
Change the amount of PCV withdrawn during a reweight
amount of PCV withdrawn for a reweight in basis point terms (1/10000).
function pcvDeposit() external returns (IPCVDeposit);
Returns the PCV Deposit address this controller focuses on reweighting.
function incentiveContract() external returns (IUniswapIncentive);
Returns the UniswapIncentive contract used to determine reweight eligibility.
function reweightIncentiveAmount() external returns (uint256);
Returns the amount of FEI received by any keeper who successfully executes a reweight.
function reweightWithdrawBPs() external returns (uint256);
Returns the amount of PCV withdrawn during a reweight in basis points terms.
function reweightEligible() external view returns (bool);
Returns true when the distance from the peg is at least the minimum and the reweight frequency has passed.
function minDistanceForReweight()externalviewreturns (Decimal.D256 memory);
Returns the minimum percent distance below the peg needed for keepers to reweight the peg. If the peg is above then the reweight won't occur.
function reweight() external;
Executes a reweight if
Rewards the caller with 200 FEI.
function forceReweight() external;
Forces a reweight execution. No FEI incentive for doing this. Fails if the Uniswap spot price is already at or above the peg.
function setReweightMinDistance(uint256 basisPoints) external;
Sets the minimum distance below the peg for a reweight to be eligible to
basisPoints, measured in basis points (i.e. 1/10000). This distance must be below the peg, above does not trigger a reweight.
function setReweightWithdrawBPs(uint256 _reweightWithdrawBPs) external;
Sets the percentage of the PCV withdrawn when executing a reweight in terms of basis points
function setPCVDeposit(address _pcvDeposit) external;
Sets the target PCV Deposit contract for reweight to
function setReweightIncentive(uint256 amount) external;
Sets the keeper incentive for executing a reweight to
amount of FEI