Bitcoin address total investment
With this cli you can know if a Bitcoin address is profitable or not.
It goes through each Utxo(a certain amount of cryptocurrency that has been authorized by a sender and is available to be spent by a recipient) of the given address and checks the USD price when the transaction occured.
$ cargo run -- --address=<BTC_ADDRESS> --delay=<OPTIONAL_DELAY_IN_SECONDS>
Due to a limitation on CoinGecko api, if an address has more than 30 utxos, the api will fail with TOO_MANY_REQUESTS
. By adding a delay as env var when running the application, we can mitigate that. This deeply affects the UX, but it's the only option I could think of right now.
$ cargo build
- If an address has more than 30 transactions, CoinGecko api will fail with a
TOO_MANY_REQUESTS
status code. - CoinGecko only has historical price data from May 28th 2013. So if any address has transactions older than that, the app will crash. We can apply a handler for cases like this and assume a USD value of 0(zero) to avoid breaking the program.
I am not a Rust developer myself, so this app could definitely use help 😅
![Screenshot 2023-09-20 at 10 59 25](https://private-user-images.githubusercontent.com/2279686/269227859-dd41d704-3e37-4aa0-aae6-60967494fbba.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDQ2NDAsIm5iZiI6MTczOTIwNDM0MCwicGF0aCI6Ii8yMjc5Njg2LzI2OTIyNzg1OS1kZDQxZDcwNC0zZTM3LTRhYTAtYWFlNi02MDk2NzQ5NGZiYmEucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTBUMTYxOTAwWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YTRhZTIzMWE5NGY3NmUyMWZmOGZmZjIzOTllMjA1N2EwNzg1MTMzODUyZTgyNDVmZmY5ZTM4NjcwNjI3ZDE0NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.KBxvMF0fgx9EkztlDYIMJgoMuTEQqNAd5L-P4tEw7fo)