Primary finding
Monetary amounts stored as JSON floats risk precision/rounding errors
- memory/goals.json:11
- memory/goals.json:33-34
Token and financial quantities frequently require exact decimal math. Storing them as JSON numbers (binary floats in many runtimes) can introduce rounding error (e.g., 9.28 is not exactly representable), which may cause off-by-small-epsilon comparisons for threshold checks or miscomputed aggregates.
Recommendation
Represent token amounts as strings (e.g., "9.28") parsed with a decimal library, or as integers in smallest units with an explicit decimals field (e.g., 9280000000000000000 with decimals=18). Enforce this via a JSON schema and validation in the consumer.