# Cryptocurrency

**URL:** <https://forum.plaintextaccounting.org/t/cryptocurrency/37>\
**Category:** General\
**Created:** [March 5, 2024, 11:53pm UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37 "2024-03-05T23:53:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ralf](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@ralf](https://forum.plaintextaccounting.org/u/ralf)\
**Post date:** [March 5, 2024, 11:53pm UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37/1 "2024-03-05T23:53:41Z")

</div>

Hello Everyone. Excited to be here and see how this grows. I stumbled upon hledger in late 2022, and it has become a fun rabbit hole.

Hledger has been phenomenal for my banking purposes, but I am trying to find a good workflow for cryptocurrency.

I tried hledger-lots but stumbled upon installation/configuration (which is upon myself as recently switching to linux) but also see that it is based on FIFO, and I would also like LIFO and HIFO

My main work flow is that I record each purchase made into its own asset category based on date purchase with a note of the cost basis.

Upon selling I just take from the available assets/date category until it zeros out and then I move onto the next.

I don’t actively day trade so this is manageable for myself, yet reaching out here as always looking for more efficient ways.

I currently keep three separate journals for FIFO, LIFO and HIFO (US tax reporting) to decide which will be best for my reporting at end of year. After I report end of year, I disregard the other two and build upon the one used to keep an accurate record of cryptocurrency available.

```auto
*#Purchase ABC coin at 100.00 USD per coin*
2024-02-15 USD to ABC
    revenue:cash -100.00 USD
    equity:conversion 100.00 USD
    equity:conversion -1.0000 ABC
    assets:20240215 1.0000 ABC ; 100.00
    revenue:cash -2.00 USD
    expenses:fees 2.00 USD

*#Purchase ABC coin at 200.00 USD per coin*
2024-02-28 USD to ABC
    revenue:cash -100.00 USD
    equity:conversion 100.00 USD
    equity:conversion -0.5000 ABC
    assets:20240228 0.5000 ABC ; 200.00
    revenue:cash -2.00 USD
    expenses:fees 2.00 USD

*#Sell .25 ABC coin at 500.00 USD per coin*
2024-03-06 ABC to USD
    assets:20240215 -0.2500 ABC @@ 125.00 USD
    equity:conversion 125.00 USD
    equity:conversion -125.00 USD
    revenue:cash 125.00 USD
    revenue:cash -1.00 USD
    expenses:fees 1.00 USD

```

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [March 6, 2024, 12:19am UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37/2 "2024-03-06T00:19:34Z")

</div>

Welcome @ralf! What you describe is pretty much how I have done it in my experiments: using per-lot subaccounts. Which then must be carefully preserved - including costs and balance assertions - through transfers and file end/starts. That could get quite challenging if you have many lots, eg from recurring rewards or similar. Especially when you want to fix an error or improve the bookkeeping a few years back. `hledger close --show-costs`, `hledger-move.hs`, and emacs power tools (search/replace, macros, `align-regexp`, ledger-mode’s `M-q`…) can be helpful.

I don’t see much explicit @ COST in your example, I guess you track it in comments more than I.

I have never experimented with anything other than FIFO, I like that you can compare the different strategies.

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [March 6, 2024, 12:25am UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37/3 "2024-03-06T00:25:41Z")

</div>

PS hope you don’t mind that I fixed your example’s formatting… I have been suffering through that on Reddit for so many years… but NOW… 😂 🤩 🤯

---

<div class="post-metadata">

**Author:** ![ralf](https://avatars.discourse-cdn.com/v4/letter/r/c89c15/32.png) [@ralf](https://forum.plaintextaccounting.org/u/ralf)\
**Post date:** [March 6, 2024, 4:07am UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37/4 "2024-03-06T04:07:21Z")

</div>

I was going to try with the @COST again as this might be easier going forward. I still have much to learn on reporting and such. Yes emacs, I have been wanting to learn this specifically for org mode, but can see now the other useful benefits I can get from here. The rewards, and costs moving in/out exchanges/wallets is challenging for keeping accurate. The formatting happened as I was watching and the page refreshed, I was like, ah cool, but how did I do that 🙂

---

<div class="post-metadata">

**Author:** ![EvergreenCrypto](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/evergreencrypto/32/48_2.png) [@EvergreenCrypto](https://forum.plaintextaccounting.org/u/EvergreenCrypto)\
**Post date:** [March 14, 2024, 7:53am UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37/5 "2024-03-14T07:53:50Z")

</div>

> [@ralf](#):
>
> Hledger has been phenomenal for my banking purposes, but I am trying to find a good workflow for cryptocurrency.

Hi ralf! From what I understand, `docker-finance` may be exactly what you’re looking for:

> [@Docker-finance | modern accounting for the power-user](https://forum.plaintextaccounting.org/t/docker-finance-modern-accounting-for-the-power-user/189):
>
> Hello wonderful PTA community! Announcing the first beta release of docker-finance: powered by hledger, hledger-flow and more. From the “Overview”: docker-finance empowers you with a privacy-focused, highly uniform system of financial management - but with a modern twist. Cryptocurrencies and blockchain metadata are unified with your legacy finances to create a world of best-practice accounting in a highly flexible, time-tested environment. You can find highlights, screenshots and mor…

I don’t know what wallet/chain/exchange you’re using but, with `docker-finance` and bitcoin.tax (not direct linking but they provide a service that calculates the FIFO/LIFO/etc. for you), you may be able to automate almost everything you’re trying to do (checkout the [“Taxes” section in “Screenshots”](https://gitea.com/EvergreenCrypto/docker-finance#taxes)).

For anything that can’t be automated, `docker-finance` has a system in place that allows you to easily add custom comments on a [per-transaction (or per-subaccount or per-whatever-tag-or-column-you-want-thanks-to-hledger-rules) basis as needed](https://gitea.com/EvergreenCrypto/docker-finance/src/commit/b621e87df2cce60a8daab9fc5de6afe8e77fba96/.img/examples/container_help_03.png) (even with emacs, if you’d like).

---

<div class="post-metadata">

**Author:** ![EvergreenCrypto](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/evergreencrypto/32/48_2.png) [@EvergreenCrypto](https://forum.plaintextaccounting.org/u/EvergreenCrypto)\
**Post date:** [March 15, 2024, 9:36pm UTC](https://forum.plaintextaccounting.org/t/cryptocurrency/37/6 "2024-03-15T21:36:13Z")

</div>

Apologies for the brevity, ralf. If you need help setting this up, please feel free to reach out to me anytime.
