{"id":20687868,"url":"https://github.com/cribbles/gainz","last_synced_at":"2025-07-30T17:14:22.024Z","repository":{"id":94979245,"uuid":"148218238","full_name":"cribbles/gainz","owner":"cribbles","description":"A simple CLI cryptocurrency portfolio","archived":false,"fork":false,"pushed_at":"2019-04-01T09:08:34.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-17T16:52:37.278Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cribbles.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-10T20:57:21.000Z","updated_at":"2022-03-17T09:23:34.000Z","dependencies_parsed_at":"2023-03-24T18:33:32.680Z","dependency_job_id":null,"html_url":"https://github.com/cribbles/gainz","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cribbles%2Fgainz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cribbles%2Fgainz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cribbles%2Fgainz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cribbles%2Fgainz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cribbles","download_url":"https://codeload.github.com/cribbles/gainz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242945838,"owners_count":20210762,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-16T22:58:29.652Z","updated_at":"2025-03-10T23:59:11.551Z","avatar_url":"https://github.com/cribbles.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gainz - a simple CLI cryptocurrency portfolio\n\n## Summary\n\nThis is a script to keep track of the money you and your friends have lost gambling on cryptocurrencies.\n\n## Usage\n\n```bash\nUsage: gainz.rb [options]\n   -a, --add USER                   Add a user\n   -u, --update USER CRYPTO AMOUNT  Update a user's crypto balance\n   -p USER [-c, --currency CURRENCY] [-d, --duration DURATION],\n       --portfolio                  Display a user's portfolio\n   -l [-c, --currency CURRENCY] [-d, --duration DURATION],\n       --leaderboard                Display the current leaderboard\n   -h, --help                       Show this help message\n```\n\n## Dependencies\n\nYou probably already have everything you need installed.\n\n- Ruby \u003e= 1.9.3\n- Sqlite3\n\n## Setup\n\n```bash\n./init.sh\nbundle install\n```\n\n## Key Features\n\n- Fast and simple\n- Multiple user support\n- Everything is stored locally\n- Tracks your portfolio in any major currency or cryptocurrency (defaults to USD)\n- Shows % change over arbitrary durations - find out how much more your portfolio would have been worth an hour, day, week, month or year ago\n\n## What this script does not do\n\n- Encrypt your portfolio\n- Help you make better investments\n- Keep track of what you bought, when. The % change feature just tells you how much your portfolio would have been worth per coin at a given duration.\n\n## Examples\n\n### Creating a user\n\n```bash\n$ ./gainz.rb -a alice\nAdded user successfully.\n```\n\n### Updating a user's balance\n\n```bash\n$ ./gainz.rb -u alice eth 9.4\nUpdated balance successfully.\n\n$ ./gainz.rb -u alice xmr 1.2\nUpdated balance successfully.\n\n$ ./gainz.rb -u alice xlm 23.95\nUpdated balance successfully.\n```\n\n### Viewing a user's portfolio\n\n```bash\n$ ./gainz.rb -p alice\nUSER: alice\nTOTAL: 1935.14 (-1.83%)\n\nPercent      Currency      Price      Change      Holdings      Value (USD)\n93%          ETH           192.09     (-1.88%)    9.40          1805.61\n6%           XMR           104.21     (-1.03%)    1.20          125.05\n0%           XLM           0.19       (-1.87%)    23.95         4.48\n```\n\n### Checking the leaderboard\n\n```bash\n$ ./gainz.rb -a bob\nAdded user successfully.\n\n$ ./gainz.rb -u bob btc 3.22\nUpdated balance successfully.\n\n$ ./gainz.rb -u bob bch 1.44\nUpdated balance successfully.\n\n$ ./gainz.rb -u bob ltc 6\nUpdated balance successfully.\n\n$ ./gainz.rb -l -d month -c eur\nLEADERBOARD\n\nRanking      User      Total (EUR)      Change\n1            bob       18243.16         (+0.54%)\n2            alice     1669.61          (-37.18%)\n```\n\n## FAQ\n\n**How do I update the amount of a currency I've already added?**\n\nJust run `-u USER CURRENCY AMOUNT` with the new amount to overwrite it.\n\n**How do I delete a user?**\n\nThere isn't a command for this. Just run a DELETE query from sqlite3 CLI:\n\n```sql\nDELETE FROM users WHERE name = '$NAME'\n```\n\n**Where does the price data come from?**\n\n[CryptoCompare.com's API](https://www.cryptocompare.com/api/).\n\n## TODO\n\n- Add tests\n- Put functions in different folders, or something like that?\n- Move away from [`OptionParser`](https://ruby-doc.org/stdlib-1.9.3/libdoc/optparse/rdoc/OptionParser.html). Seemed like a good idea at the time, but it doesn't handle flag arguments well. Oops\n\n## Contributing\n\nPlease keep changes Ruby 1.9.3 compatible. I like the syntax in later versions better too but I'm running this on a remote server using Ubuntu 14.04 LTS and don't want to tinker with rvm.\n\nSpecial thanks [guregu](https://github.com/guregu) for tweaking the price conversion logic from O(N) to O(1).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcribbles%2Fgainz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcribbles%2Fgainz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcribbles%2Fgainz/lists"}