This technical update will dedicate a significant part of the post to describe the architecture of Kyber reserve, followed by the development status and what the development team intends to achieve in the near future.

Reserve Manager Simulation Framework

The reserve manager system’s role is make price discovery of traded tokens (i.e., decide their conversion rate) and maintain sufficient token inventory in the smart contract to support expected trading volume by rebalancing the inventory. We have described the considerations that were taken into account for the design of pricing and rebalancing strategies in an earlier post. So, in this post, we will emphasize our work in the last few weeks, up until the development of a testing framework for reserve strategies.

Framework objectives

The main objectives of the framework are:

To identify and repair bugs in strategy implementation. Evaluate the performance of a strategy (i.e. net loss/profit).

If carried out properly, these two objectives should be attainable without spending real funds or even putting actual funds on risk. Moreover, the reserve manager implementation should work seamlessly with the testing framework and with the real (production) framework.

In the next section we explain the basic architecture of our testing framework, followed by the enhancements that allow us to have a quick testing environment, which we have installed recently.

Basic testing framework

In the testing framework, we extrapolated various expected user behavior profiles, as observed from platforms such as Shapeshift and Changelly and employed the discovery as a benchmark for testing.

Testnet deployment

Our Kovan testnet deployment generated practically infinite amount of tokens of any type, which had allowed us to set up artificial centralized exchanges that can serve any trade order (albeit, the amount of testnet ether is still very limited when using public testnets) and simulate activities on those exchanges.

Exchange simulator

For the basic framework, we have developed a simulator module to simulate the behavior of centralized exchanges such as Binance and Bittrex. In addition to responding to restful APIs which are identical to real exchange APIs, the simulator also imports actual order books from various exchanges. The simulator allows reserve managers to deposit and withdraw tokens by identifying the corresponding testnet deployment addresses of every token. Last but not least, the simulator also simulates the expected delays in deposits and withdrawals that occur in centralized exchanges (in addition to small delays in order executions).