Introducing Proto RAI

Stefan Ionescu
Oct 29, 2020 · 6 min read

A stepping stone in on-chain control theory

After months of research and building, we’re excited to unveil our first, full Ether backed asset called Proto RAI!

What is Proto RAI?

Proto RAI (PRAI) is an unaudited mainnet demo of our upcoming reflex index called RAI. PRAI is managed and repriced by a primitive version of our on-chain, autonomous PID controller. Check our whitepaper for a description of the controller and for the system as a whole.

The purpose of this demo is to test and improve our tooling and smart contracts, bootstrap an initial group of keepers that liquidate undercollateralized positions as well as gather live data which can help us update our market model and simulations. This is why in the first couple of weeks we will focus exclusively on developers. After we finish our initial audits we will invite more people to join.

If you would like to monitor the system, you can use this simple dashboard.

How Do I Create PRAI?

In order to create PRAI, you need to deposit Wrapped ETH into a smart contract and open a new position which we call a “Safe”.

At this stage we do not have a webapp to facilitate the creation of PRAI although we encourage developers to use our Typescript and Python libraries as well as our CLI in order to interact with the system. This video guide and our documentation walk you through using the Typescript library with proxy contracts in order to generate PRAI backed by (W)ETH.

We advise everyone to exercise caution and avoid using large amounts of Ether when they test the system. Do not risk more than you can afford to lose.

What Can I Do with PRAI?

Currently you can trade PRAI for ETH using this Uniswap V2 pool. Please be aware that the pool does not have a lot of liquidity.

Key System Parameters

There are several system parameters that everyone should be aware of:

What if Something Goes Wrong?

In case of a fatal bug or a black hat draining all (or part of) the system collateral, we will announce on Discord, Telegram and Twitter that we are shutting down the protocol. We will also coordinate next steps with the community on Discord.

Bumpy Start

After we deployed the system, we discovered that we did not properly set authorized addresses inside the ERC20 PRAI contract. Because of this, we were not able to add new authed accounts or remove old ones.

We decided to disable the original CoinJoin contract which allows users to transfer PRAI between the core system and the ERC20 contract. Users (mostly bots that traded in the old Uniswap pool) who hold old PRAI tokens can now call the old CoinJoin in order to join() tokens inside the system. They can then use the latest CoinJoin and Coin contracts in order to get new PRAI tokens and trade using the new Uniswap PRAI/ETH pool.

We also had to disable the old treasury and abandon the initial Uniswap v2 PRAI oracle in favor of new versions that are integrated with the latest Coin/CoinJoin.

Next Steps

We are planning to run this demo for at least 3 months, at which point we will trigger Global Settlement. We will then gather all the mainnet data and analyze it in order to re-evaluate our models and further tune the controller.

We may decide to extend the duration of the demo although at this point the community can assume that it will only be a temporary system.

As outlined above, in case an exploit is found or someone manages to game the controller, we will need to shut down earlier than planned. Whatever happens, we will announce the shutdown on all our channels so that the community is kept up to date.

General FAQ

How does the PID controller currently work?

At this moment the PID is disabled because we launched earlier than initially planned and did not yet finish our initial R&D. We plan to start the controller in the next 2–4 weeks and will inform the community about this change beforehand.

Where can I find the controller code?

For now we are keeping the controller code (as well as the simulations/market model) closed source. As we move forward, we will let the community know when we plan to release details about our research.

All the other contracts are open-source and you can find their addresses here.

What is the status of your PID research?

We have the basic smart contract and simulation infrastructure in place which can help us choose initial parameters for the controller as well as validate the behavior of our Solidity implementation compared to the Python models.

The next steps consist in stress testing our models, building a system that allows us to visualize on-chain data in real time and analyzing the data coming from this demo in order to inform our design revisions.

When do you expect to open-source the remaining code and research?

When we’ll launch and announce RAI we will also publish a schedule where we say exactly when we will open-source the remaining Solidity code as well as start to publish articles about our research and show our models.

What are the risks of using Proto RAI?

There are several risks associated with using PRAI:

You can find our more about system risks in our documentation. Every sub-section is continuously updated with more edge cases and undesirable scenarios that users should be aware of.

How do you plan to minimize the above mentioned risks?

We have several ongoing initiatives:

Where can I find out more about the project?

Join our Discord channel!

Do you have a bug bounty program?

Right now we do not have a bug bounty program although we plan to create one after we finish the first round of smart contract audits.

Is there a governance or protocol token?

There isn’t any token apart from Proto RAI (PRAI) which can be found at this address. PRAI holders do not have governance rights.

Do you have yield farming/liquidity mining?

We do not have any yield farming or liquidity mining initiative.

Where can I find the deployed smart contracts?

The latest contract addresses can be found here. You can also see the full deployment history in our changelog.

How do you change protocol parameters?

We’re using a multisig deployed at this address.


Video Guide on How to Create PRAI:
Stats Dashboard:
Mainnet Subgraph:
Uniswap PRAI/ETH Pool:

Reflexer Labs

Research publication and newsletter about reflex indexes