Purchases using an asset held at cost

128 views
Skip to first unread message

Dennis Golomazov

unread,
Sep 29, 2019, 11:07:09 AM9/29/19
to Beancount
Hi,

I have a question. Imagine you buy bitcoins, so they are held at cost. 
Then later you use them to buy something (so they go to Expenses: subaccount nominated in bitcoins).
How do you record that transaction? Ideally I want the gains/losses to be realized.
But If I do something like:

   2013-06-01 * "Buy pizza"
     Assets:Cryptocurrency:Coinbase:Bitcoin            -10000 BTC {}
     Expenses:Pizza               10000 BTC

beancount shows an error "No position matches...". 
I assume that's because BTC were bought with USD, but now are "sold" to BTC and not back to USD?

This works:

   2013-06-01 * "Buy pizza"
     Assets:Cryptocurrency:Coinbase:Bitcoin            -10000 BTC {}
     Expenses:Pizza               100 USD

the cost gets imputed correctly. But the thing is that pizza might haven't had a price in USD, it was nominated in bitcoins :) 
What's the best way to handle these situations?

Dennis Golomazov

unread,
Sep 29, 2019, 11:11:26 AM9/29/19
to Beancount
And if I add the cost manually, it shows a "Transaction does not balance" error.

Andrzej Kotulski

unread,
Sep 29, 2019, 3:26:51 PM9/29/19
to bean...@googlegroups.com

Disclaimer: I'm not an expert with this and may be wrong
In your case I understand that you don't want to keep cost basis in expenses accounts. What I would do is sell BTC at a cost and keep it without cost in Expenses. This is minimal beancount file that shows it:

plugin "beancount.plugins.auto_accounts"

2018-08-07 * "Buy BTC"
  Income:Salary           -20 USD
  Assets:Bitcoin             2 BTC {10 USD}

2019-08-07 * "Buy Pizza"
  Assets:Bitcoin            -1 BTC {10 USD}
  Expenses:Pizza           1 BTC @ 20 USD
  Income:Gains            -10 USD

If you wanted to keep cost basis in the other account:
I think this topic was raised earlier this year. You can search for "Moving assets with cost basis" in the mailing list to see a solution.

The short answer is that when you do the transfer you have to put cost basis explicitly inside {} (even if there is only one lot)

--
You received this message because you are subscribed to the Google Groups "Beancount" group.
To unsubscribe from this group and stop receiving emails from it, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/a7aa91f9-4042-4bfb-bdc1-01b50e04b645%40googlegroups.com.

Martin Blais

unread,
Sep 29, 2019, 9:28:33 PM9/29/19
to Beancount
There's a fundamental tension created by the use of cryptocurrencies.
On the one hand, its adherents want to hold it at cost and compute P/L.
On the other hand, they want to spend in units of the cryptocurrency
(frequent transactions) and treat it like just another currency.
This creates an unorthodox scenario for accounting systems.

The idea Andrzej presented works, and it's similar to what I've
proposed before, but it should leave the Bitcoin user unsatisfied.
I think you should choose one of two methods:

1. Treat all bitcoin held at cost and satisfy use the automatic
booking method to make frequent purchases.
When you buy something denominated in BTC, you'd have to convert those
in USD using the current going rate, e.g.:
Expenses:Pizza 10000 BTC @ 100 USD
in order to account for the USD equivalent. I don't see any way out of
this (you care about P/L).

2. Hold your bitcoins not at cost, like you would some other currency,
but use the currency trading accounts method (and the partially
complete plugin) to track your P/L related to Bitcoin usage overall.

In theory you could attempt to automate (1) enough that it's less
painful (to fetch the rate at the time of transaction automatically).
> To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/df2db204-6651-dccf-d94b-d46cf0579d18%40gmail.com.

Dennis Golomazov

unread,
Sep 30, 2019, 11:35:46 PM9/30/19
to bean...@googlegroups.com
Thank you Andrzej and Martin, that's helpful.

Best regards,
Dennis Golomazov.


You received this message because you are subscribed to a topic in the Google Groups "Beancount" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beancount/JT_wfZaUcbY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beancount+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/beancount/CAK21%2BhN3GqQg3fo3yrMXoY3JAxOf2Rgm_-k7oiPb1ZVg6CYi8A%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages