Live Demo • Modern web app for accurately computing Bangladeshi Mobile Financial Service (MFS) cash‑out fees.
Traditional calculators still assume a flat 1.85%. This app implements current tiered and contextual fee rules (e.g., bKash Priyo Agent limits, Nagad channel differences, ATM withdrawal variability) to produce precise, explainable results.
Cash‑out calculations in Bangladesh now depend on:
- Tiered percentages (e.g. bKash Priyo Agent: 1.49% up to 50,000 Tk monthly, then 1.85%).
- Channel-based pricing (e.g. Nagad App vs USSD).
- Institution-specific ATM withdrawal fees.
- Split scenarios when a transaction straddles a tier boundary.
This project encodes those rules with transparent, test‑backed logic so users can trust the numbers.
| Feature | Description |
|---|---|
| ⚡ Tiered Logic Engine | Splits a single withdrawal across remaining discounted quota and standard rate seamlessly. |
| 📱 Programmatic SEO | Pre-rendered dynamic routes (/bkash, /nagad, etc.) for improved discoverability. |
| 🛡️ Type-Safe | Strict TypeScript interfaces guard financial logic. |
| 🧪 Unit Tested | Jest suites cover edge cases (boundary splits, rate transitions). |
| 🎨 Dynamic Theming | Provider selection auto-adjusts brand palette for UI components. |
| 🚀 Fast Rendering | Next.js App Router + React Server Components for optimized payloads. |
| Layer | Tech |
|---|---|
| Framework | Next.js 16 |
| Language | TypeScript (strict) |
| Styling | Tailwind CSS |
| Testing | Jest |
| Deployment | Vercel |
git clone https://github.com/BlasterOverlord/cashout-calculator.git
cd cashout-calculatornpm installnpm run devOpen http://localhost:3000 to view the app.
npm run build
npm run startFinancial accuracy is critical. The Jest suite covers standard fees, tier boundaries, and split logic.
Run tests:
npm testSample Output:
PASS src/utils/__tests__/calculate.test.ts
Fee Calculation Logic
✓ calculates standard bKash fee correctly (1.85%) (2 ms)
✓ calculates Priyo fee correctly when under limit (1.49%) (1 ms)
✓ correctly splits fee when transaction crosses the limit boundary (1 ms)
Add more cases in src/utils/__tests__/ to extend coverage.
Contributions are welcome!
- Fork the project
- Create a feature branch:
git checkout -b feature/AmazingFeature
- Commit changes:
git commit -m "feat: Add AmazingFeature" - Push:
git push origin feature/AmazingFeature
- Open a Pull Request
Please:
- Write tests for logic changes.
- Update documentation if fee rules are modified.
- Follow conventional commits (
feat:,fix:,docs:, etc.).
Rates are implemented based on publicly available information and observed provider behavior as of 2025. Always verify critical transactions against official provider disclosures. If a discrepancy is found, please open an issue with:
- Provider name
- Expected vs. actual fee
- Date and channel (App / USSD / ATM)
Distributed under the GPL-3.0 License. See LICENSE for details.