My question is how to discover the current CW for the bancor algorithm in the current RAM market.

Below you can see where in the system contract RAM and the RAMCORE token is created for the market upon the network's inception.

eosio.system.cpp code line 28:

if( itr == _rammarket.end() ) {

    //system_token_supply is set to current outstanding EOS supply                          

    auto system_token_supply   = eosio::token(N(eosio.token)).get_supply(eosio::symbol_type(system_token_symbol).name()).amount;                
    if( system_token_supply > 0 ) {
    itr = _rammarket.emplace( _self, [&]( auto& m ) {
    m.supply.amount = 100000000000000ll; 

    // 100 trillion smart token reserve created with "RAMCORE" token namespace

    m.supply.symbol = S(4,RAMCORE);

    // base.balance.amount set to outstanding free RAM, 64GB

    m.base.balance.amount = int64_t(_gstate.free_ram()); 
    m.base.balance.symbol = S(0,RAM);

    // EOS used for acting as counter party to trade (connector balance)    

    m.quote.balance.amount = system_token_supply / 1000; 

    // balance.symbol is given EOS token namespace

    m.quote.balance.symbol = CORE_SYMBOL;

  • If you have answered your own question please remove the Answer content from the Question and add it as an Answer to clarify this has been properly answered OK. – John Williamson Jul 9 '18 at 11:46
  • Sorry about that. I cleaned it up. – Nat Jul 9 '18 at 11:50

An Answer to this was provided:

EOSIO RAM Market & Bancor Algorithm | The bytemaster July 4th

Due to an unintentional configuration of the Bancor Relay weights on the EOS blockchain, this parameter is set at .05% rather than 50%. This introduces some heavy slippage for buying and selling large quantities and causes more volatility than desired.

Dan suggests hard coding a static 20% annual inflation in RAM into the system contract along with the change in CW to 50%.

You can find the weight by going:

cleos -u https://nodes.get-scatter.com:443 get table eosio eosio rammarket

  "rows": [{
      "supply": "10000000000.0000 RAMCORE",
      "base": {
        "balance": "11870290976 RAM",
        "weight": "0.50000000000000000"
      "quote": {
        "balance": "5789275.3804 EOS",
        "weight": "0.50000000000000000"
  "more": false

To provide some visual clarity on different CW's and how they affect price as supply is taken up, I've included a visual from the Bancor WP.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.