ShelvesNI BIASHARA

How AI Money — Africa FX is built

Ni Biashara Shelves sells two different FX numbers. They are not interchangeable, and neither one is a rate we observed at a central-bank window.

Official reference rate

Official reference rate via Frankfurter (frankfurter.dev). Frankfurter blends reference rates published by multiple central banks. This number is that blend, not a single central-bank fixing and not an ECB rate unless a provider row says so.

Source: Frankfurter (frankfurter.dev). The response field as_of is the date Frankfurter published for that quote. fetched_at is when this Worker read it. providers lists the publisher rows Frankfurter returned, with a name where we know the code (CBK, CBN, CBG, SARB, ECB). A provider row is an input to the blend. It is not the rate field.

Freshness: rates refresh hourly. If Frankfurter fails, leaves a currency out, or its as_of for a currency is more than 4 days old, we try a backup feed for that currency: Exchange API (fawazahmed0, CC0), which is public domain (CC0). A rate from the backup says so in source, source_name and label. We do not use a backup rate that is dated later than tomorrow (UTC) or is more than 10% away from the last good copy we hold for that currency. If we hold no last good rate for that currency, the backup rate is used and marked stale. If neither feed gives a usable rate we serve the last good copy and say so: stale is true and age_seconds gives the time since fetched_at. A rate whose as_of is more than 4 days old is also marked stale, whichever feed it came from. Once the freshest copy is older than 3 hours, direct x402 FX calls (/api/fx, /api/parallel, /shelf) and checkout refuse with HTTP 503 rates_stale before payment. Other paid channels do not have this check yet.

Pairs: USD-KES, USD-NGN, USD-GHS, USD-TZS, USD-UGX, USD-ZAR, USD-EGP, USD-RWF.

Shelf price: $0.01 for one pair, $0.02 for all eight. The legacy routes /api/fx/:pair and /api/fx charge those same amounts.

Street (parallel) rate

The street rate is the median VWAP of Bybit's public USDT/fiat P2P order book, walked for $1,000 across at least 3 advertisers on each side, then divided by a USDT/USD spot basis (Coinbase, otherwise Kraken, otherwise assumed 1). OKX's book is fetched and archived and does not set the published rate. This is not a central-bank rate, not a bureau de change quote, and not a rate board such as abokiFX.

Source name on the response: Bybit P2P. Venue: https://www.bybit.com/en/p2p. The official number sitting next to it is the Frankfurter blend above (official_source).

Pairs: USD-NGN, USD-GHS only. KES: no material parallel market; the shilling floats and the official rate is the market rate EGP: the pound was unified in 2024; the residual premium is below the P2P rail's own cost UGX: no material parallel market; official rate is the market rate TZS: no material parallel market; official rate is the market rate ZAR: no exchange controls of this kind; any premium observed is P2P rail cost, not a street rate RWF: no material parallel market; official rate is the market rate

Shelf price: $0.05 on GET /shelf/fx-parallel. The older route GET /api/parallel/:pair serves the same data at the same price.

History shelves replay our own hourly archive of that Bybit-derived quote. captured_at is when the book was read. A missed hour is missing; we do not fill it in.

What a free preview is

/fx/sample returns a real Frankfurter quote for the official shelves. Street-rate, history and daily-brief previews are marked illustrative: true and are not today's book. Paying the shelf is how you get the live street number.