Engineering

Money is not a float

28 May 2026 · 1 min read · Dayonik

How we keep currency precise and trades atomic under concurrency, and why that correctness is the floor an AI investing platform has to stand on.

Store money as a floating-point number and rounding errors creep in one cent at a time. On a platform that computes trades and realised gains, that is not acceptable. So money in Dayonik is rounded to currency precision at every boundary, and the arithmetic never trusts a float to represent a balance.

Atomic trades under load

Two trades against one book at the same moment must not lose an update. Dayonik uses compare-and-set concurrency, so a conflicting write becomes a retryable error rather than a silent overwrite. The book stays consistent even when the platform is busy.

None of this is glamorous. It is the floor everything else stands on. Grounded advice is worthless if the numbers underneath it drift, so we spent the effort to make sure they do not.

Put grounded advice on your own book.