hello, I am also new to beancount and started to track my crypto trades 
with it as well. I have opened a reddit thread where I am trying to solve 
similar problems. --> link 
<https://www.reddit.com/r/plaintextaccounting/comments/m688pa/beancount_crypto_swaps_wallets_and_eth_gas_tx/>

there you can find one approach to swap one coin for another. in the 
beginning I thought that I have to subdivide such action into two entries 
(sell eth for usd, then buy altcoin) but it is very doable to book this in 
one entry. you have to consider the swap against the cost basis and also 
calculate the profit you made with this entry.

without going too much into detail with your example, I think it is 
important to understand the cost basis {price} and price notation 
correctly. the dollar notation @price is ignored at all and simply for 
visual clarity. if you add a cost basis to an sell-entry, beancount will 
look for this specific listing (and returns an error when no such listing 
exists). without a cost basis, beancount will grab the oldest one 
available. to make sure this is the case, you can add the following line to 
the top of your file: option "booking_method" "FIFO" 

hope this helps
[email protected] schrieb am Samstag, 20. März 2021 um 18:20:32 UTC+1:

> Hello,
>
> I'm trying to keep track of some of my crypto in beancount without 
> success... I'm already using it for "normal" bank transactions without 
> problem.  (Sorry for the long post)
>
> 2020-10-06 open Assets:Crypto-com:App:Wallet:CRO CRO
> 2020-10-06 open Assets:Crypto-com:App:Wallet:ETH ETH
>
> 2020-10-06 * "Buy CRO"
>     Assets:Crypto-com:App:Wallet:CRO                10000 CRO {0.12546 EUR}
>     Assets:Skrill:Wallet                    -1254.57 EUR
>
> 2020-10-06 * "Stake CRO"
>     Assets:Crypto-com:App:Wallet:Stake          10000 CRO {}
>     Assets:Crypto-com:App:Wallet:CRO         -10000 CRO {EUR}
>
> 2020-10-13 * "CRO Stake Rewards"
>     Income:Crypto-com:App                     -26.2295082 CRO
>     Assets:Crypto-com:App:Wallet:CRO
>
> 2020-11-01 * "Buy CRO"
>     Assets:Crypto-com:App:Wallet:CRO                 7540 CRO {0.07306 EUR}
>     Assets:NB:Checking                       -550.84 EUR
>
> Suppose i have something like this and now i want to trade some of CRO for 
> ETH, i've tried this: (Also tried cost {{ or price @@ at first leg)
>
> 2020-11-02 * "Buy ETH"
>     Assets:Crypto-com:App:Wallet:ETH            0.5 ETH {{2341.49925 CRO}}
>     Assets:Crypto-com:App:Wallet:CRO        -2341.49925 CRO
>
> And get the error "No position matches "Postings.... ", so i've tried 
> adding {EUR} in the Wallet:CRO leg, like this:
>
> 2020-11-02 * "Buy ETH"
>     Assets:Crypto-com:App:Wallet:ETH            0.5 ETH {{2341.49925 CRO}}
>     Assets:Crypto-com:App:Wallet:CRO        -2341.49925 CRO {EUR}
>
> And this throws a "Transaction does not balance: (-171.0699... EUR, 
> 2341.49925 CRO)
>
> The only way i can get this to work is by passing cost in EUR on the first 
> leg, like this:
>
> 2020-11-02 * "Buy ETH"
>     Assets:Crypto-com:App:Wallet:ETH            0.5 ETH {170.55 EUR} @ 
> 170.55 EUR
>     Assets:Crypto-com:App:Wallet:CRO        -2341.49925 CRO {EUR}
>
> With this i have a small transaction does no balance of 52 cents (I think 
> this is because of price difference in my crypo prices entries, no problem 
> with that)
> The problem with this approach for me, is that now i see the cost of these 
> 0.5 ETH as EUR, when all i used was CRO. How can i make this appear as CRO? 
> The conversion to EUR should only occurs when i make a transaction/swap to 
> an account that deals with EUR. Or am i wrong? I'm sorry because i'm a noob 
> in all this finance areas :)
> Of course this matter is also valid for all the subsequent transactions 
> like (ETH -> DOT, DOT->CRO, ...) 
>
> Already searched a lot and couldn't find and answer, could you please 
> point me in the right direction?
> Thanks a lot for your work!
>
> Cheers,
>

-- 
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/d6546607-b155-4d7f-82dc-858d5c3e6834n%40googlegroups.com.

Reply via email to