KyberNetwork / smart-contracts

Main smart contracts for Kyber Network, including the main platform contract, reserve contracts etc.
https://kyber.network
MIT License
378 stars 341 forks source link

New reserve push. Kyber reserve + conversion rate enhanced steps with higher max_rate. #1052

Closed ilanDoron closed 4 years ago

ilanDoron commented 4 years ago

Current ConversionRateEnhancedSteps inherits MAX_RATE from utils contract and uses it in addBps function.

currently our code uses PRECISION 10^6 but in Katalyst MAX_RATE is PRECISION 10^7 for using the bigger value. this PR updates MAX_RATE in use for two contracts: KyberReseve - creates a new contract KyberReserveHighRate and updating enhanced steps contract, which can be updated since not yet used in production.

code was written to enable max code reuse and minimal code duplication

Wrapper for enhanced conversion rates was modified:

remove call to setQtyStepFunction which can't be used in enhanced conversion rate. call set imbalance with x and y arrays with different length.