Why are there too many missing numbers in this transaction?

119 views
Skip to first unread message

Peter

unread,
Dec 28, 2020, 11:31:58 AM12/28/20
to Beancount
Hi,

I'm still trying to figure out, how to account my crypto swaps and trades correctly.
I added the newly created (thanks a thousand times @Martin) transfer_lots plugin and created some transactions.

Sadly, the last transaction yields the error:

$ bean-check Test.bean 
~/00-Beancount/Test.bean:21:      Too many missing numbers for currency group 'EUR'

$ cat Test.bean
option "booking_method" "FIFO"
plugin "beancount.plugins.book_conversions" "Assets:Bitcoin,Income:Bitcoin"
plugin "beancount.plugins.auto_accounts"

option "insert_pythonpath" "True"
plugin "plugins.transfer_lots" "transfer"

2020-12-01 * "" "Buy BTC"
          Assets:Cash:Coinbase-Pro         -1500.00 EUR
          Assets:Crypto:BTC:Coinbase-Pro       0.15 BTC {10,000 EUR} @ 10,000 EUR

2020-12-17 * "" "Buy BTC"
          Assets:Cash:Coinbase-Pro        -6,000.00 EUR
          Assets:Crypto:BTC:Coinbase-Pro        0.3 BTC {20,000 EUR} @ 20,000 EUR

2020-12-18 * "" "Transfer BTC" #transfer
          Assets:Crypto:BTC:Coinbase-Pro     -0.175 BTC {}
          Assets:Crypto:BTC:Binance         

2020-12-20 * "" "Swap BTC => USDT (1/2)"
; assumed BTC sell
          Assets:Crypto:BTC:Binance           -0.16 BTC {} @ 16,000 EUR
          Assets:Cash:Binance                 2,560 EUR
          Income:Trading

The lots are just fine:

$ bean-query Test.bean 
Input file: "Beancount"
Ready with 6 directives (8 postings in 3 transactions).
beancount> SELECT account, units(sum(position)) as units, cost_number as cost, cost_currency, cost(sum(position)) as book_value, cost_date as acquisition_date WHERE currency = 'BTC' ORDER BY units
           account               units   cost  cos book_val acquisitio
------------------------------ --------- ----- --- -------- ----------
Assets:Crypto:BTC:Coinbase-Pro           10000 EUR          2020-12-01
Assets:Crypto:BTC:Binance      0.025 BTC 20000 EUR  500 EUR 2020-12-17
Assets:Crypto:BTC:Binance      0.15  BTC 10000 EUR 1500 EUR 2020-12-01
Assets:Crypto:BTC:Coinbase-Pro 0.275 BTC 20000 EUR 5500 EUR 2020-12-17

Even trying to sell the entire position (following the manual's syntax) fails:

2020-12-20 * "" "Swap BTC => USDT (1/2)"
          Assets:Crypto:BTC:Binance           -0.175 BTC {} @ 16,000 EUR
          Assets:Cash:Binance                 2,560 EUR
          Income:Trading


I don't know if I didn't write the postings correctly (probably) or if it's related to the plugin (probably not). What's the problem here?

Regards

Martin Blais

unread,
Dec 28, 2020, 2:15:36 PM12/28/20
to Beancount
The inference code has limits.
However, this is one which seems like it should have been resolvable, since you declared FIFO (there are two lots matching).
Can you file a ticket?
Thx


--
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/9373ae5e-49e7-4cdd-affd-dd3f6401c97bn%40googlegroups.com.

Martin Blais

unread,
Dec 28, 2020, 2:17:08 PM12/28/20
to Martin Blais, Beancount

Martin Blais

unread,
Dec 28, 2020, 2:19:34 PM12/28/20
to Martin Blais, Beancount
BTW, I don't recommend using plugins.book_conversions, that was just a POC, not supported. It's actually gone in v3.

Peter

unread,
Dec 28, 2020, 8:26:20 PM12/28/20
to Beancount
Thanks for creating the issue for me.
book_conversions is probably a left-behind after some playing around… Thanks for the hint.

Reply all
Reply to author
Forward
0 new messages