DEV Community

Cover image for Cash, Bank, UPI, or Credit Card? Why Your Finance App Must Treat Them Differently
DEVANSHU PATIL
DEVANSHU PATIL

Posted on

Cash, Bank, UPI, or Credit Card? Why Your Finance App Must Treat Them Differently

Cash, Bank, UPI, or Credit Card? Why Your Finance App Must Treat Them Differently

In the physical world, money is easy to categorize.

You have bills in your wallet, numbers on your bank statement, credit limits on plastic cards, and long-term certificates in a safe deposit box. You naturally treat them differently: you know you can spend physical cash instantly, but you cannot pay for a restaurant lunch by handing the waiter your retirement mutual fund certificate.

Yet in the software world, personal finance apps often flatten all these accounts into a single generic structure: an account name and a balance number.

When software treats every account identically, it makes accurate financial forecasting impossible.

Here is why account archetypes matter, and how FinLedger models real-world financial instruments cleanly.

The Problem With Generic Accounts

Suppose a personal finance application allows you to create arbitrary accounts with arbitrary names. You create four accounts:

  • "HDFC Checking" with 40,000 rupees
  • "Cash Wallet" with 5,000 rupees
  • "SBI Credit Card" with 25,000 rupees
  • "Equity Portfolio" with 200,000 rupees

If the database treats all four as generic accounts, how does it compute your total balance?

It simply adds them up: 40,000 + 5,000 + 25,000 + 200,000 = 270,000 rupees.

flowchart TD
    subgraph FlawedGeneric["The Naive Generic Account Model"]
        A1["Checking: 40,000"]
        A2["Cash: 5,000"]
        A3["Credit Card Debt: 25,000 (Added instead of Subtracted!)"]
        A4["Investments: 200,000"]
        A1 & A2 & A3 & A4 -->|"Summed Blindly"| Total["Fictitious Balance: 270,000"]
    end

Notice what just happened:

  1. The 25,000 rupees owed on the credit card was added as an asset instead of being subtracted as a liability!
  2. The 200,000 rupees in the stock market was treated as spendable cash, even though selling equities requires market hours, settlement delays, and capital gains taxes.

A user relying on that single total will walk through their day with a completely distorted understanding of their liquidity.

The FinLedger Account Taxonomy

To model financial reality accurately, FinLedger establishes seven formal account archetypes at the database level. Each archetype has explicit mathematical invariants, presentation rules, and transaction constraints:

classDiagram
    class AccountArchetype {
        <<enumeration>>
        CASH
        BANK
        UPI_WALLET
        CREDIT_CARD
        INVESTMENT
        FIXED_DEPOSIT
        RECURRING_DEPOSIT
    }
    class LiquidAsset {
        Increases Available Money
        Increases Net Worth
        Instant Operational Liquidity
    }
    class ShortTermLiability {
        Decreases Available Money
        Decreases Net Worth
        Requires Settlement Transfer
    }
    class IlliquidCapital {
        Zero Impact on Available Money
        Increases Net Worth
        Requires Liquidation Transfer
    }
    AccountArchetype <|-- LiquidAsset : CASH, BANK, UPI_WALLET
    AccountArchetype <|-- ShortTermLiability : CREDIT_CARD
    AccountArchetype <|-- IlliquidCapital : INVESTMENT, FIXED_DEPOSIT, RECURRING_DEPOSIT

1. Liquid Assets: Cash, Bank, and UPI Wallets

  • CASH: Physical paper currency held in wallets or home safes. Unlinked to external financial institutions; balances update via manual cash expenses or ATM withdrawals.
  • BANK: Checking and savings accounts held at commercial institutions. Supports automated SMS transaction detection, bank statement reconciliation, and direct salary deposits.
  • UPI_WALLET: Digital wallets and instant payment handles (such as Google Pay, PhonePe, Paytm). Acts as a liquid payment conduit tightly mapped to primary bank accounts.

Behavior: Liquid assets represent immediate spendable purchasing power. They contribute positively ($+1.0$) to both Available Spendable Money and Total Net Worth.

2. Short-Term Liabilities: Credit Cards

  • CREDIT_CARD: Revolving credit lines provided by financial institutions.
  • Accounting Rule: The currentBalance strictly represents a positive liability—what you owe to the card issuer.
  • Available Credit: Calculated as $\text{creditLimit} - \text{currentBalance}$.
  • Purchases vs Payments: Purchases increase the liability; bill payments reduce the liability.

Behavior: Credit card debt contributes negatively ($-1.0$) to both Available Spendable Money and Total Net Worth. By subtracting credit card debt from liquid cash immediately, the application ensures that the money required to pay the upcoming bill is never accidentally spent.

3. Illiquid & Capital Growth Assets: Investments, FD, and RD

  • INVESTMENT: Equity holdings, mutual funds, gold, exchange-traded funds (ETFs), and crypto assets with manual unit price tracking and unrealized profit and loss.
  • FIXED_DEPOSIT (FD): Fixed-term bank deposits locked for specific durations earning term interest.
  • RECURRING_DEPOSIT (RD): Systematic monthly savings deposits with locked maturity dates.

Behavior: These accounts represent wealth, but not immediate liquidity. They contribute positively ($+1.0$) to Total Net Worth, but contribute exactly zero ($0.0$) to Available Spendable Money.

Enforcing Structural Safeguards

By modeling accounts through explicit archetypes rather than generic numbers, the application can enforce domain-level guards:

  • Transaction Account Filtering: When a user selects an operational EXPENSE, liability accounts (Credit Cards) and term deposits are filtered out of the source account picker.
  • Waterfall Payment Settle: When paying a credit card bill, the destination picker only displays active credit cards with unpaid statements.
  • Safe Archival: Accounts can be archived when closed, hiding them from daily transaction pickers while preserving historical relational integrity across past statements and reports.

Key Takeaway

Financial software must understand the nature of the money it tracks.

Separating liquid cash, debt liabilities, and long-term capital investments into formal account archetypes prevents accidental debt, eliminates false senses of wealth, and provides clear visibility into daily personal finances.


FinLedger is a privacy-first, offline-first personal finance application for Android that models bank accounts, credit cards, and cash without double-counting.

Explore FinLedger on Google Play: https://play.google.com/store/apps/details?id=com.devanshufinance.app

Top comments (0)