Process your transactions from etherscan (and other forks) into excel file for easier manipulation.

Overview

DEGEN TRACKER

Read first

This is my first Python open source project and it is very likely full of bad practices and security issues. You should not use this code without proper testing as I have not done that (especially for different networks than Ethereum). Although if you are interested in learning a bit about how to analyze your degen accounts you may find it engaging. Use it at your own risk. Any ideas, suggestions of how to improve my code are very welcome.

Overview

Motivation to create Degen Tracker was to facilitate processing transactions over different networks. Unfortunately, I could not find any app which would be reliable enough and which would provide me with the good user experience and simultaneously have good access to data to be able to check them. As used to working with MS Excel, I decided to process transaction data from etherscan (or other networks' scans) and export them to the *.xlsx file (output file) in which then I could work easily. The process is not fully automated, there are already known bugs. Thus, user is always supposed to revise the whole report!

Requirements

It is meant to be used by users having at least basic technical knowledge of Python and MS Excel. The project will not work unless you meet the following conditions:

  • user has downloaded all necessary input data in csv format, i.e.: transactions (1), internal transactions (2) and Erc20 Token Transactions from the given etherscan-ish (depending on network) website containing every single transaction since the very beginning;
  • user has placed those files into the input data folder;
  • Python, MS Excel installed (it was developed on WIN 10, Python 3.9.7);

You should also:

  • check all the address of stable coins (config_stables.py) and add others if needed;

Assumptions

If you are about to use it, you should consider following assumptions:

  • All price feeds used origin from the downloaded CSV files, i.e. from the ethescan-ish type of files and might be different to reality.
  • Only token swaps are subjects of the data processing. Other operations, i.e. liquidity providing, will appear in the output file as well, but their the output does not correspond to reality. Hence, a user should process them separately.
  • Stablecoins if a token is swapped with USD pegged stablecoin defined in config_stables.py, the token is priced by stable coin amount used in the token swap. Deviations to real USD value are not considered.
  • Taxable/non-taxable events are defined in config.py, but they were not extracted from any legislation. Instead a common sense was applied. Thus,a user should check and adjust it before usage if he/she plans to use it for their tax report.
  • The project is not fully automatic, if data is missing, user has to fill them in the output excel in the proper way (see Manual section below).
  • Fees are not considered as part of the price paid during operations with tokens. On the contrary, they are calculated separately and can be seen in the sheet Overview.

TODO

Things I should have done but haven’t as I mentioned this project was a learning opportunity for me. Below find a list of improvements that could be done to this project.

  • The project does not take into account other transactions made, i.e. ERC721 Token Transactions, ERC1155 Token Transaction etc., thus the total fee is not calculated properly.
  • If the price of token is not known, there could be used some external source of data price (API).
  • If user buys and sells the same token multiple times and the Token Balance never reaches 0 in the reporting period, it will not be included in the final calculations (see Output section below), hence user would need to handle it manually (or at least have once zero token balance) if he/she wants to have it included.
  • If a user doesn’t use all the three kind of input data, process might fail (not tested), thus it should be handled as well.
  • There are several already know bugs/inconsistencies which need user's manual interaction (see Example part below). This means that there might be others which have not been discovered yet.
  • Also no thorough testing has been performed, especially for other chains.
  • If a user wants to process transactions from several addresses, he/she needs to put the input data in the input folder manually after each iteration. It could be automated as well.
  • Processing of liquidity provision might be a subject of further development.
  • There could be a function to take it into account if addresses' transaction has been already processed in the past (the output file exists), and process only new transactions.

Output

The output file name is in form your-address_network-ticker_YYYY-MM-DD.xlsx. The output file is file with two sheets: 1) full data and 2) overview.

Sheet full_data

In this section, you can find description of the columns in the output file.

Full_data sheet

  • Token Symbol = the ticker of the given token;
  • A = final assessment regarded to token operations used for the final calculation and conditional formatting in the output file. Assessments:
    • C = completed; the result operation is considered in the final calculation (see the sheet overview);
    • O = open; the result of operation is not considered in the final calculation as the trade has not been closed yet;
    • U = uncompleted; the result of operation is not considered in the final calculation although the trade has already been closed but there is missing data. Data needs to be revisited, filled in, and then state can be changed to "C" value in order to include changes in the final calculation.
  • Token Direction = direction of the token - two possible directions:
    • IN = tokens were sent to the wallet,
    • OUT = tokens were sent out of the wallet).
  • Unix Timestamp = Unix Timestamp of the transaction.
  • Value = the amount of tokens included in the transaction; if Token Direction is OUT, the value is negative.
  • Token Balance Before = the token balance before the execution of the transaction.
  • Token Balance After = the token balance after the execution of the transaction.
  • ETH IN = value is non zero if ETH (or other L1 coins depending on the given network) was sent to the account in the transaction.
  • ETH OUT = value is non zero if ETH (or other L1 coins depending on the given network) was sent from the account in the transaction.
  • ETH USD = the price of ETH (or other L1 coins depending on the given network) in the time of the transaction.
  • Method = the name of the method (type of token operation) used in the transaction.
  • Event = an Event assigned based on the type of transaction; all events are defined in config.py.
  • USD price = price of the purchase/sale of transaction if known.
  • USD state = the cashflow of the trade of the given token at the given time, i.e. each token is evaluated separately.
  • Status = status of the operation. Can be:
    • OPEN = the trade has not been closed yet;
    • UNCLEAR = there is missing data, the transaction has to be revised by user;
    • CLOSED = the trade has been closed, i.e. value in Token Balance After column reached 0;
    • STABLES = the trade relates to stables (and it is not considered for further calculations).
  • Hyperlink = hyperlink to the transaction.

Overview sheet

  • Profit brutto: sum of all transaction with CLOSED value in the Status column and with C value in the S column in the given time (see Date from, Date to)
  • Fees: sum of all transaction fees in the given time (see Date from, Date to)
  • Profit netto: Profit brutto - Fees
  • Date from: Date of the beginning of the taxable period (including)
  • Date to: Date of the the end of the taxable period (excluding)

Manual / Handling missing data

DISCLAIMER: all data (i.e. token names, price etc.) in the section were made up for learning purposes.

General usage

  1. Clone the project to your computer.
  2. Download all three input files of address to be processed (see image below) to the input folder.
  3. In root folder of the project run command python scripts/data_process.py in your source-code editor.
  4. Once the process is successfully finished, the output file will open.
  5. Finally, all input files are moved to the temp folder.

Download these files

Working with the output file

A) PRICE IS NOT KNOWN -> MISSING DATA -> ASSESSMENT: UNCOMPLETED

In the picture below, you can see four transactions of EXMPL1 token. The second transaction is missing USD price, thus all operations with tokens are assessed as UNCLEAR (see value "U" in the column "S"). In order to fix it, user needs to:

  • fill the USD price (might be zero or else) for second transaction,
  • manually recalculate cashflow in the column USD state,
  • change the value "U" to "C" to all transactions. Once this is done (see the pictures below), the whole operations regarded to the token will be included in the final calculation (sheet overview).

EXMPL1: Before manual revision

EXMPL1: After manual revision

B) OPENED TRADE -> ASSESSMENT: OPEN

The example of open trade can be seen in the picture below. The trade consists of three operations so far. You can see "NOT DEFINED" (and MISSING DATA in the column USD price) event is in the second transaction. In this case it is not obvious if the tEXMPL2 (Tokemak t Asset) will be traded, transferred, or reclaimed in the future. This trade is not included in the final calculation (sheet overview).

EXMPL2: Open trade

C) ALL DATA AVAILABLE -> ASSESSMENT UNCOMPLETED AND OPEN

In the pictures below you can see two assessments. The first transaction is assessed as OPEN, the second and the third transactions are assessed as UNCOMPLETED. What happened here is that the project with token EXMPL3 was rugged, thus it distributed a new coin with the same ticker. Hence, the following procedure can be used:

  • the USD price of the first transaction can be applied to the second transaction,
  • the USD state (cash flow) can be then calculated for transaction 2 and 3,
  • as the Status of the third transaction equals to CLOSED, the values in "A" column can be changed to C (= completed). After this procedure was applied, the trade will be included in the final calculation (sheet overview).

EXMPL3: Before manual revision

EXMPL3: After manual revision

D) ALL DATA AVAILABLE -> ASSESSMENT: COMPLETED

This trade represents an aidrop (transaction one) and its sale to DAI token. All data are available, thus trade can be assessed as COMPLETED and no further actions are required.

EXMPL2: Closed trade

E) OVERVIEW SHEET

The final calculation can be seen in the sheet "overview". In the pictures below, you can see overview list before all adjustments were made in the steps A-D and after that. I believe that formulas used in the *.xlsx file are self-explanatory.

Final calculation before adjustments

Final calculation after adjustments

Donation

You can donate me:

  • Ethereum (or BSC, Fantom, Avalanche, Polygon, zkSync, Arbitrum etc.) to: 0xc264EF4c715B9FdC44487253095C2643BD06F11b
BroBot's files, code and tester.

README - BroBOT Made by Rohan Chaturvedi [email protected] DISCLAIMER: Th

1 Jan 09, 2022
ro.py is a modern, asynchronous Python 3 wrapper for the Roblox API.

GitHub | Discord | PyPI | Documentation | Examples | License Overview Welcome to ro.py! ro.py is an asynchronous, object-oriented wrapper for the Robl

ro.py 81 Dec 26, 2022
Telegram bot for stream music on telegram, powered by py-tgcalls and Pyrogram

Telegram Streamer Bot Telegram bot for stream music on telegram, powered by py-tgcalls and Pyrogram ✨ Features Coming soon, help me to improve it 🛠 C

Shohih Abdul 11 Oct 21, 2022
ThetaGang is an IBKR bot for collecting money

💬 Join the Matrix chat, we can get money together. Θ ThetaGang Θ Beat the capitalists at their own game with ThetaGang 📈 ThetaGang is an IBKR tradin

Brenden Matthews 1.5k Jan 08, 2023
Bot telegram yang menggemakan pesan apa pun yang Anda kirim atau modifikasi untuk menganonimkan pesan

Bot telegram yang menggemakan pesan apa pun yang Anda kirim atau modifikasi untuk menganonimkan pesan

KEN KAN 2 Oct 21, 2022
A fast, easy to set up telegram userbot running Python 3 which uses fork of the Telethon Library.

forked from friendly-telegram/friendly-telegram Friendly Telegram Userbot A fast, easy to set up telegram userbot running Python 3 which uses fork of

GeekTG 75 Jan 04, 2023
Currency And Gold Prices - Currency And Gold Prices For Python

Currency_And_Gold_Prices Photos from the app New Update Show range Change better

Ali HemmatNia 4 Sep 19, 2022
Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon.

Stork (pleroma-bot) Mirror one or multiple Twitter accounts in Pleroma/Mastodon. Introduction After using the pretty cool mastodon-bot for a while, I

73 Jan 08, 2023
A telegram bot that can send you high-quality audio 🎧🎧🎧

Music downloader bot Still under development Please Report issues to improve this repo.I will try to fix bugs in next update Music downloader bot is a

Anish Gowda 36 Dec 06, 2022
Based Telegram Bot and Userbot To Play Music in Your Telegram Groups With Some Cool Extra Features! 🥰

CallMusicPlus69 This Repo base on! 🤗️ A CallsMusic Based Telegram Bot and Userbot To Play Music in Your Telegram Groups With Some Cool Extra Features

brut✘⁶⁹ // ユスフ 6 Jun 26, 2022
A user reconnaisance tool that extracts a target's information from Instagram, DockerHub & Github.

A user reconnaisance tool that extracts a target's information from Instagram, DockerHub & Github. Also searches for matching usernames on Github.

Richard Mwewa 127 Dec 22, 2022
Python wrapper for the GitLab API

Python GitLab python-gitlab is a Python package providing access to the GitLab server API. It supports the v4 API of GitLab, and provides a CLI tool (

1.9k Dec 31, 2022
Wrapper for vk_api lib for faster bot buliding

Welcome to VKBotPod repository! Wrapper for vk_api lib for faster bot buliding Features Simple syntax Rich functionality Special thanks to movpushmov

NullPointerException 3 Jan 14, 2022
An automated, headless YouTube Uploader

An automated, headless YouTube Uploader Authors: Christian C., Moritz M., Luca S. Related Projects: YouTube Watcher, Twitch Compilation Creator, Neura

127 Dec 23, 2022
Telegram Group Management Bot based on phython !!!

How to setup/deploy. For easiest way to deploy this Bot click on the below button Mᴀᴅᴇ Bʏ Sᴜᴘᴘᴏʀᴛ Sᴏᴜʀᴄᴇ Find This Bot on Telegram A modular Telegram

Mukesh Solanki 5 Nov 17, 2021
Neko is An Anime themed advance Telegram group management bot.

NekoRobot A modular telegram Python bot running on python3 with an sqlalchemy, mongodb database. ╒═══「 Status 」 Maintained Support Group Included Free

Lovely Prince 11 Oct 11, 2022
An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord.

Danganronpa Killing Game Archiving Bot An attempt to make a bot that can auto-archive Danganronpa KG RPs on Discord. The final format is meant to look

Astrea 1 Nov 30, 2021
“ Hey there 👋 I'm Sophia „ TG Group management bot with Some Extra features..

❤️ Sophia ❤️ Avaiilable on Telegram as SophiaBot 🏃‍♂️ Easy Deploy Mandatory Vars [+] Make Sure You Add All These Mandatory Vars. [-] APP_ID: You ca

THEEKSHANA 5 Dec 09, 2021
Web app for spotify playlist management with last.fm integration

Music Tools Set of utility tools for Spotify and Last.fm. Built on my other libraries for Spotify (spotframework), Last.fm (fmframework) and interfaci

andy 3 Dec 14, 2022
Crystal Orb is a discord bot made from discord.py and python

Crystal orb Replacing barbot Overview Crystal Orb is a discord bot made from discord.py and python, Crystal Orb is for anti alt detection and other st

AlexyDaCoder 3 Nov 28, 2021