Comparison with Other Applications
⚖️ Comparison with Other Applications
Section titled “⚖️ Comparison with Other Applications”To understand the engineering behind Kryptofolio, it is helpful to compare its technical design against the two dominant categories of portfolio and tax tracking solutions on the market:
- Conventional Open-Source Trackers: Desktop or self-hosted apps typically built on monolithic relational databases (like PostgreSQL or single-table SQLite) and client-side array calculations.
- Commercial Cloud SaaS Solutions: Proprietary, cloud-hosted platforms requiring full data exfiltration and black-box calculation logic.
📊 Architectural Comparison Matrix
Section titled “📊 Architectural Comparison Matrix”| Architectural Dimension | Kryptofolio | Conventional Open-Source Apps | Commercial Cloud SaaS Platforms |
|---|---|---|---|
| Deployment Model | Local-First (Single-User) | Self-Hosted Server / Desktop App | Cloud-Only Multi-Tenant SaaS |
| Privacy & Security | 100% Local (AES-256-GCM Vault) | Relational DB without local key scrubbing | Stored on third-party cloud servers |
| Fiscal Engine | Global FIFO + Double-Entry Custody | Simple Cost Average or naive FIFO | Black-box calculations |
| Internal Transfers | Non-taxable; never splits lots | Heuristic time-window pairing | Frequently flags false sales |
| Analytical Engine | DuckDB Vectorized Columnar OLAP | Relational SQL / In-memory JS arrays | Remote cloud batch workers |
| Precision Model | PreciseAmount (Zero Float Loss) |
Standard IEEE-754 Floats | Proprietary representation |
| Software Architecture | Strict Hexagonal (Ports & Adapters) | Component-coupled or MVC monolith | Proprietary monolith / microservices |
| Time-Series Storage | Apache Parquet (Hive partitioned) | Relational SQL rows / bloat | Cloud Data Lakes |
| Exchange Ingestion | Declared Source Format Profiles | Generic column renaming | Pre-built API sync / generic mappers |
| Interface Style | Institutional Light Terminal | Generic component library / dark mode | Consumer-oriented dashboards |
🔬 Deep-Dive Architectural Differences
Section titled “🔬 Deep-Dive Architectural Differences”1. Internal Transfer Reconciliation vs. Global FIFO
Section titled “1. Internal Transfer Reconciliation vs. Global FIFO”A central differentiator in Kryptofolio is how it handles movements between user accounts (e.g. withdrawing from an exchange to a hardware cold wallet).
- How Other Applications Do It: Most applications attempt to pair outbound and inbound transfer legs using a heuristic time window (e.g. transactions within 1 to 2 hours) and an amount tolerance. In self-custodial cryptocurrency management, this heuristic frequently breaks down: network congestion, long-delayed withdrawals, and blockchain gas fees disrupt amount and time equality. Furthermore, two identical transfers in quick succession can cross-match unpredictably.
- How Kryptofolio Does It: Kryptofolio does not rely on fragile time-window heuristics. It computes Taxation FIFO (global per asset) completely separately from a Custody Double-Entry Ledger. Internal transfers simply append entries to the custody ledger (
qty_delta: -Xon origin,+Xon destination). The acquisition lot is never split, its original cost basis is preserved, and no capital gain or loss is triggered.
2. Dual-Database: Transactional SQLite + Vectorized DuckDB
Section titled “2. Dual-Database: Transactional SQLite + Vectorized DuckDB”Other tracking tools typically run all analytical queries inside a single transactional database or evaluate calculations on the client using JavaScript array operations.
When a portfolio contains thousands of transactions over multiple tax years:
- In-memory JavaScript calculations freeze the user interface thread.
- Relational SQL engines struggle with recursive cumulative FIFO joins and multi-year time-series statistics.
Kryptofolio’s approach:
- SQLite (
kryptofolio_ledger.db): Optimized strictly for high-concurrency ACID transactions, audit logging via native SQLite triggers, and soft-delete compliance. - DuckDB (
fiscal.duckdb): Zero-copy connection (ATTACH ... TYPE SQLITE). DuckDB executes vectorized Window Functions to materialize the derived FIFO chain and compute rolling statistical metrics (Sharpe ratio, ATH drawdowns, daily valuation) in milliseconds without database bloat.
3. Source Format Profiles vs. Ad-Hoc Mapping
Section titled “3. Source Format Profiles vs. Ad-Hoc Mapping”Different exchanges export CSV files with contradictory conventions:
- Some exchanges export fees in fiat currency while actually deducting them in an altcoin.
- Others record movements by writing the same quantity into both directional columns (
amount_inandamount_out). - Others mix spot and derivative settlements in the same export without clear flags.
While other applications rely on runtime heuristics or simple column renaming, Kryptofolio uses Source Format Profiles (packages/core-domain/src/domain/services/sourceProfile/). Exchange quirks (fee denomination, gross/net conventions, directional fills) are formally declared as immutable data profiles recognized by signature detection before any mapping occurs.
4. Zero Float-Loss Guarantee (PreciseAmount)
Section titled “4. Zero Float-Loss Guarantee (PreciseAmount)”In finance, IEEE-754 floating-point errors (0.1 + 0.2 === 0.30000000000000004) lead to balance divergence and tax discrepancies over time.
Kryptofolio enforces Pure Domain Isolation:
- Core Domain ports only accept
PreciseAmountbranded strings. - Decimal operations are strictly confined to Application use cases and DuckDB columnar types (
DECIMAL(38,18)). - Data crossing the Anti-Corruption Layer (ACL) is validated against strict regular expressions before entering the system.