On Wed, Jul 19, 2023 at 8:50 AM Eric Altendorf <[email protected]>
wrote:

> I'm trying to understand how to construct legs for a transaction where no
> legs are in the operating currency.  For example, one might exchange USDT
> (Tether) for BTC.  USDT is sorta like USD but actually not, and its
> exchange rate does fluctuate.  Such a transaction isn't technically just a
> purchase from the standpoint of US taxation; it rather is considered:
>
> 1) a virtual sale of the USDT for USD, for which capital gains may be owed
> 2) a virtual purchase of BTC with those USD proceeds, which establishes
> the cost basis for the BTC
>

FYI, I don't think we do crypto well in Beancount (yet). I mean, if it
works it's incidental, other than participation in threads and some design
notes for the future, its author never really sat down to solve those
issues.


I don't yet have a deep enough intuition on Beancount "cost" and "price" to
> understand whether this can be accomplished simply with two legs (a USDT
> leg and a BTC leg) with some "price" magic, or whether I need four legs
> (two additional USD legs).
>
> How would one record such a transaction?
>

Does this work well enough?

plugin "beancount.plugins.sellgains"


2022-01-01 open Equity:Opening-Balances

2022-01-01 open Assets:Coinbase:USDT     USDT

2022-01-01 open Assets:Coinbase:BTC      BTC

2022-01-01 open Income:Coinbase:Pnl      USD



2022-06-01 * "Initial balances"

  Assets:Coinbase:USDT      20000 USDT {1.0000 USD}

  Assets:Coinbase:BTC       10 BTC {10000.00 USD}

  Equity:Opening-Balances


2022-06-01 * "Your transaction"

  Assets:Coinbase:USDT      -10209.18 USDT {} @ 1.023 USD

  Assets:Coinbase:BTC       1 BTC {10444 USD}

  Income:Coinbase:Pnl

The thing is, the capital gains between the USDT and the BTC are mixed
together, maybe that's not great.




> (For bonus points, some exchanges charge transaction fees in other assets,
> e.g. USDT.  In that case, the transaction fees are then also an implicit
> sale for USD, so I need to figure out how to enter that as well.)
>
> thanks,
> eric
>
> --
> 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/CAFXPr0tqjUwuu6FPkN5wc9M0v5PrYnXoMDyzao%3DNY2zyiL69pg%40mail.gmail.com
> <https://groups.google.com/d/msgid/beancount/CAFXPr0tqjUwuu6FPkN5wc9M0v5PrYnXoMDyzao%3DNY2zyiL69pg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>

-- 
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/CAK21%2BhPrCQ%3DLnrSNnRj4RsEz7-1L-vh0y1mKu7if33h8X_bRuw%40mail.gmail.com.

Reply via email to