Notes on REX

Milena Mileo
EOS Argentina
Published in
5 min readNov 15, 2019

Introduction

Our team has been studying the REX algorithm in depth and we have been following the discussion regarding the use of resources.

In this post we want to explain some aspects of the REX contract and also present an alternative to improve the pricing of lending resources.

First of all, it is important to state that the EOS resource allocation and the REX contract are working as expected, people rent CPU and NET to then use them to make transactions on the network. The system can be perfected but it is fair to say that using the rented resources is neither a bug or an exploit.

In simple terms, the price of the resources which are available for lending is determined by a formula that increases it as the quantity of available resources diminishes.

However, there is a 16% reserve (20% of total lent) that aims to prevent the renting cost rate to suddenly fall below a reasonable value. This could happen with the current formulas in certain scenarios.

The portion that cannot be lent results in inefficiency, since these resources could be used to benefit both buyers and sellers of resources.

The threshold has been imposed because of certain instabilities in the underlying formulas. It is possible to argue that even if the threshold mitigates those instabilities, they are not completely solved.

What is happening now is that all of the available resources of REX have already been borrowed by EOS users. For the loans to resume we would need more people to put their EOS into the REX contract (buy REX) or for the current loans, whose duration is thirty days, to expire. The amount of these two elements needs to be greater than the amount from people selling REX to retrieve their EOS tokens.

The community has come up with some proposals to counteract the current situation. We have developed an alternative pricing model that we would like to present as a contribution to the conversation.

In our opinion, the REX algorithm could be improved.

  • The point of this alternative is to create a different model that is stable and can determine the price without a threshold.

For this, the rental fee in our proposal is determined automatically as a function of x = u/T, where u is the total unlent funds in REX and T is the total EOS supply. The price must increase when x decreases, and vice versa. The choice of this function f is intrinsically arbitrary. However, we believe that a sensible f is possible, and we will directly give one.

We start by assuming that f has the following form for certain constants c1 and c2:

The scale of f is such that f (x) is the APR of a loan at state x. Now we impose f(0) = 20 and f(0.01) = 1. These constraints mean that a maximum of 20% APR is allowed, and 1% APR is reached when u/T = 1/100. They lead to:

The two graphics correspond to f at different scales and different intervals for x:

Observe that when the APR gets close to 1% or larger, the unlent resources are considerably low, namely, close to 1% or less. By looking at the curve we see that not much resources would be idle when the demand grows.

Starting from this f we will now derive the exact formula to determine the price of a loan at a certain state. The price, again measured in APR, must be computed as the average of the price along the path from the initial to the final state. The final state is the value of x after the loan is issued (the values of T remain equal). Luckily, the integral of f is easy to compute, thus the price of a loan taking x from xi to xf is:

Here ∆x = xf − xi and the amount of rented resources is simply T(xi − xf ). The last expression can be used to find xf in terms of the other variables. The price is expressed in APR, so it should be converted as necessary according to the actual duration of the loan.

Notice that the squared factor (c₂+x)² in the denominator at f, is split into (c₂+xi)(c₂+xf ) in the formula of an actual loan. When the amount of lent resources of the loan is small compared with the total available, these two quantities are approximately equal.

The precise values of c and c can be modified if considered convenient. However, starting from the values provided in this article as a reference, it seems that the model provides a reasonable ground for price discovery and stability.

Regardless of which solution ends up being implemented, we believe that there is an important lesson to be learned out of the current situation:

The EOS Resources are valuable and have a very high demand, which in the end is positive for all the token holders.

Feel free to join the discussion in our main channels:

Telegram | Twitter

References

[1] Analysis of Bancor Equations Supporting REX

[2] REX Implementation

--

--

Milena Mileo
EOS Argentina

Multimedia Ninja. Working as Digital Comms & Brand Strategist for @eosargentina