Install
openclaw skills install @voronindenis5/group-expense-settlerSplit group expenses fairly (equal or weighted shares) and compute the minimum number of money transfers to settle up. Reads a simple ledger of who paid for what, handles non-even splits, weights, and shared vs personal items, then produces an optimal settlement plan (who pays whom, how much) plus a fairness audit. Use when settling trip costs with friends, splitting rent and utilities among roommates, or running any shared-expense pool without a dedicated app.
openclaw skills install @voronindenis5/group-expense-settlerYou went on a trip with five friends. Everyone paid for something — hotels, gas, dinners, tickets. Now there's a tangle of "I paid for you there, you paid for me here" that nobody can untangle. This skill reduces the whole mess to the fewest possible payments that make everyone whole.
Settling shared expenses has two separate problems, and most people conflate them:
For #2 the naive approach ("everyone who underpaid pays the person who overpaid the most") generates O(n²) transfers. The min-cash-flow algorithm — greedy matching of the largest creditor against the largest debtor — provably needs at most n−1 transfers and typically far fewer. For a 6-person trip: 15 possible payment edges → usually 4 or 5 actual transfers.
scripts/settle_up.py implements:
payer,amount,people... (+ optional --weights or per-item
exclusions)paid − fair_share = net. Positive
net = is owed money; negative = owes.Don't use for: continuous running balances you want synced with a bank (Splitwise et al.), or formal bookkeeping/double-entry accounting.
Ana,450,Ana Ben Cho Dan # hotel, 4-way
Ben,120,Ben Cho # taxi, 2-way
Cho,80,Ana Ben Cho Dan # groceries all
python3 scripts/settle_up.py --ledger trip.txt
python3 scripts/settle_up.py --ledger rent.txt --weights "Ana:2,Ben:1,Cho:1"
--show-items to see every person's share of every line —
settle arguments with arithmetic, not vibes.min(creditor.net, −debtor.net). One of them reaches exactly 0 and leaves
the pool. Append the transfer.Ledger:
Ana,450,Ana Ben Cho Dan
Ben,120,Ben Cho
Cho,80,Ana Ben Cho Dan
Dan,60,Ben Cho Dan
Nets: Ana paid 450 / share 132.50 → +317.50 · Ben paid 120 / share 212.50 → −92.50 · Cho paid 80 / share 212.50 → −132.50 · Dan paid 60 / share 152.50 → −92.50. (Check: 317.50 − 92.50 − 132.50 − 92.50 = 0 ✓)
Settlement (3 transfers, not up to 6):
Ben pays Ana $92.50
Cho pays Ana $132.50
Dan pays Ana $92.50
Everyone else is done — no "you pay me and I pay her" chains.
Ana,450,Ana Ben Cho Dan
splits among all four including Ana — usually right. If Ana paid but
isn't consuming, list only the consumers: Ana,450,Ben Cho Dan.1200.50 not 1,200,50 —
the ledger is comma-separated.--show-items before announcing numbers; a typo
in one amount silently shifts everyone's net.--weights gets weight 1 silently — check the printed weight table.--show-items totals match your receiptsTrip settle-up with per-line participants:
python3 scripts/settle_up.py --ledger trip.txt --show-items
Roommates — rent weighted by room, utilities even:
Ana,2400,Ana Ben Cho
utility,180,Ana Ben Cho
python3 scripts/settle_up.py --weights "Ana:2,Ben:1,Cho:1" --ledger rent.txt
Paste-ready plan for the group chat:
python3 scripts/settle_up.py --ledger trip.txt --json | python3 -c \
"import json,sys; [print(t['line']) for t in json.load(sys.stdin)['transfers']]"