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

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/beancount/9373ae5e-49e7-4cdd-affd-dd3f6401c97bn%40googlegroups.com.

Reply via email to