Fees go up in steps
A mobile money fee is not a percentage: it comes from a grid of tiers, each with its own fee. Withdrawing or sending everything in one go is what most people do, and it is rarely the cheapest. Split so that each part lands in the right tier, the same money leaves more in your hand.
An exact answer
The optimizer is plain Dart, kept apart from the interface. For a given number of operations per tier, the best amounts have a closed form; the counts themselves are searched with bounds that cut whole branches without ever losing the best plan. The result is proven optimal, and the tests check it against an exact brute-force solver on hundreds of random grids. It runs in a background isolate, so the screen never freezes.
Cash comes in notes
A cash point cannot hand out 10 040, so withdrawals are rounded to the hundred by default, and the search stays exact with that step. With 2 058 989 on an MVola account, three withdrawals instead of one put 2 043 000 in cash in your hand rather than 2 039 300: the 3 700 that went to fees stays yours.
The operators' own grids
A separate public repository reads the official grids every day: MVola from its rates page, Orange Money from a PDF, while Airtel Money refuses automated access and is copied by hand. A scraper that breaks keeps the previous grids, so the app never receives broken data. The app ships a copy and works offline from the first launch; an update lists what changed before applying it, and a grid you edited yourself only goes back to the official one if you say so.







