Quick view of crypto assets...
Find a file
2024-06-28 08:30:15 -07:00
LICENSE Initial commit 2024-05-09 09:35:34 -07:00
portfolio.sh code cleanup 2024-06-28 08:30:15 -07:00
README.md project ready 2024-05-09 10:00:56 -07:00
template.html project ready 2024-05-09 10:00:56 -07:00
wallet.json project ready 2024-05-09 10:00:56 -07:00

Crypto Portfolio

This is a basic script to use bash | jq to process the contents of a .json "configuration" file and deliver the current status of a portfolio of crypto-currencies based on data retrieved from the Kucoin API (which requires no key).

Results are delivered via an encoded itty.bitty url and can be downloaded as csv records.

Here is an example.

How It Works

Update Portfolio

Update the wallet.json file with an array of objects each containing the token ID, amount you have invested, and balance for each of your currencies.

Make sure your token IDs match what is expected by the API. (https://api.kucoin.com/api/v3/currencies)

Execute Script

Simply run portfolio.sh manually or via cron as you like.

The script will read wallet.json for the tokens it needs to check and then make calls to the Kucoin API to determine prices, comparing that to your indicated balances and evaluating whether or not you are profiting.

The results are inserted into template.html using placeholders (via sed), which is then encoded in itty.bitty to be generated as a unique but constant webpage.

You can bookmark the link, or click the "Download CSV" button (which uses some light JavaScript) to save the results.

ntfy Alerts

While one can simply click on the generated link (or have it delivered any way, really), the portfolio.sh script comes pre-built with the functionality to deliver the results via a ntfy service.

The wallet.json file contains configuration options to specify the server and topic for delivery, and a message will be sent making the notification clickable, taking you directly to the results page.