Proposal — Part 2: EOS RAM Market Dynamics
If you haven’t read the first part of my proposal titled Proposal — Part 1: A different EOS RAM Market Model go ahead and read it first so you can follow.
When I introduced a proposal in my previous post (link above), I said I would tease. I also said that even if one has a broader picture on how to improve something, it shouldn’t stretch too far not to risk driving the cost of bridging the old with the new too high. So this is step 2 now.
In the first part I introduced you to a different working market model for EOS RAM management, which roughly shows you how to generate and distribute RAM availability based on supply and shares (staked EOS), how inflation and deflation work and bring some sustainability and predictability to the model, how they affect cost and overflow (another word for debt) and how it still guarantees free memory, removes speculation from RAM and helps to stabilize the market.
Now let’s build on it, shall we?
Assumptions
Let’s say we start our mainnet with a total supply of 1 000 000 000 EOS. Booting the system with 64GB means that availability is set to 0.067108864 KB per 1 EOS. But one needs at least 4KB per account, which means that any account would need to hold a minimum of 59.60 EOS for it to be even viable under these premises. This would also mean that 3.73 TB should be the minimum system RAM, so that each account would need to hold only 1 EOS to start with, no more. But 1 EOS is not actually the minimum unit or quantity someone can hold, 0.0001 EOS is: so 36.38 PB would actually be the minimum system RAM required for a user, and every possible user, to be able to create an account with the minimum amount of EOS possible. Wow!
Clearly these initial memory requirements don’t seem very well thought of and even the new proposed model, at first sight, doesn’t immediately satisfy when considering proportionality between minimum network requirements and EOS supply as a distributable collateral for RAM.
The current market model for RAM is anyway limited regarding how many accounts can be created: 16 777 216 is the maximum number of accounts we can create with 64GB of memory (4KB each) and this assuming that all memory is allocated for account creation only. This means that regardless of how many EOS there are in circulation, the maximum supply is not necessarily determined directly by EOS itself but by account number and size instead which, consequently, affects our collateral participation for RAM distribution.
Let me explain.
If we max out the 64GB and create 16 777 216 accounts with 4KB each, as it is the minimum required memory per account (and from my proposed model we know that RAM trades in percentage to a certain staked collateral in regards to total supply) each account would start with -59.6 EOS debt in RAM staked balance (the cost of using 4KB) regardless of how many EOS each user holds unstaked.
Think of it like every possible user overflowing RAM usage in the beginning just for having an account and the remaining available RAM being caped at 0MB until people start actually staking/buying RAM to use. This, again, in a maxed out capacity. The system would be totally bursting.
So everyone would have an account but be limited in how much RAM they could claim to use — not to even mention all the extra EOS one would still need for CPU and bandwidth. If a user were to need more RAM to run their dapp, then one would have to, first and foremost, pay their debt which would release capped memory into the system and then pay to use more memory according to their own needs and system availability — when there’s none left.
Now to make things more interesting: since we still have plenty (98%) of RAM available in the current system and we shouldn’t need to upgrade to 36.38PB of RAM to bring account creation cost down to 0.0001 EOS (how much unused space that would be!), given that EOS doesn’t translate directly to RAM availability and since account number and size actually condition/limit RAM usage… why reserve in advance all the RAM available in the system and assign it proportionally to every issued EOS?
That’s where the problem starts for many people who, unconsciously, consider things under the assumption that RAM must be necessarily distributed as a function of all circulating EOS supply. RAM would be reserved from the start and embedded directly into every existing EOS unit available. The cost of extracting RAM from literally every single circulating EOS, would be clearly humongous if one has to suck it out of everything he owns and more, just to be able to satisfy high memory requirements, like an airdrop for example.
Same problem as eos Dublin proposal: with 64gb ram I would need 575k usd to reserve memory for a simple airdrop. Way too expensive
— Josep - eosBarcelona
If you stick with the assumption that collateral must come from each and all of the more than 1 billion EOS issued and circulating in the network then you are right: the market model I drew doesn’t seem quite viable anymore. But no functional model does either.
In the example I wrote in the first part of the proposal I used 1000 EOS as total initial supply for RAM collateral which proved the point for the example. In reality though, EOS mainnet’s initial supply was more like a billion; that changes things, does it?
Well, let’s recap: the proposed model demanded that we use a total supply of something as collateral for RAM trading and that a user is able to claim his entitlements by staking as much collateral as he can afford and wants to, but whose limitations are defined by how much collateral he actually holds in regards to the total supply of that same something. It also introduced inflation and deflation as controlling mechanisms for memory usage and availability.
The Tunnel
But what if we didn’t consider the total circulating EOS supply as collateral for RAM distribution? What if inflation didn’t vary with how many new EOS were issued as rewards today and what if BPs didn’t need to buy/release memory “all the time” to deflate the market — as some people fear?
Let’s start by considering the 163 930 accounts that were created at EOS network’s genesis. At a cost of 4KB each, we need to issue 640.3515625 MB worth of debt in total, to boot the system. That’s roughly 0,9771% total debt, when the system comes with 64GB of memory available from the start.
What about collateral? Well, let’s start with no collateral. If the total supply of collateral is 0 then 0,9771% debt on that collateral is also 0. Does that mean that the cost to create 163 930 accounts is 0? No, it means that the cost of issuing RAM to create those initial accounts on boot is 0, because no one is trading RAM yet. Once the system boots and people want to create more accounts, then someone has to start buying RAM in order to do so and therefore define some collateral to trade and pay their debts.
What about inflation and deflation? Clearly those would start as 0 as well. Also, adding RAM to the system at this moment would only change the amount of total debt as a percentage of the available RAM, it wouldn’t even change the used space itself which is obviously the same. Regardless, 64GB is not that much to start with actually, but anyway…
Ok, so how should we define collateral in order to start buying or trading RAM?
The Light
Collateral
Imagine you want to start buying RAM to use and you decide to stake 10 EOS for that purpose. Since you are the first one to do so, you are the only one offering collateral, so far, for the RAM you want to use. Those 10 EOS will define your actual share of the total supply and coincidentally be the same as the total supply for now — we don’t know if anyone else even wants to buy RAM, right?
Wait! Is that RAM cap value correct? Am I (User A) able to buy with 10 whole EOS only all the available RAM left? In a manner of speaking yes, but staking means you declare intent of having RAM available for you to use (you don’t stake EOS to buy RAM directly, remember?) and so far you are the only one interested in using RAM and declaring it by bringing in EOS as collateral.
Okay, so what if User B sees that and he also wants to stake 10 EOS in order to have RAM available for him to use as well?
Now the whole available RAM is split equally between users A and B since they both paid the same collateral and hold 50% of the shares on that collateral. Suddenly the cost or debt for having an account doubled — there’s twice as much interest in RAM now. User A’s staked balance decreased but User B also had to pay the same to get his fair share.
And what if User B suddenly decides to offer more collateral since he believes he will need to use more than 50% of the available memory or just because he’s a jerk and wants User A to be entitled to less memory?
We can see that, again, the cost of holding an account got higher and not only for user A but also for user B. On one side, User B decides to stake more EOS as collateral but on the other side, if he doesn’t use the space he’s just raising the relative cost of RAM, including to himself.
The good thing is that the cost is measured as a percentage of the collateral supply so if later User B decides not to offer so many EOS as collateral anymore the costs are actually lower and everyone is automatically reimbursed without needing to do anything. This way it doesn’t make sense to directly speculate on RAM prices because price is not fixed, but variable/relative.
Just out of curiosity: if every genesis account created (163 930) were to just stake 1 EOS as collateral for RAM, assuming they all actually have it — which they don’t — the initial cost of holding an account wouldn’t be higher than 0.0098 EOS and everyone would be entitled to 0.3998 MB of available RAM from the start with no debt in the system whatsoever.
If however we consider 307 000 000 EOS as total collateral supply — roughly as many EOS used in voting at the time of writing — an account would cost 18 EOS. Wait, what?? Yes, with only 64GB and 30% of the whole EOS world wanting to claim RAM for usage, it would hint you that perhaps such high demand requires a little bit more than 64GB to function properly, no? Just by increasing system memory to 2TB — which still isn’t that much for such a high demand of network RAM — the cost of an account would come down to 0.57 EOS. Uffff!! In this scenario if everyone would stake at least 1 EOS as collateral, everyone would get 7KB which is more than what most people currently use or need and there would be no debt in the system either.
Usage and Debt
Moving on: let’s say that user A finally needs to use some RAM, so he gets greedy and takes 1GB of the 64GB available in the system, although he is actually entitled to approximately 5.82GB in total — after all there’s not many people yet interested in RAM and offering collateral for it. Under the current circumstances, that should cost him around 1.5625% more of collateral only, which in this case is equivalent to 1.71875 EOS being traded from his staked balance.
Suddenly the big bad user B decides to stake all of his balance (1 000 EOS) and since he is the one that offers most collateral for RAM he is now entitled to 99% of the RAM, including some part that, in the meantime, user A decided to use during his greedy mood.
For this reason user A is now in debt, as in, he took too much of this precious available system resource called RAM without having, in the end, staked enough collateral to claim that much, compared to other users who were promptly ready to do so shortly after.
Although user A doesn’t loose the RAM he already used, if he wants to buy more RAM it would be considerably more costly for him now compared to others since he would have to pay his debt first and then add the cost of RAM he wants to use on top of that. He could also choose to release some of that memory back to the system by deleting some records, so that he is not in debt anymore.
Assuming User A actually wants to pay for the excess memory not only he would have to stake and pay the ~5.7813 EOS debt but since staking more EOS will raise the cost of RAM, in the end he would have to spend a little bit more than that, 5.8731 EOS to be exact, in order to get rid of his debt entirely.
So we see that it can be a bit of a game to either claim or stake either too much or too little as collateral, but when usage drives the supply all forces will balance themselves out in the end. Since there’s no profit at all in speculation, being RAM cost always relative: no one has anything to gain from using (buying) or “unusing” (selling) RAM, unless they actually need to.
Inflation and Deflation
What about inflation? What is it for? Do we really need it? Like mentioned before, these are controlling mechanisms for memory usage and availability, together with RAM production, and I’ll explain the how and why.
In the previous post I gave you an example where daily inflation was always positive and constant: 12 EOS added per day to the collateral supply. Now imagine that inflation, contrary to what you probably assumed, doesn’t come from BP’s claimed rewards but from fluctuations in the network’s interest/needs for memory usage, by staking/unstaking collateral.
How so?
Before I go there: imagine that user A and user B were the first among 163 930 users to have access to the network at boot and despite risking falling in debt later when every other user also wants to give collateral and claim memory to use, they go ahead and stake their EOS and immediately use as much of the system’s memory available as they can since, until the other users show up to the party, they are actually entitled to the whole of it.
So how do you prevent this, you ask? Well that’s where inflation/deflation mechanisms come in.
In a similar way to which CPU and bandwidth are restored after 3 days, both staking and unstaking collateral for RAM could also take 3 days before becoming available and the user could do anything else.
Think of it as limiting how much a user can stake/unstake at once in order to avoid price pumps and dumps that do nothing else but quickly over in- and deflate the system — because price is always relative anyway. Also think of it as having interest in RAM (staking EOS as collateral) be declared publicly and allowing others to also declare their interest before anyone rushes to claim too much RAM, like greedy user A above, without giving a chance for others to do so as well.
And how does it work exactly?
So, user A wants to use memory and stakes 10 EOS. These 10 EOS will not be immediately available for him to use (it takes time to make RAM available) but only 3 days later. In the meantime these 10 EOS are added to collateral supply through inflation, at a rate of ~0.00003858 EOS per second (10/259 200 seconds) or ~3,3333 EOS per day (10/3). In other words, the total collateral supply increases at that rate, despite the staked EOS not being available to the user yet.
Now user B sees that inflation is not 0 anymore, which means that someone is interested in using RAM and willing to offer collateral for it. Since user B is also interested in using RAM he decides to stake 100 EOS. Again, these 100 EOS will only be available to him in his staked collateral balance 3 days later, but now the inflation grew to ~36,6666 EOS per day or ~0.00042438 EOS per second.
Σ(staked collateral in the last 3 days) / 259 200 seconds
After 3 days, both user A and user B get their respective staked EOS as collateral balance and can start using the memory that was made available to them. Also, since no one else staked more EOS as collateral in the meantime, the inflation is now 0 again and total collateral supply is 110 EOS.
What about deflation (or negative inflation)?
Well, user B actually thinks that 100 EOS is too much collateral and decides to withdraw/unstake 60 EOS and leave only 40 EOS staked. So these 60 EOS are immediately removed from his staked balance, but are not available to him yet since it will also take 3 days to restore them back into his wallet.
Nevertheless, as user B unstakes those 60 EOS, the inflation rate changes to -0.00023148 EOS per second or -20 EOS per day. 3 days later user B is credited 60 EOS back into his wallet, the inflation rate is 0 again provided that no one staked or unstaked collateral anymore in the meantime, and total collateral supply for RAM is 50 EOS (10 from user A and 40 from user B).
So inflation is always measured by how many EOS were staked and unstaked as collateral for RAM in the last 3 days.
Σ(staked collateral in the last 3 days — unstaked collateral in the last 3 days) / 259 200 seconds
This mechanism provides some predictability and stability to the RAM market, as mentioned before, giving also some time for BPs to react and adjust, if need be, to situations where adding more RAM might be encouraged in order to maintain healthy network requirements.
Also having EOS unavailable from the wallet for at least 6 days (3 days to stake plus 3 days to unstake) should discourage people from being playful and stick to managing collateral only according to what their memory requirements demand in face of the network’s global interest in RAM usage.
Delegating RAM
Another option I hinted to in my previous post was to the possibility of users delegating RAM to each other. This is complementary and not necessarily part of the model, although it can bring some benefits to it.
Allowing users to delegate RAM, given the timings imposed by the controlling mechanisms of inflation/deflation and an eventual sudden need to access memory and fast, brings RAM liquidity to the game. A user can ask or transfer RAM already available from another account to himself temporarily, until the new EOS he stakes as collateral to use the extra RAM he needs are available.
Also, the cost of airdropping for example doesn’t need to fall necessarily and completely on the token issuers. The issuer can alternatively ask users to delegate memory to them, in a contract, for the purpose of token distribution. It would still be considered an airdrop and not an ICO, similar to having users paying not for the token itself but for gas in ETH to cover the transaction costs of receiving a token.
RAM Production
RAM production refers to the act of adding/releasing memory into the system. This can happen either all at once by directly supplying all available physical RAM in the system to the network, or in batches by releasing RAM gradually in a way that is predictable and that the majority of BPs agree to.
Since cost in this market model is always relative, producing RAM would make it look like the system suddenly deflated, although it wouldn’t really matter in the end because it does not directly affect RAM usage and also cost is not affected by collateral speculation — it is usage that drives supply.
The function of RAM production, then, is solely that of providing the network with enough resources to grow in a sustainable manner.
Unlike collateral supply, which can increase and decrease according to memory requirements through inflation and deflation, RAM production can and should only increase for obvious reasons related to space usage.
The Curtain
Understanding the proposed model and the mechanics are two different things. And it is important, in my opinion, to let assumptions develop in order to question and discuss them, bringing different perspectives into the scene, which can then pave the way to new solutions. This is a new solution I wanted to bring forward to the community.
Despite the long read and if for no other reason, I hope that it makes you question what we sometimes take for granted, that is nothing but mere assumptions built on top of otherwise valid but different foundations.
This proposal intends to give RAM the consideration it deserves as a technical resource and not as an economic resource / asset. Let’s treat it like such. Thank you for your time. Go EOS!
Copyright and attribution are implicit.