Skip to content

Calculate the dollar cost average of a given address

License

Notifications You must be signed in to change notification settings

fernandoporazzi/bati

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bati

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.

Running

$ 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.

Building

$ cargo build

Known issues and limitations

  • 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.

Other

I am not a Rust developer myself, so this app could definitely use help 😅

Screenshot 2023-09-20 at 10 59 25

About

Calculate the dollar cost average of a given address

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages