If you want an overview, you can use an SQL query (using bean-query), use
bean-web, use better: use Fava, or do like I do: export all your holdings
to a CSV file and upload them to an existing sheet in a Google spreadsheet,
where I have other sheets that feed upon that one and do various
aggregations and plot graphs of pre and post tax amounts and
exposure-per-asset-class and all that type of stuff.
I have a little Makefile with these commands in it:
#!/usr/bin/env make
BEANCOUNT = <path-to-your-beancount-filename>
...
upload:
$(HOME)/beancount/experiments/upload/list_holdings.py $(BEANCOUNT)
> $(PWD)/blais.assets.csv
upload-to-sheets -v --docid="<your-document-id>"
$(PWD)/blais.assets.csv:Upload
Instead of "list_holdings.py" I could (probably) use an SQL query and
export to CSV (haven't tried yet).
"upload-to-sheets" comes with Beancount and replaces the contents of an
existing sheet in a spreadsheet (in this case the "Upload" sheet).
Enjoy,
On Mon, Nov 20, 2017 at 6:14 AM, Vonpupp <[email protected]> wrote:
> Thank you for your fast reply Martin,
>
> My objective by using beancount on crypto is to be able to track profit
> and losses. Eventually I trade and I would like to be able to record that
> also. I guess this falls into the speculative investment category. I have
> looked up in the forum and in fact I build this test file from that.
>
> I could sketch a rough version of a module that is able to fetch the
> values:
>
> (.env3) > $ bean-price -e USD:coinmarketcapsource/ETH --no-cache
> 2017-11-20 price ETH
> 358.93000000000000682121026329696178436279296875
> USD
>
>
> (.env3) > $ bean-price -e USD:coinmarketcapsource/NEO --no-cache
> 2017-11-20 price NEO
> 40.57000000000000028421709430404007434844970703125
> USD
>
>
> (.env3) > $ bean-price -e USD:coinmarketcapsource/GAS --no-cache
> 2017-11-20 price GAS
> 24.309999999999998721023075631819665431976318359375
> USD
>
> What it is still not clear is how this ties up to have a general overview
> of the portfolio. From what I understood on the the bean-price
> documentation, I should be able to do something like:
>
> (.env3) > $ bean-price portfolio.beancount
>
> And expect something to happen but nothing happens. Could you please point
> me into the right direction?
>
> Thank you very much.
>
>
> On Monday, November 20, 2017 at 4:24:07 AM UTC-2, Martin Blais wrote:
>>
>> 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/1M4GwF6BkcXyVVvj4yXBJMX7Y
>>> FXpxlxo95W6CpU3uWVc/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_l
>>> aprSs6BlROZjyK_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/ms
>>> gid/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/a778178d-448e-4fed-a8c3-ffd29034e6ec%40googlegroups.com
> <https://groups.google.com/d/msgid/beancount/a778178d-448e-4fed-a8c3-ffd29034e6ec%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%2BhPJWiQ2P4f4Wu24U5h_9ujVE5fjczM1g7d297t8yvXxCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.