1

How can I set the value in the "Buy" or "Sell" columns to less than 0.01 in GNU Cash?

I'm trying to see if GNU Cash can be used to track forex trading of cryptocurrency pairs. Specifically I'm looking at XMR-BTC

At the time of writing, the price of one Monero (XMR) is 0.0073 Bitcoins (BTC).

In-breif, here's how I setup a new GNU Cash DB to track buying XMR with BTC and selling XMR for BTC:

  1. Launch GNU Cash. Click File -> New. Click Next. Click Next. Click Next.

  2. In the "Choose accounts to create", check only "A Simple Checkbook"

  3. Click "Finish". Click "Apply".

  4. Type a name for the new DB and click Save.

  5. Expand "Assets" to show "Current Assets". Expand "Current Assets". Right-Click on "Current Assets" and click "New Account..."

    a. Set "Account name" = "Cryptocurrencies" and click "OK"

  6. Click Tools -> Security Editor

    a. Click "Add"

     i. Full Name = "Bitcoin", Abbreviation = "BTC-USD", Display Symbol = "BTC", Type = "cryptocurrency", Fraction traded = 1/ "100000000", Get Quotes online "checked", choose "Yahoo as JSON". Click "OK"
    

    b. Click "Add"

    i. Full Name = "Monero", Abbreviation = "XMR-USD", Display Symbol = "XRM", Type = "cryptocurrency", Fraction traded = 1/ "100000000", Get Quotes online "checked", choose "Yahoo as JSON". Click "OK"
    

    c. Click "Close"

  7. Right-Click on "Cryptocurrencies" and click "New Account..."

    1. Account Type = "Stock", Account Name = "BTC", Security/Currency = "BTC-USD (Bitcoin)"
    2. Account Type = "Stock", Account Name = "XMR", Security/Currency = "XMR-USD (Monero)"
  8. Double-Click on "BTC" and enter a starting balance a. Transfer ="Equity:Opening Balances - BTC-USD", Shares = "0.001"

After following the above steps, you'll have a very simple GNU Cash DB with accounts for Bitcoin (BTC) and Monero (XMR). The balance of Monero is 0 XMR. The balance of Bitcoin is 0.005 BTC (currently worth about 100 USD).

enter image description here

enter image description here

Now let's say you want to buy some Monero (XMR) with half of your Bitcoin (0.0025 BTC). Again, the price for one XMR is 0.0073 BTC. At that exchange rate, you buy 0.342465753 XMR for 0.0025 BTC. For the purposes of this example, let's simply say there's no fees.

To add this transaction to GNU Cash, open the XMR account and add a new Transaction row

  1. In the "Transfer" column, select "Assets:Current Assets:Cryptocurrencies:BTC"
  2. In the "Shares" column, type "0.342465753"
  3. In the "Buy" column, type "0.0025"
  4. Click "Enter"

Here lies the problem: as soon as you leave the transaction, the "Buy" field gets cleared.

What should happen is GNU Cash divides the "Buy" field (0.0025 BTC) by the "Shares" field (0.342465753 XMR) and calculates the price to be 0.0073 (or some awkward fraction very close to this).

But what does happen: GNU Cash gives-up and clears the filed (I guess because it doesn't like buy amounts to be so small?)

Also, if you go all-in and try to spend all of your Bitcoin (0.005 BTC) on buying Monero, you'll get 0.684931507 XMR. If you try to enter this into the XMR Account's ledger:

  1. In the "Transfer" column, select "Assets:Current Assets:Cryptocurrencies:BTC"
  2. In the "Shares" column, type "0.684931507"
  3. In the "Buy" column, type "0.005"
  4. Click "Enter"

...Then GNU Cash rounds-up the "Buy" column to 0.01 BTC, which makes the calculation of the price 0.0146 BTC/XMR, which is wayyyy off from the actual price of 0.0073 BTC/XMR.

enter image description here

How can I tell GNU Cash to accept my values in the "Buy" and "Sell" column up to 8 decimal places (eg 0.00000001)?

1 Answer 1

2

I did some experimenting and the number of digits allowed in the Buy column depends on the base currency of your GnuCash file. If you follow the process you described above but select XPT (Platina) as the base currency, then you are allowed to buy amounts less than 0.01.

Buying a security for less than 0.01 in GnuCash

XPT is a built-in currency in GnuCash which has a precision of 1/1000000. Obviously, this is not a solution to your problem, but it sheds some light on why GnuCash works like that.

If you search for "bitcoin" on bugs.gnucash.org you can see that there are ongoing tickets to support tokens in GnuCash, but it seems the functionality is not ready, yet.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .