leather-io / extension

Leather browser extension
https://leather.io
MIT License
288 stars 135 forks source link

Add option to export transaction data from the Leather extension #3002

Open 314159265359879 opened 1 year ago

314159265359879 commented 1 year ago

This gets requested now and again. It is not on the roadmap and there are third party dapps that can help you get the transaction data for tax purposes.

For example stackonchain.com and fatstx.github.io

Export data is especially useful if token values are also available in dollars value: daily closing price of the currency being transferred for example. Users are requesting export data to be compatible with crypto administration tools such as Koinly, or Zenledger, Coinledger, CoinTracking.

Koinly is an app that takes a csv in a certain format to make tax administration partially automated. It requires formatting in a certain way, such as described here: https://help.koinly.io/en/articles/3662999-how-to-create-a-custom-csv-file-with-your-data

Their most general format expects these columns to be filled: Date | Sent Amount | Sent Currency | Received Amount | Received Currency | Fee Amount | Fee Currency | Net Worth Amount | Net Worth Currency | Label | Description | TxHash

Net worth can be empty and Koinly will get the prices from existing oracles/database/history records.

Stacksonchain.com has almost all this data in their export but the labels are a bit different and for some tokens it does not have token prices in dollars because they are not tracked anywhere (FWP-WSTX-ALEX-50-50-V1-01 pool token for example).

I expect Koinly (or Zenledger, Coinledger) will have trouble calculating Net Worth if token prices are not being tracked. Perhaps some manual work will always be required in administrating this for taxation purposes?

@0xBabo would Stackonchain consider offering an alternative export format just for Koinly users? As I understand, it my only require renaming and rearranging some columns already available in the stackonchain export format see here: image https://github.com/no314/stx-fan/blob/main/tutorials/stacksonchain-template-for_koinly.xlsx

314159265359879 commented 1 year ago

Tested Koinly with this:

  1. Make account
  2. Add a wallet, I added Blockchain Wallet
  3. Then Upload file with transactions, converted to Koinly format

Example csv used: Date,Sent Amount,Sent Currency,Received Amount,Received Currency,Fee Amount,Fee Currency,Net Worth Amount,Net Worth Currency,Label,Description,TxHash,Ignored column 07-01-23 07:20,0.06608173,FWP-WSTX-WBTC-50-50-V1-01,,,0.0025,STX,,,,,0xbac94fa5,te 07-01-23 07:25,0.00014047,Wrapped-Bitcoin,,,,,2.35,16704.6805,,,0x845bb25,st 07-01-23 07:25,,,0.06608173,FWP-WSTX-WBTC-50-50-V1-01,,,,,,,0x845bb25,test 07-01-23 07:25,10.7598,STX,,,0.0025,STX,2.36,0.2196,,,0x845bb2,test 07-01-23 07:20,12.4,STX,,,0.0025,STX,2.72,0.2196,,,0xd75b92f, 07-01-23 07:20,,,0.00015544,WBTC,,,2.6,16704.6805,mining,,0xd75b92f,test 07-01-23 07:20,,,22.790932,STX,0.0025,STX,5,0.2196,,,0x2edd2e, 07-01-23 07:20,428.4397951,ALEX,,,,,5.03,0.01173,,,0x2edd2e, 07-01-23 07:20,,,38.58528825,APOWER,0.0025,STX,,,,,0x65c007,

  1. See result image

"WRAPPED-BITCOIN" is not recognized, if replaced by WBTC or xBTC it will find data on similar wrapped bitcoin assets which in precise could deviate from their peg differently causing some differences.

ALEX's pool tokens are not recognized either. I do not think such tokens are commonly tracked publicly so it would probably be better if the Net value in dollars was deduced (based on onchain data) or exposed in an api by ALEXlab.co so that stackonchain.com can add the value to their export?

Example of how it is shown in the wallet on Koinly image

image

314159265359879 commented 1 year ago

eparrot's comment about this (from Discord): image

badonyx commented 1 year ago

would Stackonchain consider offering an alternative export format just for Koinly users? As I understand, it my only require renaming and rearranging some columns already available in the stackonchain export format see here

Might be out of scope to support platform-specific CSV formats.

There is a dedicated STX tax tool in development at https://stxape.com, although it seems incomplete so far with no support for FT or NFT events, and not showing my latest transactions for the last few months.

Personally I would recommend implementing STX chain support in some third party tool like https://github.com/hodgerpodger/staketaxcsv that already handles all of the abstractions like CSV formats and event types and all. I was planning to take this on myself at some point but have not gotten to around to it yet.

markmhendrickson commented 6 months ago

I think the main question for us as a wallet provider here is whether our current APIs support this functionality via integrating apps or whether any are missing, since the APIs themselves should be the ones that "export" to those apps.

Such an app could provide the user with "Save to CSV" and other similar usable options that leverage the wallet APIs.

314159265359879 commented 4 months ago

@Hero-Gamer do you know if anyone at the Stacks foundation is working on building integrations for tax tools like cointracker, koinly and such for Stacks (STX and other traded tokens)?

I know users have also asked us (wallet team) to integrate something like that but integration with existing tools, already being used for accounting purposes looks like a good option. Tools such as the one mentioned by @badonyx: hodgerpodger or cointracker or Koinly for example. In any case it will likely require some coordination especially if you want dollar values to be included for as many tokens as possible, such as those being traded on DEXes/marketplaces, it would require those DEXes to provide (dollar value) api's or perhaps if they are already on coinmarketcap/coingecko/etc. the app integrating with Stacks can simply utilize their API endpoints. I am not sure what their (cointracker/koinly/etc) preference would be.

Demand also apparent from these https://feedback.cointracker.io/features/p/add-support-for-stx https://feedback.koinly.io/integrations/p/stacks-stx-blockchain