Search the mailing-list for bitcoin or BTC, you'll find related discussions.

Generally the problem with tracking bitcoins with Beancount is that
Bitcoins tend to be used BOTH as a speculative "investment" and as a
currency (e.g., to buy things).
If you want to think of it like an investment you want to track cost basis
to compute returns... which makes it more difficult to use as a currency.
If you use it like a currency,  then you don't use cost basis but then you
can't compute returns against USD (*) or your home currency.
Anyhow, there's no great solution that buys you the best of both worlds.
To be frank, there hasn't been much thought on making this a first-class
use case, Bitcoin is still very much an experiment, and personally I think
the blockchain has no future in its incarnation as a currency (but that is
a much longer discussion). Beancount does work for it, but as mentioned,
the best compromise is to segregate the accounts where you hold it for
value speculation and the accounts where you might use it against
expenses... separate accounts, one which tracks returns, the other which
doesn't.

As far as creating your own price fetcher, you have to use the source,
there isn't much of it and it's all under here:
https://bitbucket.org/blais/beancount/src/tip/beancount/prices/




(*) Maybe one day I'll implement the "currency accounts" method
automatically so you can have a bit of tracking of profits without
explicitly entering cost basis, at least in aggregate. I mean this:
http://www.mathstat.dal.ca/~selinger/accounting/tutorial.html


On Sun, Nov 19, 2017 at 7:24 PM, Vonpupp <[email protected]> wrote:

> Hi,
>
> Congratulations on beancount. I am new to it but I think it is an amazing
> software, therefore I would like to take the most advantage of it. This is
> actually my first message on the forum.
>
> I would like to use beancount with cryptocurrencies. I have may doubts but
> I prefer to take one step at a time. What I would like to be able to do
> first is to be able to see the my portfolio value at the present time. For
> instance, let's assume the following file:
>
> ; -*- mode: org; mode: beancount; coding: utf-8; fill-column: 400; -*-
> ;
> ; Cheatsheet
> ; https://docs.google.com/document/d/1M4GwF6BkcXyVVvj4yXBJMX7YFXpxl
> xo95W6CpU3uWVc/edit
>
> option "title" "Crypto"
> option "operating_currency" "ETH"
> option "operating_currency" "GAS"
> option "operating_currency" "LTC"
> option "operating_currency" "NEO"
>
> plugin "beancount.plugins.book_conversions" "Assets:Crypto:ETH,Income:
> Capital-gains"
>
> ;* Equity
> ;2017-11-01 open Equity:Opening-Balances
>
> * Account declarations
> ; Account1
> 2017-08-18 open Assets:Crypto:ETH:Account1             ETH
> 2017-08-18 open Assets:Crypto:LTC:Account1             LTC
> ; Account2
> 2017-08-18 open Assets:Crypto:ETH:Account2             ETH
> ; Exchange
> 2017-08-18 open Assets:Crypto:GAS:Exchange             GAS
> 2017-08-18 open Assets:Crypto:NEO:Exchange             NEO
>
> 2017-08-18 open Expenses:Crypto:ETH:Balance            ETH
> 2017-08-18 open Expenses:Crypto:GAS:Balance            GAS
> 2017-08-18 open Expenses:Crypto:LTC:Balance            LTC
> 2017-08-18 open Expenses:Crypto:NEO:Balance            NEO
>
> * Income
> 2017-08-18 open Income:Capital-gains
>
> * Expenses
> 2017-08-18 open Expenses:Financial:Commisions:USD
>
> * Transactions
> 2017-11-19 * "Opening balance: Account1"
>     Assets:Crypto:ETH:Account1                5.12561083 ETH
>     Assets:Crypto:LTC:Account1                7.58990978 LTC
>     Expenses:Crypto:ETH:Balance              -5.12561083 ETH
>     Expenses:Crypto:LTC:Balance              -7.58990978 LTC
>
> 2017-11-19 * "Opening balance: Account2"
>     Assets:Crypto:ETH:Account2                3.968560 ETH
>     Expenses:Crypto:ETH:Balance              -3.968560 ETH
>
> 2017-11-19 * "Opening balance: Exchange"
>     Assets:Crypto:NEO:Exchange                4 NEO
>     Assets:Crypto:GAS:Exchange                0.18651499 GAS
>     Expenses:Crypto:NEO:Balance              -4 NEO
>     Expenses:Crypto:GAS:Balance              -0.18651499 GAS
>
> I am not experienced with accounting and english is not my primary
> language, but I guess the file is in "accounting good shape" and it makes
> sense somehow. If not please let me know.
>
> Now let's go to the point. Assuming that file I would like to be able to
> issue a command on the command line and be able to see the portfolio in USD
> or EUR at the present time value. I can query most of the coins using a pip
> package, the question is, how I do that? I have read the "Prices in
> Beancount" [1] google docs file, however there is no example and it would
> be very useful to grasp a bit better how everything ties up. Is there any
> example of fetcher module so I can build mine on top of it? Or if you are
> aware of any module for prices that works with crypto that I could use out
> of the box it would be even better.
>
> Please note that each coin might be on an exchange account or in a wallet
> (account1 or account2). I would like to get the overview of this sum, for
> instance when I refer to "ETH" I would like to see as it appears on the
> balance, but at the current USD or EUR price, and so for the other
> currencies.
>
> From what I understood about the prices document, the prices will be
> fetched and saved on the beancount file automatically. I would like to do
> this automatically on a weekly basis, so I guess cron is my friend here. I
> guess it is wise to use a separated file and link them together somehow.
>
> I would also like (if possible) to have this on a web interface like fava
> or similar if possible. I guess this might work automatically once the
> prices are correctly fetched.
>
> Could you please point me into the right directions to get all these
> things working properly?
>
> Thank you very much.
>
> [1]: https://docs.google.com/document/d/1thYRAMell_QT1Da1F_
> laprSs6BlROZjyK_h3V8qHW9c/edit
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/beancount/88c1a28b-28ed-47fe-8a6d-489823f24bd0%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/88c1a28b-28ed-47fe-8a6d-489823f24bd0%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/CAK21%2BhPmR9Xe0dm%2BQLSA0pcZ4e-aBC7L1cC9Dhj3RRw7J8yKKQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to