Skip to content

Commit

Permalink
update readme and cli documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominion5254 committed Jan 9, 2024
1 parent 12f602a commit b2ec632
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
5 changes: 0 additions & 5 deletions README

This file was deleted.

21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Rust RGL Ledger
This project provides a CLI interface for tracking Bitcoin acquisitions/dispositions and associated realized gains and losses for both GAAP and Tax purposes using the FIFO methodology. GAAP RGL are calculated using impaired asset values, while Tax RGL are calculated the original basis.

## Installation
* Download the RGL Ledger using `git clone && cd rust_rgl_ledger`.
* Specify the `DATABASE_URL` with the command `echo DATABASE_URL=/Users/name/path/to/rust_rgl_ledger/database/rgl_db.sqlite3 > .env`
* Build using `cargo build --release`.
* Install systemwide with `cargo install --path .`
* Run `rust_rgl_ledger --help` to see the available commands.

## Input File
When importing a CSV file using `rust_rgl_ledger import <file>` the file should be specified with the path from the current working directory i.e. `./importfiles/transactions.csv`.

The file to be imported should have 3 columns with the below headers exactly as they appear below, and the corresponding data:
* Date - Import supports a variety of formats including DateTime i.e. `10/31/23 14:32:17`.
* Bitcoin - Expressed as a decimal i.e. `.21`. Bitcoin acquisitions should be expressed as a positive number while Bitcoin dispositions should be expressed as a negative number.
* Price - The USD exchange price of One BTC i.e. `$46,145.26`. **Note** Entering the USD value of the acquisition/disposition for this field will result in the WRONG calculations.

## Misc
* At this time, rust_rgl_ledger is only configured to work using a sqlite database.
* `Holdings` Report limitations: While the holdings report will include all acquisitions up to the specified date, the UndisposedBTC values *will* include any dispositions after the specified date. i.e. if a holdings report is run as of 6/30/23, the UndisposedBTC values will consider dispositions from 7/1/23 and beyond.
6 changes: 5 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ fn main() {

#[derive(Subcommand)]
enum Command {
/// Import a specified CSV file at the provided path
Import {
/// The file to import
/// The file to import including three columns: Date, Bitcoin, Price
#[clap(long)]
file: std::path::PathBuf,
},
/// Impair Bitcoin holdings to a specified price as of a specified date
Impair {
/// The USD price to impair Bitcoin holdings
#[clap(long)]
Expand All @@ -65,6 +67,7 @@ enum Command {
#[clap(long)]
date: String,
},
/// Export a CSV report of GAAP and Tax Realized Gain/Loss activity for a specfied period
Report {
/// The beginning date for RGL report
#[clap(long)]
Expand All @@ -73,6 +76,7 @@ enum Command {
#[clap(long)]
end: String,
},
/// Export a CSV report of Bitcoin holdings as of a specified date
Holdings {
/// The ending date of the holdings report
#[clap(long)]
Expand Down

0 comments on commit b2ec632

Please sign in to comment.