πŸ“ˆ GH Trending Explorer 🎲 Surprise me

← all repos

Gemma41 / Onchain-Accounting

git clone https://github.com/Gemma41/Onchain-Accounting.git Onchain-Accounting Β· 25d ago

Privacy-first, self-hosted crypto accounting app with zero cloud data sharing. Aggregates exchange, wallet and multi-chain history, calculates FIFO/LIFO/HIFO cost basis, realized/unrealized PnL and capital gains, tracks staking/airdrop income, and exports tax-ready CSV/PDF/JSON reports. Encrypted SQLite. Python, cross-platform.

β€”
stars, 24h
β€”
stars, 7 days
+78
stars, 30 days Β· #2,874
78
β˜… total
15
forks Β· 0 open issues

Star history starts 2026-10-20; the chart appears after the second daily snapshot.

LanguagePython
LicenseMIT
Created2026-09-21 (29d ago)
Last push1d ago
Watchers0
OwnerUser

GitHub topics

Links

README excerpt
# Onchain-Accounting
Privacy-first, self-hosted crypto accounting app with zero cloud data sharing. Aggregates exchange, wallet and multi-chain history, calculates FIFO/LIFO/HIFO cost basis, realized/unrealized PnL and capital gains, tracks staking/airdrop income, and exports tax-ready CSV/PDF/JSON reports. Encrypted SQLite. Python, cross-platform.
---
# Onchain Accounting
**Self-Hosted Crypto Accounting β€” Cost Basis, PnL & Tax Reports**
---
*Privacy-first crypto accounting that never phones home. Cost basis, PnL and tax-ready capital gains reports from CSV, exchange APIs and on-chain history β€” everything computed and stored on your machine, encrypted at rest.*
Features Β· Cost Basis Methods Β· Import Pipeline Β· Getting Started Β· Configuration Β· Usage Β· FAQ
---
## Features
### Accounting Engine
| Feature | Status |
|---------|--------|
| FIFO / LIFO / HIFO Cost Basis | βœ… |
| Method Comparison Report | βœ… |
| Short / Long-Term Split (365d) | βœ… |
| Fee-Inclusive Basis | βœ… |
| Realized & Unrealized PnL | βœ… |
| Receipt-Date Income Valuation | βœ… |
| Staking / Airdrop / Interest Income | βœ… |
| Open Lot Inspection | βœ… |
### Data & Privacy
| Feature | Status |
|---------|--------|
| CSV Import (any exchange format) | βœ… |
| Exchange API Sync (read-only) | βœ… |
| On-Chain History (6+ chains) | βœ… |
| Duplicate Detection | βœ… |
| Historical Price Engine | βœ… |
| Tax-Ready CSV / PDF / JSON | βœ… |
| Encrypted Local SQLite | βœ… |
| Zero Cloud / Zero Telemetry | βœ… |
---
## Cost Basis Methods
Every disposal is matched against acquisition lots. The method you choose changes which lots are sold first β€” and therefore your taxable gain:
| Method | Sells first | When it helps |
|--------|-------------|---------------|
| **FIFO** | Oldest lots | Default in most jurisdictions; maximizes long-term treatment in bull markets |
| **LIFO** | Newest lots | Defers gains when recent buys sit close to current price |
| **HIFO** | Highest-cost lots | Minimizes immediate gains by disposing the most expensive lots first |
The Tax Report runs **all three methods over the same lot history** so you can see the liability impact before committing:
 [code] 
Income events (staking, airdrops, interest) are valued at the fiat rate on the receipt date β€” and that valuation becomes the asset's cost basis going forward.
---
## Import Pipeline
 [code] 
- **CSV** β€” drop any exchange export into `./imports`; the normalizer maps column dialects automatically
- **Exchange APIs** β€” read-only keys for Binance, Coinbase and Kraken pull fills, deposits and withdrawals
- **On-chain** β€” wallet history sync across Ethereum, BNB Chain, Polygon, Arbitrum, Base and Bitcoin
- **Dedup** β€” the same transfer seen from an exchange API and on-chain is merged, never double-counted
---
## Getting Started
### Prerequisites
- **Python** 3.10 or higher
- **pip** (latest recommended)
- CSV exports from your exchanges, or read-only API keys
- No account, no cloud signup, no telemetry β€” ever
### Installation
**Windows:**
 [code]