Smart Settlement Logic

QuickSplit uses a greedy algorithm to simplify complex group debts into the minimum number of transactions possible.

1. Understanding Balances

You Owe (Negative)

When someone pays for you, your balance decreases. A negative balance means you need to pay the group back.

You are Owed (Positive)

When you pay for others, your balance increases. A positive balance means the group owes you money.

Transaction Impact

Expense
Payer gets +Amount. Everyone else gets -Share.
Income
Receiver gets -Amount. Everyone else gets +Share.

2. The Algorithm

1

Separate & Sort

We divide everyone into 'Debtors' and 'Creditors' and sort them by the amount they owe or are owed.

2

Greedy Matching

We take the biggest debtor and the biggest creditor and match them.

3

Eliminate & Repeat

The debt is settled (partially or fully). We repeat this until everyone reaches $0.

3. Real World Example

The Scenario

  • Aarav paid ₹1,500 for Team Dinner.
  • Bhavin paid ₹900 for Drinks.
  • Chirag paid ₹0.

Balances (Total: ₹2,400 / 3)

Aarav+₹700
Bhavin+₹100
Chirag-₹800

Smart Settlement Result

ChiragPays
₹700
AaravReceives
ChiragPays
₹100
BhavinReceives

Chirag settles his entire ₹800 debt by paying the exact amounts owed to Aarav and Bhavin.