// PROJECT · 2022

tax_hurdle

STCG, LTCG, and speculation tax calculator for Indian equity traders. Parses broker Excel exports, auto-detects column mapping, and produces quarterly breakdowns.

JavaSpring BootApache POIJavaFXSwagger

The Problem

Indian equity traders must calculate STCG, LTCG, and speculation (intraday) P&L separately for ITR filing, across hundreds or thousands of transactions from broker exports. Manual spreadsheet work takes hours and drifts easily. tax_hurdle automates the entire pipeline from raw broker XLSX to a clean quarterly summary.

How It Works

Upload a broker export (Upstox, Zerodha, or similar). The system auto-detects the column layout, classifies each trade as STCG/LTCG/speculation, and produces:

  • Per-quarter STCG and LTCG breakdowns (standard Indian Q1–Q4 + Q5 scheme)
  • Speculation P&L and turnover (intraday trades, abs P&L basis)
  • Downloadable Excel summary report

Two interfaces ship in the same repo: a Spring Boot REST API (with Swagger UI) and a JavaFX desktop GUI.

Features

Auto-detect Broker Mapping
Identifies column layout from the XLSX header row. Supports Upstox, Zerodha, and configurable mappings. Shows a preview so you can diagnose mismatches before processing.
Trade Classification
Separates STCG (held >24h), LTCG (held >1y), and intraday speculation automatically. Handles the FIFO queue required by Indian tax law for STCG matching.
Spring Boot REST API
POST broker XLSX → receive JSON breakdown or download a formatted Excel summary. Swagger UI included for manual testing without a frontend.
JavaFX Desktop GUI
File picker, live results table, and export button — runs fully offline. Built for traders who prefer not to upload financial data to a server.

Stack

language
Java 17+
api
Spring Boot
excel
Apache POI 5.x
desktop
JavaFX
docs
Swagger / OpenAPI
logging
Apache Log4j2

Sample Output

[INFO] Parsed 2,401 transactions from broker export.

STCG Summary (FY 2021-22):
  Q1 Apr–Jun  ₹ 45,000
  Q2 Jul–Sep  ₹ 67,500
  Q3 Oct–Dec  ₹ 32,100
  Q4 Jan–Mar  ₹ 58,900
  Q5 Mar-end  ₹ 12,500
  ─────────────────────
  Total STCG  ₹ 2,16,000

Intraday Speculation P&L  ₹ 8,50,000