Kyber Core Smart Contract Overview
The three main components of any implementation of the Kyber protocol are the Kyber Core Smart Contracts, the Reserve Interface and the List of Registered Reserves and Token Pairs.
In our implementation of the protocol, these 3 components are represented by the
IKyberReserve.sol contracts. The
KyberNetworkProxy.sol contract will act as a single endpoint for makers and takers to interface with in order to interact with our liquidity network. The contract will also contain a list of registered reserves that will be iterated through when processing a trade.
With upgradeability in mind, we have designed some auxiliary contracts, such as
KyberStorage.sol, will be deployed to help the main
KyberNetwork.sol contract achieve the core functionalities of the protocol.
IKyberReserve.sol is the interface that all reserve implementations are required to adhere to.
Our existing codebase contains 3 types of reserves; Fed Price Reserve, Automated Price Reserve and the Orderbook Reserve. The functions of these reserves are encapsulated within the
KyberReserve.sol contract. While each reserve type was designed with different features in mind, they share a common goal of contributing liquidity to the network.
Fed Price Reserve
The Fed Price Reserve (FPR) is our first type of reserve, offering reserve managers full control and flexibility over their pricing algorithm. However, the flexibility of managing a Fed Price Reserve came with a relatively steep learning curve and development costs that arose from having to build, run, and maintain an off-chain server and/or scripts to feed prices on-chain.
The FPR and conversion rates are represented by the
ConversionRates.sol contracts respectively. The token conversion rates are fed to the
ConversionRates.sol contract by the reserve managers. Furthermore, they also have the option of defining the upper and lower limits on the conversion rates via the
Automated Price Reserve
The Automated Price Reserve (APR) is the second type of reserve, which was designed with ease of maintenance as the top consideration. Unlike the Fed Price Reserve (FPR), reserve managers of the APR will delegate the control of their pricing strategy to a predefined algorithm set in the smart contract. But in exchange, they will no longer incur the development costs that arose from having to build, run, and maintain an off-chain server and/or scripts to feed prices on-chain.
Like the FPR, the APR can also be represented by the
KyberReserve.sol contract. Reserve managers will instead interact with the
LiquidityConversionRates.sol contract to set the initial liquidity parameters.
The Orderbook Reserve will be updated to be compatible with the Katalyst upgrade.