1

I need help calculating how much RAM I've used and how much RAM I have (total)

I've read these questions and their answers:

confused00's answer says to "check all actions sent in the past and look up if any of the contracts that they interacted with use their RAM". But how exactly do I do that? Is it possible to do that just by looking at bloks.io, or some other EOS block explorer? Or do I need to install the EOSIO software suite on my computer and use cleos?

I tried doing it just by looking at bloks.io. I just looked at the initial transaction and every transaction with a little blue microchip icon next to it. But the results of my calculations don't match the totals bloks.io shows. (Correct me if I'm wrong, but I guess that bloks.io uses "KB" to mean 1,024 bytes, not 1,000 bytes, and that bloks.io rounds KB to the nearest hundredth with something like Google Sheets' ROUND function.)

For example, let's look at two arbitrary accounts (below). Upon creation, each account gained 8,192 bytes of RAM (total) and used 3,446 of those bytes.

  1. heztcnbygege: an account without sent actions

    For this account, bloks.io says "RAM used - 3.37 KB / 7.96 KB".

    ROUND(3,446 / 1,024, 2) = 3.37, which matches the KB of RAM used.

    But ROUND(8,192 / 1,024, 2) = 8.00, which is 0.04 KB more than the KB of RAM total.

  2. heztcnbxgyge: an account with sent actions

    For this account, bloks.io says "RAM used - 3.49 KB / 9.33 KB".

    This account has a few transactions that are each marked with a blue microchip:

    1. 264c745c: Consumed 600 bytes
    2. 0260e601: Released 268 bytes
    3. e775e091: Consumed 128 bytes

    But ROUND((3,446 + 600 - 268 + 128) / 1,024, 2) = 3.81, which is 0.32 KB more than the KB of RAM used.

    And ROUND(8,192 / 1,024, 2) = 8.00, which is 1.33 KB fewer than the KB of RAM total.

What am I getting wrong in calculating the RAM balances above? Also, how can I see the used and total RAM balances in exact bytes, instead of rounded to hundredths of KB?

Ultimately, in order to calculate my capital gains taxes, I need to record how much RAM I've gained or lost for each of my transactions, but since my calculations don't add up to bloks.io's totals, I guess I don't have the right numbers.

Your Answer

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

Browse other questions tagged or ask your own question.