Hey all! New to Beancount here, loving it so far. I've gotten pretty much 
all of my finances in order using the excellent documentation and reading 
through this forum.

I've got a question about handling the transfer of commodities purchased at 
cost. I'm getting an error in one of the following transactions, and would 
love some advice on how to approach what I'm trying to do.

2017-01-01 open Assets:Crypto:US:Exchange:BTC BTC "FIFO"

2017-01-01 open Assets:Crypto:Wallet:BTC BTC "FIFO"

2017-01-01 * "Exchange Purchase" "Buy BTC"
Assets:US:Checking -1500.00 USD
Assets:Crypto:US:Exchange:BTC 1.00 BTC {1500.00 USD}

2017-01-02 * "Tranfer To Wallet" "Transfer BTC"
Assets:Crypto:US:Exchange:BTC -0.5 BTC
Assets:Crypto:Wallet:BTC 0.5 BTC

2017-01-03 * "Exchange Purchase" "Buy BTC"
Assets:US:Checking -1000.00 USD
Assets:Crypto:US:Exchange:BTC 0.50 BTC {2000 USD}

In this example, the third transaction throws the following error:

[Beancount] No position matches 
"Posting(account='Assets:Crypto:US:Exchange:BTC', units=0.50 BTC, 
cost=CostSpec(number_per=Decimal('2000'), number_total=None, 
currency='USD', date=None, label=None, merge=False), price=None, flag=None, 
meta={'filename': '/Home/beancount/crypto.bean', 'lineno': 127})" against 
balance (-0.5 BTC, 1.00 BTC {1500.00 USD, 2017-01-01})

I don't fully understand why this is the error being generated, but I 
believe I understand the underlying issue. Beancount does not deduct from 
lots in Assets:Crypto:US:Exchange:BTC and create identical lots in the 
transfer account Assets:Crypto:Wallet:BTC. So cost basis is lost when 
moving commodities account to account.

The third transaction does not fail if the second transaction is removed or 
represented as a sale, and a re-purchase in the other account.

This kind of transaction is commonplace as moving cryptos out of exchanges 
and into wallets is the standard. Cost basis is determined by the exchange 
transaction however, but should still apply to the same holdings in a 
different account. What kind of strategy should I be using here to 
correctly calculate gains/losses over time?


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+unsubscr...@googlegroups.com.
To post to this group, send email to beancount@googlegroups.com.
To view this discussion on the web visit 
For more options, visit https://groups.google.com/d/optout.

Reply via email to