{"id":70,"date":"2018-06-20T21:33:19","date_gmt":"2018-06-20T21:33:19","guid":{"rendered":"https:\/\/abhashstempblog.wordpress.com\/2018\/06\/20\/the-mechanics-behind-eosio-ram-allocation\/"},"modified":"2023-01-09T13:32:13","modified_gmt":"2023-01-09T08:02:13","slug":"the-mechanics-behind-eosio-ram-allocation","status":"publish","type":"post","link":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/","title":{"rendered":"The Mechanics Behind EOSIO RAM Allocation"},"content":{"rendered":"<p><a href=\"https:\/\/eos.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">EOS<\/a> has been on the news quite a lot lately because of the sheer amount of intrigue that has surrounded its mainnet launch and ICO. In this article today, we will talk about RAM trading in EOS, which has become quite a contentious subject of debate in the crypto-community. However, before we do so, let\u2019s give you a small introduction.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_77 counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#Resource_Allocation_and_EOS\" >Resource Allocation and\u00a0EOS<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#The_RAM_Quandary\" >The RAM\u00a0Quandary<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#The_RAM_Marketplace\" >The RAM Marketplace<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#Future_Expansion\" >Future Expansion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#Upcoming_Parallelism\" >Upcoming Parallelism<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#How_Much_RAM_Do_You_Need\" >How Much RAM Do You\u00a0Need?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#How_Much_Will_Cryptokitties_Cost_on_EOS\" >How Much Will Cryptokitties Cost on\u00a0EOS?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#Does_Every_EOS_Holder_Need_RAM\" >Does Every EOS Holder Need\u00a0RAM?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#Buy_and_Sell_RAM_Functions_Looking_at_The_Code\" >Buy and Sell RAM Functions. Looking at The\u00a0Code.<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#RAM_Hoarding\" >RAM Hoarding<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"#\" data-href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#Conclusion\" >Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"Resource_Allocation_and_EOS\"><\/span><strong>Resource Allocation and\u00a0<\/strong><a href=\"https:\/\/eos.io\/\" target=\"_blank\" rel=\"noopener noreferrer\"><strong>EOS<\/strong><\/a><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>EOS plans to become a decentralized operating system, that Dapp developers can utilize to create and code various Dapps. The EOS tokens basically act as a toll booth and holding them gives you access to various resources such as Bandwidth, Computation, RAM etc. Now, since these resources are scarce, EOS doesn\u2019t want you to hold on to their tokens for too long.<\/p>\n<p>In fact, the company behind EOS, <a href=\"https:\/\/block.one\/\" target=\"_blank\" rel=\"noopener noreferrer\">Block.one<\/a>, has explicitly mentioned in the platform <a href=\"https:\/\/github.com\/EOSIO\/eos\/blob\/5068823fbc8a8f7d29733309c0496438c339f7dc\/constitution.md\" target=\"_blank\" rel=\"noopener noreferrer\">constitution<\/a> that EOS members who don\u2019t use their tokens for three years would get their account terminated.<\/p>\n<p>So, the way it works is, you stake some of your EOS tokens and get some of the resources in exchange. However, it is not this straightforward when it comes to RAM.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"The_RAM_Quandary\"><\/span><strong>The RAM\u00a0Quandary<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>RAM is an extremely powerful and critical resource for blockchains. Since scalability and performance is all the rage nowadays, you can see why the \u201chunt for more RAM\u201d will eventually become the most important issue for all EOS based Dapps.<\/p>\n<p>In Dawn 3.0, RAM pretty much acted the same way as the other resources. If you staked a certain amount of EOS tokens to get RAM, then you can sell it for the exact same amount of tokens. Early adopters are obviously going to get the resources for pretty cheap, since the demand will be comparatively low, however, this is where we face the first problem.<\/p>\n<p>As more and more users join the EOS network, the supply for RAM will go down, which will in turn shoot the demand off the charts. \u201cSupply and Demand\u201d is one of the most basic features of microeconomics.<\/p>\n<p>The supply-demand graph looks like this:<\/p>\n<figure class=\"wp-caption\"><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png\" data-width=\"894\" data-height=\"770\" \/><figcaption class=\"wp-caption-text\">Image Credit: <a href=\"https:\/\/blockgeeks.com\/guides\/ethereum-token\/\" target=\"_blank\" rel=\"noopener noreferrer\">Blockgeeks<\/a><\/figcaption><\/figure>\n<p>The sweet spot where both the curves intersect is the equilibrium. To simplify things, as the demand for a particular asset increases and its supply deceases, its price should increase appropriately.<\/p>\n<p>However, with the Dawn 3.0 model, holders were forced to sell off their RAM for the same amount of tokens that they bought it for in the first place, regardless of the supply and demand for RAM. As such, they had absolutely no financial and economic incentive to sell off their RAM.<\/p>\n<p>Plus, also keep in mind that Block.one has already determined in their testing that the way the EOSIO System Contract was allocating RAM to stakeholders would inevitably lead to shortages down the road.<\/p>\n<p>Dan Larimer and the Block.One team realized that a more incentivized cryptoeconomics-driven ecosystem needed to be created which will ensure RAM availability.<\/p>\n<p>The solution? The RAM marketplace.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"The_RAM_Marketplace\"><\/span><strong>The RAM Marketplace<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>EOSIO is using a market-based allocation approach for RAM by utilizing <a href=\"https:\/\/www.geeksforgeeks.org\/operating-system-bankers-algorithm\/\" target=\"_blank\" rel=\"noopener noreferrer\">Bancor\u2019s algorithm<\/a>. In simple terms, they are creating a RAM Marketplace. Personally, we feel that this is a very smart approach because it aligns RAM, their rarest asset, in accordance with the supply and demand graph.<\/p>\n<p>So, how is this marketplace going to work?<\/p>\n<p>Each time someone buys or sells RAM, a 0.5% fee is applied on both the buyer\u2019s side and the seller\u2019s side (1% overall). This actually gives an economic incentive for users to sell their RAM and also it discourages speculative marketing and inflation as the fees that are collection are promptly burned (removed from the ecosystem).<\/p>\n<p>This internal RAM marketplace will make sure that there is a steady availability of RAM and will offset any future predicted shortages. You will be able to buy RAM based on the price that the system sets it at, which is based on the current available supply of RAM.<\/p>\n<p>This marketplace also creates another interesting way that one can reduce speculation. A block producer can add more RAM at any point to the marketplace and shoot supply off the roof. This increase in supply will obviously decrease the price of RAM as well.<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*WHmtRGkT9779clXcmkviZA.png\" data-width=\"808\" data-height=\"842\" \/><\/figure>\n<h3><span class=\"ez-toc-section\" id=\"Future_Expansion\"><\/span><strong>Future Expansion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>So, how will the marketplace behave in the future. For that, let\u2019s first acquaint ourselves with Moore\u2019s Law. According to <a href=\"https:\/\/www.investopedia.com\/terms\/m\/mooreslaw.asp\" target=\"_blank\" rel=\"noopener noreferrer\">Investopedia<\/a>:<\/p>\n<blockquote><p>\u201cMoore\u2019s law refers to an observation made by Intel co-founder Gordon Moore in 1965. He noticed that the number of transistors per square inch on integrated circuits had doubled every year since their invention.<\/p><\/blockquote>\n<blockquote><p>Moore\u2019s law predicts that this trend will continue into the foreseeable future. Although the pace has slowed, the number of transistors per square inch has since doubled approximately every 18 months. This is used as the current definition of Moore\u2019s law.\u201d<\/p><\/blockquote>\n<p>Moore\u2019s law gives you a pretty healthy indicator of the future value of an asset. According to Larimer, if EOS grows in accordance with Moore\u2019s Law, block producers should be able to upgrade to 4TB or even 16TB of RAM. This increase in supply will decrease the price of RAM in the marketplace.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Upcoming_Parallelism\"><\/span><strong>Upcoming Parallelism<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The next thing on the developer\u2019s list is to scale up RAM usage. \u201cHigh performance\u201d is the need of the hour in the blockchain space and in order to do so, they require all the data that is available inside the RAM. An interesting approach to this is side chains usage with independent memory regions.<\/p>\n<p>In essence, EOSIO block producers can operate on multiple chains and use the same token for buying RAM. The producers will be selected via elections that will happen on the main chain, and they will get to access the sidechains once elected. Each side chain will have &gt;1TB of its <em>own <\/em>RAM and will have the ability to communicate with each other.<\/p>\n<p><strong>Note: <\/strong>EOS will require their own block producers to run the side chains. The idea is to perform cross-chain communication for the side chains to interact with the main chain.<\/p>\n<p>Now this is where things get interesting because it opens up two interesting possibilities:<\/p>\n<ul>\n<li>Firstly, the price of RAM will vary from sidechain to sidechain. So a Dapp developer can choose to operate on a sidechain where they are getting the cheapest price. This, in essence, will create healthy competition between the sidechains.<\/li>\n<li>Secondly, using inter-blockchain communication, Dapps can gain the ability to buy unused RAM from the other chains. Because of this, Block.One believes that \u201cmany applications will prefer the many-chain approach to scaling as it will lower overall costs and scale faster.\u201d<\/li>\n<\/ul>\n<h3><span class=\"ez-toc-section\" id=\"How_Much_RAM_Do_You_Need\"><\/span><strong>How Much RAM Do You\u00a0Need?<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>EOS New York has created an extremely useful tool for all EOS developers to know how much their resources will cost. The tool is called EOS Resource Planner and you can check it out <a href=\"https:\/\/www.eosrp.io\/\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/p>\n<p>The Planner gives you two handy tools.<\/p>\n<ul>\n<li>One that calculates how much RAM, Network Bandwidth, and CPU Bandwidth you can afford in accordance with how much EOS you are willing to stake for each.<\/li>\n<li>The second tool will let you know how much EOS you need to stake to get certain specifications of each resource.<\/li>\n<\/ul>\n<p>Let\u2019s look at an example of each.<\/p>\n<p>Suppose, you want to buy 500 EOS worth of RAM, 400 EOS of Network Bandwidth, and 300 EOS of CPU Bandwidth. According to the tool you will get:<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*0WqTLhwaUwKwSctM5VcOuw.png\" data-width=\"435\" data-height=\"497\" \/><\/figure>\n<p>So, according to your resources you will get 28369297.3280 bytes of RAM, 552140623.3150 bytes\/day of Network Bandwidth, and 79293966.5221 us\/day worth of CPU Bandwidth.<\/p>\n<p>You spent overall 1200 EOS for these resources, which at current evaluation comes down to roughly, $12,960.<\/p>\n<p>Now, suppose you have the resources in mind, but you don\u2019t quite know how much EOS you will need, you can calculate that here as well.<\/p>\n<p>Suppose you are making a hypothetical Dapp which needs:<\/p>\n<ul>\n<li>1 GB RAM<\/li>\n<li>30000000 bytes\/day Network Bandwidth<\/li>\n<li>45000000 us\/day CPU Bandwidth.<\/li>\n<\/ul>\n<p>For these resources you will need:<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*suBzgIcrRu6sPBDlEoekPA.png\" data-width=\"480\" data-height=\"505\" \/><\/figure>\n<p>18924.36 + 21.73+ 170.25= 19116.34 EOS total<\/p>\n<p>At current valuation, that stands at: ~$200721.57 USD<\/p>\n<h3><span class=\"ez-toc-section\" id=\"How_Much_Will_Cryptokitties_Cost_on_EOS\"><\/span>How Much Will Cryptokitties Cost on\u00a0EOS?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Whenever we think talk about a new smart contract platform, we need to invariably ask the \u201cCryptokitties question.\u201d When Ethereum launched Cryptokitties, it jammed up the network so badly that a couple of ICOs were forced to postpone their crowd-sale. In fact, Cryptokitties brought to light how desperately Ethereum needed immediate scalability solutions.<\/p>\n<p>So, how much will something like Cryptokitties cost on the EOSIO network? Before we continue, you need to take note of two things:<\/p>\n<ul>\n<li>Holding EOS tokens gives you the right to a certain amount of free transactions.<\/li>\n<li>In real life scenarios, EOS has till now managed ~600 transactions per second.<\/li>\n<\/ul>\n<p><a href=\"https:\/\/www.youtube.com\/watch?v=EBC9MBybsCI\" target=\"_blank\" rel=\"noopener noreferrer\">This video<\/a> by \u201cThe Cryptoverse\u201d does a pretty nice breakdown of the calculations.<\/p>\n<p>Till date, Cryptokitties <a href=\"https:\/\/kittysales.herokuapp.com\/\" target=\"_blank\" rel=\"noopener noreferrer\">has had<\/a> ~393,000 sales in a ~7 month period. For ease of calculations, let\u2019s round off 393,000 to 390,000.<\/p>\n<p>So, Cryptokitties were able to do 393,000\/7 = 55,714 transactions per month which is (55,714*12 = ) 668568 transactions per year.<\/p>\n<p>Now, EOS, as of right now, manages 600 transactions per second, which comes around to 18,921,600,000 transactions per year. Keep in mind, there are current 900 million EOS in circulation.<\/p>\n<p>So, each EOS token, as of right now, will give you (18,921,600,000\/900,000,000 = )21 transactions per EOS per year.<\/p>\n<p>Now, obviously this rate will go down because of the 5% inflation, but when you consider that future innovations and addition of extra resources by the block producers will increase the overall network performance, we feel that it is going to circumvent the inflation effect.<\/p>\n<p>As we calculated earlier, Cryptokitties did 668,568 transactions per year. So, in order to do so many transactions, the Cryptokitties developers will need (668568\/21 =) 31,837 EOS tokens.<\/p>\n<p>At current valuation, that roughly comes around $318,370.<\/p>\n<p>That\u2019s how much a Dapp like Cryptokitties will cost on EOS.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Does_Every_EOS_Holder_Need_RAM\"><\/span>Does Every EOS Holder Need\u00a0RAM?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>So, this begs the question, who should buy RAM?<\/p>\n<p>As is pretty obvious, all the developers on EOS need to buy RAM to run their Dapps. However, what if you are not a Dapp developer? Do you still need to buy these resources?<\/p>\n<p>Of course not. It is completely upto you what you want to do with their tokens. Many users on Reddit have noted that even if you are not a developer, you can simply hold onto your EOS tokens to participate in various airdrops.<\/p>\n<p>There is another interesting thing that you can do with your tokens. You can simply rent out your tokens! Developers are always looking to get more resources for their Dapp. Now, suppose a Cryptokitties like Dapp becomes hugely popular on EOS. You, as a user, can donate to the Dapp by staking some of your EOS tokens for them. You can take back your stake at a later date if you are no longer interested in taking part.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Buy_and_Sell_RAM_Functions_Looking_at_The_Code\"><\/span><strong>Buy and Sell RAM Functions. Looking at The\u00a0Code.<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>So, till now you have learnt how RAM allocation and marketplace works. We are going to take a look behind the scenes and see how the EOS contract works with the buying and selling of RAM. The following methods(functions) in the EOS code deal with RAM buying and selling. (<strong>NOTE: <\/strong>The code has been taken from GitHub)<\/p>\n<p>Before we continue, let\u2019s clarify certain terms:<\/p>\n<p>\u00b7 payer: Someone who pays tokens to get RAM.<\/p>\n<p>\u00b7 receiver: Someone who sells RAM and receives tokens.<\/p>\n<h4>#1 buyram()<\/h4>\n<p>void eosiosystem::system_contract::buyram (<\/p>\n<p>account_name payer,<\/p>\n<p>account_name receiver,<\/p>\n<p>asset quant<\/p>\n<p>)<\/p>\n<p>The first method that we are going to look into is buyram().<\/p>\n<p>This method increases the payer\u2019s RAM quota based upon the price of RAM and the amount of tokens that have been provided. When this function is executed, the following happens:<\/p>\n<ul>\n<li>On buying RAM, the payer irreversibly transfers quant (quantity of tokens) to system contract.<\/li>\n<li>The payer can reclaim the tokens via sellram() method (more on this later).<\/li>\n<li>Payer pays for the storage facility of the database records needed for this action.<\/li>\n<\/ul>\n<p>RAM, being a scarce resource, is defined by the global \u201cmax_ram_size\u201d property (more on this later). RAM is also governed by the bancor algorithm such that it has a price-per-byte with a constant reserve ratio of 100:1.<\/p>\n<h4>#2 buyrambytes()<\/h4>\n<p>void eosiosystem::system_contract::buyrambytes (<\/p>\n<p>account_name payer,<\/p>\n<p>account_name receiver,<\/p>\n<p>uint32_t bytes<\/p>\n<p>)<\/p>\n<p>This is a pretty straightforward method.<\/p>\n<p>It will compute the exact amount of RAM that the payer will get and bill them accordingly based on the current marketplace price.<\/p>\n<h4>#3 sellram()<\/h4>\n<p>void eosiosystem::system_contract::sellram (<\/p>\n<p>account_name account,<\/p>\n<p>int64_t bytes<\/p>\n<p>)<\/p>\n<p>This method reduces the receiver\u2019s RAM quota and then transfers the required number of tokens to the receiver.<\/p>\n<h4>#4 setram()<\/h4>\n<p>void eosiosystem::system_contract::setram (<\/p>\n<p>uint64_t max_ram_size<\/p>\n<p>)<\/p>\n<p>This method simply increases or decreases the amount of RAM available for sale.<\/p>\n<p>There is one more interesting bit of RAM related code that you need to know. This code was brought to our attention thanks to <a href=\"https:\/\/steemit.com\/eos\/@leordev\/eos-ram-and-bandwith-analysis-2-tokens-claiming-and-achieving-zero-cost-airdrop\" target=\"_blank\" rel=\"noopener noreferrer\">this article<\/a>.<\/p>\n<p>One of the most fundamental feature of EOS is airdrop. Basically, when someone creates a project on top of the EOS blockchain, they can give away the native tokens on their project to EOS holders.<\/p>\n<p>Now this begs another question. This operation will obviously cost a lot of RAM, so what happens to the project creator\u2019s RAM after giving away all these tokens?<\/p>\n<p>Apparently, once people claim the airdropped native tokens, the project creator can claim back their RAM thanks to this piece of code:<\/p>\n<p>if( from.balance.amount == value.amount ) {<\/p>\n<p>from_acnts.erase( from ); \/\/ &lt;&lt;&lt; IMPORTANT LINE<\/p>\n<p>} else {<\/p>\n<p>from_acnts.modify( from, owner, [&amp;]( auto&amp; a ) { \/\/ &lt;&lt;&lt; IMPORTANT LINE<\/p>\n<p>a.balance -= value;<\/p>\n<p>});<\/p>\n<p>}<\/p>\n<p>Because of this piece of code, post-airdrop, once the token owners move the tokens, they will be set automatically as RAM payers. The moment that happens, the project creator will recover the initial investment they made of the RAM. That is some ingenious coding.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"RAM_Hoarding\"><\/span>RAM Hoarding<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Because of the emergence of the RAM marketplace, RAM hoarding has become quite the issue.<\/p>\n<figure><img decoding=\"async\" src=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*a5Zgfrlm55rulEc4-_ux2w.png\" data-width=\"1088\" data-height=\"616\" \/><\/figure>\n<p>It turns out that &gt;40 GB of the RAM out of an available 64 GB has already been reserved by whales. It makes sense as to why people would do that. RAM, as we have already said, is a rare resource, and a marketplace would definitely lead to whales hoarding RAM.<\/p>\n<p>Having said that, the fact that 70% of RAM has already been locked up without the presence of any DAPP with more than 300 users is extremely worrying. Plus, remember that unlike network bandwidth and CPU bandwidth, one can\u2019t rent out RAM.<\/p>\n<p>Because of this, the price of RAM has surged dramatically from <a href=\"https:\/\/hackernoon.com\/solving-ram-speculation-property-rights-in-eos-631ca10c1970\" target=\"_blank\" rel=\"noopener noreferrer\">$0.14 to $2.44<\/a> in a little over a week. That\u2019s a staggering 1643% increase!<\/p>\n<p>We need to wait and watch to see how this potential problem can be resolved.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span><strong>Conclusion<\/strong><span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>The RAM marketplace is an interesting concept which goes on to potentially a solve a lot of issues that Dawn 3.0 raised. We need to wait and watch how things play out in the future to know whether the marketplace has any legs to run on or not. Having said that, aligning crypto economic incentives and creating ready liquidity for an extremely rare resource is quite an impressive achievement.<\/p>\n<hr \/>\n<p>If you like the article, please clap and share\u00a0\ud83d\ude42 Also consider voting for us\u200a\u2014\u200awe are \u201cbpacbpacbpac\u201d<\/p>\n","protected":false},"excerpt":{"rendered":"<p>EOS has been on the news quite a lot lately because of the sheer amount of intrigue that has surrounded its mainnet launch and ICO. In this article today, we will talk about RAM trading in EOS, which has become quite a contentious subject of debate in the crypto-community. However, before we do so, let\u2019s<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1439],"tags":[18,32,50],"class_list":["post-70","post","type-post","status-publish","format-standard","hentry","category-blockchain-technology","tag-blockchain","tag-cryptocurrency","tag-eos","disable-dropcap","disable-2-columns"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.3 (Yoast SEO v26.3) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>The Mechanics Behind EOSIO RAM Allocation - Springworks Blog<\/title>\n<meta name=\"description\" content=\"In this article today, we will talk about RAM trading in EOS, which has become quite a contentious subject of debate in the crypto-community.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"The Mechanics Behind EOSIO RAM Allocation\" \/>\n<meta property=\"og:description\" content=\"EOS has been on the news quite a lot lately because of the sheer amount of intrigue that has surrounded its mainnet launch and ICO. In this article today,\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\" \/>\n<meta property=\"og:site_name\" content=\"Springworks Blog\" \/>\n<meta property=\"article:published_time\" content=\"2018-06-20T21:33:19+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-01-09T08:02:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png\" \/>\n<meta name=\"author\" content=\"wpx_blogspri\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@springroleinc\" \/>\n<meta name=\"twitter:site\" content=\"@springroleinc\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"wpx_blogspri\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"13 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\"},\"author\":{\"name\":\"wpx_blogspri\",\"@id\":\"https:\/\/blog.springworks.in\/#\/schema\/person\/bcca0568526b569054230f49ace9af63\"},\"headline\":\"The Mechanics Behind EOSIO RAM Allocation\",\"datePublished\":\"2018-06-20T21:33:19+00:00\",\"dateModified\":\"2023-01-09T08:02:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\"},\"wordCount\":2538,\"publisher\":{\"@id\":\"https:\/\/blog.springworks.in\/#organization\"},\"image\":{\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png\",\"keywords\":[\"Blockchain\",\"Cryptocurrency\",\"Eos\"],\"articleSection\":[\"Blockchain Technology\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\",\"url\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\",\"name\":\"The Mechanics Behind EOSIO RAM Allocation - Springworks Blog\",\"isPartOf\":{\"@id\":\"https:\/\/blog.springworks.in\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png\",\"datePublished\":\"2018-06-20T21:33:19+00:00\",\"dateModified\":\"2023-01-09T08:02:13+00:00\",\"description\":\"In this article today, we will talk about RAM trading in EOS, which has become quite a contentious subject of debate in the crypto-community.\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage\",\"url\":\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png\",\"contentUrl\":\"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/blog.springworks.in\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"The Mechanics Behind EOSIO RAM Allocation\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.springworks.in\/#website\",\"url\":\"https:\/\/blog.springworks.in\/\",\"name\":\"Springworks Blog\",\"description\":\"Everything about the Future of Hiring and Recruiting\",\"publisher\":{\"@id\":\"https:\/\/blog.springworks.in\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.springworks.in\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/blog.springworks.in\/#organization\",\"name\":\"Springworks\",\"url\":\"https:\/\/blog.springworks.in\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.springworks.in\/#\/schema\/logo\/image\/\",\"url\":\"\/wp-content\/uploads\/2021\/09\/Springworks-Blog-1.png\",\"contentUrl\":\"\/wp-content\/uploads\/2021\/09\/Springworks-Blog-1.png\",\"width\":548,\"height\":79,\"caption\":\"Springworks\"},\"image\":{\"@id\":\"https:\/\/blog.springworks.in\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/x.com\/springroleinc\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.springworks.in\/#\/schema\/person\/bcca0568526b569054230f49ace9af63\",\"name\":\"wpx_blogspri\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/blog.springworks.in\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/blog.springworks.in\/wp-content\/litespeed\/avatar\/e4a8c05b4b8574393eb77ee62952d5f0.jpg?ver=1775602168\",\"contentUrl\":\"https:\/\/blog.springworks.in\/wp-content\/litespeed\/avatar\/e4a8c05b4b8574393eb77ee62952d5f0.jpg?ver=1775602168\",\"caption\":\"wpx_blogspri\"}}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"The Mechanics Behind EOSIO RAM Allocation - Springworks Blog","description":"In this article today, we will talk about RAM trading in EOS, which has become quite a contentious subject of debate in the crypto-community.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/","og_locale":"en_US","og_type":"article","og_title":"The Mechanics Behind EOSIO RAM Allocation","og_description":"EOS has been on the news quite a lot lately because of the sheer amount of intrigue that has surrounded its mainnet launch and ICO. In this article today,","og_url":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/","og_site_name":"Springworks Blog","article_published_time":"2018-06-20T21:33:19+00:00","article_modified_time":"2023-01-09T08:02:13+00:00","og_image":[{"url":"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png","type":"","width":"","height":""}],"author":"wpx_blogspri","twitter_card":"summary_large_image","twitter_creator":"@springroleinc","twitter_site":"@springroleinc","twitter_misc":{"Written by":"wpx_blogspri","Est. reading time":"13 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#article","isPartOf":{"@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/"},"author":{"name":"wpx_blogspri","@id":"https:\/\/blog.springworks.in\/#\/schema\/person\/bcca0568526b569054230f49ace9af63"},"headline":"The Mechanics Behind EOSIO RAM Allocation","datePublished":"2018-06-20T21:33:19+00:00","dateModified":"2023-01-09T08:02:13+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/"},"wordCount":2538,"publisher":{"@id":"https:\/\/blog.springworks.in\/#organization"},"image":{"@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png","keywords":["Blockchain","Cryptocurrency","Eos"],"articleSection":["Blockchain Technology"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/","url":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/","name":"The Mechanics Behind EOSIO RAM Allocation - Springworks Blog","isPartOf":{"@id":"https:\/\/blog.springworks.in\/#website"},"primaryImageOfPage":{"@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage"},"image":{"@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage"},"thumbnailUrl":"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png","datePublished":"2018-06-20T21:33:19+00:00","dateModified":"2023-01-09T08:02:13+00:00","description":"In this article today, we will talk about RAM trading in EOS, which has become quite a contentious subject of debate in the crypto-community.","breadcrumb":{"@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#primaryimage","url":"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png","contentUrl":"https:\/\/cdn-images-1.medium.com\/max\/800\/1*J7updrfsmpc47-xugCWDIA.png"},{"@type":"BreadcrumbList","@id":"https:\/\/blog.springworks.in\/the-mechanics-behind-eosio-ram-allocation\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/blog.springworks.in\/"},{"@type":"ListItem","position":2,"name":"The Mechanics Behind EOSIO RAM Allocation"}]},{"@type":"WebSite","@id":"https:\/\/blog.springworks.in\/#website","url":"https:\/\/blog.springworks.in\/","name":"Springworks Blog","description":"Everything about the Future of Hiring and Recruiting","publisher":{"@id":"https:\/\/blog.springworks.in\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.springworks.in\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/blog.springworks.in\/#organization","name":"Springworks","url":"https:\/\/blog.springworks.in\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.springworks.in\/#\/schema\/logo\/image\/","url":"\/wp-content\/uploads\/2021\/09\/Springworks-Blog-1.png","contentUrl":"\/wp-content\/uploads\/2021\/09\/Springworks-Blog-1.png","width":548,"height":79,"caption":"Springworks"},"image":{"@id":"https:\/\/blog.springworks.in\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/springroleinc"]},{"@type":"Person","@id":"https:\/\/blog.springworks.in\/#\/schema\/person\/bcca0568526b569054230f49ace9af63","name":"wpx_blogspri","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/blog.springworks.in\/#\/schema\/person\/image\/","url":"https:\/\/blog.springworks.in\/wp-content\/litespeed\/avatar\/e4a8c05b4b8574393eb77ee62952d5f0.jpg?ver=1775602168","contentUrl":"https:\/\/blog.springworks.in\/wp-content\/litespeed\/avatar\/e4a8c05b4b8574393eb77ee62952d5f0.jpg?ver=1775602168","caption":"wpx_blogspri"}}]}},"_links":{"self":[{"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/posts\/70","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/comments?post=70"}],"version-history":[{"count":3,"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/posts\/70\/revisions"}],"predecessor-version":[{"id":505094,"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/posts\/70\/revisions\/505094"}],"wp:attachment":[{"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/media?parent=70"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/categories?post=70"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.springworks.in\/wp-json\/wp\/v2\/tags?post=70"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}