2023 Crypto Profits and Losses with Dune API
Streamline tracking of your crypto transactions, including profit and loss calculations and determining cost basis, using Dune.
This guide walks you through using a Python notebook for your 2023 crypto tax calculations. By simply inputting your wallet addresses, the notebook fetches line item details and calculates your overall profit or loss (PnL) for the year (in dollar value). It employs the average cost basis method for fungible tokens, which you can learn more about here.
Accessing the notebook
- Start editing via this Google Colab Notebook (Note to save you must save another copy.)
- Download from this Hex Notebook
Setup
Ensure you have the Dune API SDK installed and your API key ready.
- Install Dune API SDK:
How to use the notebook
Replace 'your_api_key_here'
with your Dune API key:
Input a list of EVM and Solana wallets, separated by commas. For example:
The notebook processes these inputs to provide detailed line items and PnL calculations. Download the line items CSVs and jot down the total PnL. 🎉
Was this page helpful?