ekonomia-tech / protocol-alpha

Alpha version of a DeFi stablecoin protocol
GNU General Public License v3.0
4 stars 0 forks source link

Modify Price Controller #59

Closed nmimran99 closed 2 years ago

nmimran99 commented 2 years ago

Price Controller alignment with the modular architecture.

Main changes:

PriceController.sol - calls moduleManager to mint and burn PriceController.t.sol - tests aligned to accommodate new architecture.

nmimran99 commented 2 years ago

setCooldownPeriod - I actually wanna remove that altogether. reason is that the cooldown should be determined by the TWAP period. we dont want to call stabilize more than the TWAP period, otherwise the price fixes will always be an overkill.

nmimran99 commented 2 years ago

OK I fixed all of the above comments. I changed names gapFraction to priceMitigationPercentage and all of its derivatives. I added a logical case for price == price_target and removed the need for inBand.

I also removed the setDexPool, setPriceBand, setCooldownPeriod and setStabilizingToken. I hardcoded USDC into the contract .