The primary purpose of this PR is to re-implement a function that is defined in IPriceSource.sol and is used in Participation.sol, but is missing from KyberPriceFeed.sol, which caused the price feed to be unusable.
Additionally, it:
makes KyberPriceFeed.sol inherit from IPriceSource.sol, and re-implements all other missing functions (even though these other functions are not used in the protocol codebase)
reverts name of an event to its old name, to be consistent with the production version of the Melon subgraph
replaces _failIfInvalid flag on update() with check that allows a 0 price to pass if the sanity rate (i.e., its expected off-chain rate) is exactly 0 (e.g., SAI does not have a Kyber reserve price, but it is in the list of registered assets)
replaces the use of arbitrary reserveMin values in passing a srcQty to KyberNetworkProxy.getExpectedRate() with dynamic calculations of the src asset relative to a constant amount of weth (e.g., 0.01 WETH worth of DAI, 0.01 WETH worth of WBTC, etc).
The primary purpose of this PR is to re-implement a function that is defined in
IPriceSource.sol
and is used inParticipation.sol
, but is missing fromKyberPriceFeed.sol
, which caused the price feed to be unusable.Additionally, it:
KyberPriceFeed.sol
inherit fromIPriceSource.sol
, and re-implements all other missing functions (even though these other functions are not used in the protocol codebase)_failIfInvalid
flag onupdate()
with check that allows a 0 price to pass if the sanity rate (i.e., its expected off-chain rate) is exactly 0 (e.g., SAI does not have a Kyber reserve price, but it is in the list of registered assets)reserveMin
values in passing asrcQty
toKyberNetworkProxy.getExpectedRate()
with dynamic calculations of the src asset relative to a constant amount of weth (e.g., 0.01 WETH worth of DAI, 0.01 WETH worth of WBTC, etc).