Zaven Jooharian
  1. Zaven Jooharian
  2. Blog

Dollars, lira and a rate that changes daily: a two-currency money engine

4 min read

Prices in dollars, payments in lira: how OG System keeps a live rate and a balance for every place money sits.

Dollars, lira and a rate that changes daily: a two-currency money engine

Every price in the shop is in dollars. Every customer pays in lira. Somewhere between the sticker and the cash drawer, someone has to do the maths, and the number they multiply by is not the same tomorrow as it is today.

That is the money problem I ran into while building OG System for OG Sports, a sneaker and streetwear shop in Aleppo. I built it with Ahmad Sabagh, my partner in our studio, Zaven & Ahmad Builds. The overview is on the OG System case page. This post is about one part of it: the two-currency money engine.

Two currencies, one shelf

In a normal shop system there is one currency. A price is a number, the till adds numbers up, and the report adds the same numbers up again. Nothing in that design expects a second currency, so when you bolt one on afterwards you get the usual mess: a column of dollar prices, a column of lira prices, and a spreadsheet somewhere that says which rate was used on which day.

We did not want to bolt it on. In OG System, prices are set in dollars, the lira rate is a live value, and the system works out the lira amount when it needs one. The point is that nobody has to retype a rate every morning and hope they did not mistype a digit.

A balance for every place money sits

Converting a price is the easy half. The harder half is knowing where the money is.

In a shop like this, money sits in many places at once: the cash drawer, the delivery drivers who collect cash on delivery, and every other place the shop keeps money. Each of those can hold dollars, lira, or both. So OG System keeps a balance for every place money sits, in both currencies, instead of one grand total.

That choice matters more than it sounds. A single total can only answer "how much have we made?". A balance per place is what lets you ask "how much cash is still out with the drivers?" or "how many dollars are in the drawer right now?". Those are the questions that matter when you are counting money at the end of a day.

The rate had to come from somewhere

A live rate needs a source. Typing it in by hand works for a week and then someone forgets.

So I built the Syrian lira rate API with Ahmad. It keeps the USD to SYP rate up to date automatically, and any website or system can call it to convert prices. Its case page describes it in two lines: plug it into a store or a system and prices show in lira and dollars without anyone typing the rate in.

It is already running inside OG System, and it also feeds the two-currency prices on the OG online store. That means the shop and the website agree on the rate by construction, not because two people remembered to update two places. If you have read about how the till keeps selling when the connection drops, it is the same instinct: take the fragile manual step out of the middle.

What I would tell another builder

A few things I took from this, none of them clever.

First, model the money before you model the screens. Once "a balance per place, per currency" is in the data, the screens follow. If it is not in the data, no screen can fix it later.

Second, never make a human the source of a number that changes every day. People are good at judgement and bad at remembering to update a rate. Give that job to a service.

Third, build the rate as its own small thing. Because it is an API and not a setting buried inside one app, the second project, the online store, got it for free.

Why this belongs to local reality

Software built for other markets often assumes that a price is a price. In Aleppo a price has two faces, and a good system has to show both without making the staff choose. I think of this the same way I think of the offline till: the problem is not a missing feature, it is something the shop lives with every day. If the software ignores it, people fall back to a notebook and a calculator, and then the software is decoration.

I would rather build the awkward part properly once and let everything else, the till, the reports and the website, lean on it.

Work with me →