Hi Martin, Apologies that its not very understandable, I honestly was a little confused myself.
Your solution works for me exactly as I want, however, then I am losing the
convenience of using the booking method (LIFO in my case). I tried this:
2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
Expenses:Fees:BTCMining 0.00105853 BTC
@ BTC
Assets:BTC:Coinbase -0.00144853 BTC
{}
Assets:BTC:Jaxx 0.00039 BTC
{}
But I get an error in bean-check.
I would imagine that this would have the same effect because the cost basis
for the lot would be filled in automatically, but I figured disambiguating
would help like this:
2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
Expenses:Fees:BTCMining 0.00105853 BTC
@ BTC
Assets:BTC:Coinbase -0.00144853 BTC
{USD}
Assets:BTC:Jaxx 0.00039 BTC
{USD}
But it books the cost-basis of the BTC in the Jaxx account as
9885.214421538461538461538462 USD :
--> bean-doctor context ledger.beancount 107
Hash:972251de2efc72a4e7f2a2c4654440cb
Location:
/home/salotz/tree/personal/studio/projects/index/troubleshooting.general/beancount/issue_000/ledger.beancount:107
------------ Balances before transaction
Expenses:Fees:BTCMining
Assets:BTC:Coinbase 0.01878653 BTC {2661.48 USD, 2017-06-14}
Assets:BTC:Jaxx
------------ Transaction
2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
Expenses:Fees:BTCMining 0.00105853 BTC @ 0.00000000 BTC
; 0 BTC
Assets:BTC:Coinbase -0.00144853 BTC {2661.48 USD, 2017-06-14}
; -3.8552336244 USD
Assets:BTC:Jaxx 0.00039000 BTC {9885.21 USD, 2017-06-14} ;
3.855233624400000000000000000 USD
Tolerances: BTC=5E-9
------------ Balances after transaction
* Expenses:Fees:BTCMining 0.00105853 BTC
* Assets:BTC:Coinbase 0.01733800 BTC {2661.48 USD, 2017-06-14}
* Assets:BTC:Jaxx 0.00039 BTC {9885.214421538461538461538462 USD,
2017-06-14}
Maybe I am mistaken and this is correct but it doesn't seem to me since
then if you sold the position in the Jaxx wallet it wouldn't be booked
against the original cost-basis that was calculated when the lot was bought.
I've attached a minimum working example for a lot of test cases and their
results written in the comments. It may not be of much use to you though,
but when I don't understand something I tend to go for the enumerative
brute force and try to understand the results and compare.
My conclusions are that in a single transaction directive it is not
possible to automatically (i.e. not specify the position to reduce against)
split an inventory reduction into an expense and an asset transfer and keep
the original cost-basis.
I tried splitting it into two transactions and this seems to work
swimmingly, so this is the way I will do it for now until the booking
capabilities are more advanced.
I really appreciate your responses.
~Sam
On Sun, Aug 12, 2018 at 4:20 PM, Martin Blais <[email protected]> wrote:
> On Sat, Aug 11, 2018 at 10:39 PM <[email protected]> wrote:
>
>>
>> I lied I was missing the new error message:
>>
>> /home/salotz/tree/personal/studio/projects/index/finance/
>> ledger/ledger.beancount:1161: Transaction does not balance:
>> (0.00105853 BTC)
>>
>> 2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
>> Expenses:Fees:BTCMining 0.00105853
>> BTC
>> Assets:BTC:Coinbase -0.00144853 BTC {2661.48 USD,
>> 2017-06-14}
>> Assets:BTC:Jaxx 0.00039 BTC @
>> 9885.214421538461538461538462 USD
>>
>>
>> Upon investigation in bean-doctor:
>>
>> ------------ Balances before transaction
>>
>> Expenses:Fees:BTCMining
>>
>>
>> Assets:BTC:Coinbase 0.004151 BTC {2247.70 USD,
>> 2017-05-24}
>> Assets:BTC:Coinbase 0.01878653 BTC {2661.48 USD,
>> 2017-06-14}
>>
>> Assets:BTC:Jaxx
>>
>>
>>
>> ------------ Transaction
>>
>> 2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
>> Expenses:Fees:BTCMining 0.00105853 BTC
>> ; 0.00105853 BTC
>> Assets:BTC:Coinbase -0.00144853 BTC {2661.48 USD, 2017-06-14}
>> ; -3.8552336244 USD
>> Assets:BTC:Jaxx 0.00039000 BTC @ 9885.21 USD
>> ; 3.855233624400000000000000000 USD
>>
>>
>> Residual: (0.00105853 BTC)
>> Tolerances: BTC=5E-9
>> Basis: (-3.8552336244 USD)
>>
>> ------------ Balances after transaction
>>
>> * Expenses:Fees:BTCMining
>> 0.00105853 BTC
>>
>> Assets:BTC:Coinbase 0.004151 BTC {2247.70 USD,
>> 2017-05-24}
>> * Assets:BTC:Coinbase 0.01733800 BTC {2661.48 USD,
>> 2017-06-14}
>>
>> * Assets:BTC:Jaxx
>> 0.00039 BTC
>>
>>
>> It seems that it is booking the lot from Assets:BTC:Coinbase all to
>> Assets:BTC:Jaxx because of the use of that syntax, and then the mining fee
>> leg is unbalanced and not considered at all.
>>
>
> I read what you wrote three times and I don't understand what you're
> saying.
> In any case, here's how this works: in this transaction:
>
> 2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
> Expenses:Fees:BTCMining 0.00105853
> BTC
> Assets:BTC:Coinbase -0.00144853 BTC {2661.48 USD,
> 2017-06-14}
> Assets:BTC:Jaxx 0.00039 BTC @
> 9885.214421538461538461538462 USD
>
> - The first posting "weighs" for 0.00105853 BTC
> - The second posting "weighs" for -0.00144853 BTC x 2661.48 USD
> = -3.8552336244 USD
> - The first postings "weights" for 0.00039 BTC @
> 9885.214421538461538461538462 USD = 3.8552336244 USD
>
> So it has two currency groups to balance:
> 1. USD, with the two legs cancelling each other out: -3.8552336244 +
> 3.8552336244 = 0, so we're goot.
> 2. BTC, of which there is a single leg and the amount (0.00105853) exceeds
> the tolerance, so BTC is not balanced.
> So you get an error.
>
> One way to achieve what you want is this: keep the cost basis in Jaxx and
> book your expenses as BTC without cost basis
>
> 2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
>
> Expenses:Fees:BTCMining 0.00105853 BTC @ USD
>
> Assets:BTC:Coinbase -0.00144853 BTC {2661.48 USD}
>
> Assets:BTC:Jaxx 0.00039 BTC {2661.48 USD}
>
> Unfortunately, you cannot leave more than one number to be interpolated in
> each currency group.
>
>
>
>
>> So I tried:
>>
>> 2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
>> Assets:BTC:Coinbase
>> -0.00144853 BTC {}
>> Expenses:Fees:BTCMining
>> 0.00105853 BTC @ USD
>> Assets:BTC:Jaxx
>> 0.00039 BTC @ USD
>>
>> And to reverse the autofilling of the amount:
>>
>> 2017-06-14 * "Transfer" "Transfer funds to Jaxx wallet"
>> Assets:BTC:Coinbase
>> -0.00144853 BTC {}
>> Expenses:Fees:BTCMining
>> Assets:BTC:Jaxx
>> 0.00039 BTC @ USD
>>
>>
>> But I get this error for both:
>>
>> /home/salotz/tree/personal/studio/projects/index/finance/
>> ledger/ledger.beancount:1163: Too many missing numbers for currency
>> group 'USD'
>>
>
> Beancount only supports a single interpolated number by currency group to
> balance.
> It's a very complicated answer to explain why, but essentially revolves
> around the fact that the problem is underconstrained.
>
>
>
>>
>> Not sure what to do at this point except for booking the mining fee in a
>> separate transaction.
>>
>
> Cryptocurrencies offer a particular challenge in that reductions at cost
> basis are made as often as expenses for some users.
> Beancount isn't particularly well adapted to that (but nothing else is
> either).
> See another recent-ish thread on Bitcoin.
>
>
>
>
> --
>> 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/0a916715-69ab-4337-b327-c256aa3e1f3b%40googlegroups.com
>> <https://groups.google.com/d/msgid/beancount/0a916715-69ab-4337-b327-c256aa3e1f3b%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 a topic in the
> Google Groups "Beancount" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/beancount/Qvbcq-Sk5NY/unsubscribe.
> To unsubscribe from this group and all its topics, 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%2BhMnx3Yk%3DJKurxaV2ZGNz0Eq87iYYPBYfPoBe
> X_hwn%3DuLw%40mail.gmail.com
> <https://groups.google.com/d/msgid/beancount/CAK21%2BhMnx3Yk%3DJKurxaV2ZGNz0Eq87iYYPBYfPoBeX_hwn%3DuLw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
--
Samuel Lotz
[email protected]
--
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/CAEZ4YMUYkT5Qd1BYmJakw-vf9ivQsTi%2B1e1iAUhZiqHcO52DNg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
ledger.beancount
Description: Binary data
