phoenix icon indicating copy to clipboard operation
phoenix copied to clipboard

Feature: Export transactions

Open chazmcgarvey opened this issue 4 years ago • 4 comments

I'd like to be able to export transactions to something like a CSV file.

Rationale: In the U.S., every "send" transaction is potentially a taxable event. So at the end of the tax year, I want to be able to load all my transactions into a spreadsheet so I can easily calculate capital gains and losses. I could use the app and look back at the activity, but if there are a lot of transactions it will be way more convenient to have a spreadsheet.

It could be just a simple "Export transactions" button in the Advanced section of the Settings menu.

To make this even more convenient, ideally the exchange rate for BTC/(configured fiat) at the time of a transaction would also be saved for each transaction (since this is required to calculate capital gains and losses). It seems like this be possible since Phoenix does fetch the rate to show amounts in fiat, but if the exchange rate was not associated with transactions I could look up the historical rater at tax prep time so consider this just a really-nice-to-have feature.

Aside: It seems like it would be a good idea to save the conversation rate for each transaction anyway, because it seems weird that looking back through history the fiat amounts are presented at the current exchange rate... which isn't useful.

The CSV columns should be at least:

  • BTC amount
  • Fee amount (in BTC)
  • exchange rate at time of transaction (hopefully)
  • memo / description / note
  • transaction started timestamp
  • transaction settled timestamp

Could also include any or all other information about the transaction that is known, like the payment request and preimage. Maybe others would find case for those.

chazmcgarvey avatar Sep 11 '21 18:09 chazmcgarvey

Assuming the project owners aren't interested in implementing this feature -- which could be wrong -- would they be interested in accepting a patch? I'm interested enough that I might learn Kotlin to do it, if it would be accepted and if the project owners don't want to do it themselves. Is this repo or phoenix-kmm the right one?

chazmcgarvey avatar Sep 11 '21 18:09 chazmcgarvey

Assuming the project owners aren't interested in implementing this feature -- which could be wrong -- would they be interested in accepting a patch?

Of course, feel free to submit a PR.

You're not in the right repo though, Phoenix is migrating to https://github.com/acinq/phoenix-kmm and https://github.com/acinq/lightning-kmp, that's where you should implement this.

t-bast avatar Sep 13 '21 06:09 t-bast

We are actually very interested in supporting this feature. As you mention saving the fiat value of payments at the time they are made is required for this feature to be really useful, but it adds some complexity. A first, simple version that just dumps the payment db as a CSV file would be quite nice already.

We are currently working on migrating the existing Android app to the new phoenix-kmm stack, but we should be able to have something by october or november.

dpad85 avatar Sep 13 '21 12:09 dpad85

Okay thanks.

chazmcgarvey avatar Sep 13 '21 17:09 chazmcgarvey

Fixed by https://github.com/ACINQ/phoenix/pull/337

dpad85 avatar Feb 15 '23 15:02 dpad85