Skip to main content
Skip to content
Agentic Finance

Make a Test Ledger From a Real Schema Without Copying Customer Records

A source-mapped Luno-inspired test ledger with 30 invented entries, six rejected defects and a free reproducible Python fixture pack.

A transparent schema guides a small press producing geometric synthetic ledger tiles.
Reading options: audio, text size & sections

What matters: A useful test ledger can borrow the structure of a real API without borrowing anyone’s transactions. DN built 30 entirely invented entries from a small, explicitly defined subset of Luno’s published transaction types. The supplied local validator accepts that dataset, accepts deliberately shared transaction references and rejects six damaged variants.

Evidence date: Source reviewed and local checks executed on 1 December 2026. The underlying source is pinned to Luno Go SDK commit 4835377329dca593353f442cfaa091512551728d. This is a DN fixture and validator, not a test of Luno’s live API, a full API-response emulator or a certification that a customer dataset is anonymous.

Start from the contract, not a customer export

Imagine a developer adding an account-statement import to a finance agent. They need a reviewer to reproduce a parsing defect. Copying a customer export into the issue would bring balances, identifiers and commercial context into a place designed for code review. Randomly renaming the customer would not make the remaining transaction history invented.

The alternative is to identify the smallest field relationships required to expose the defect, then author records that exercise them. For example, a duplicate detector needs account identity and statement position. A balance check needs a starting balance, signed movements and resulting balances. A useful fixture preserves those relationships while making its origin unmistakable.

The public Luno SDK provides a concrete starting point. Its Transaction structure names account, currency, balance, available balance, their deltas, reference, row index and timestamp fields. The reference documentation explains that several statement entries can relate to one transaction. That detail changes what a correct duplicate check should accept.

The original fixture contract

DN’s format wraps an array of entries with a synthetic-data label, source pointer and opening balances. This wrapper is our own design. Its account IDs deliberately begin with SYNTH-; the package is not intended to be submitted to a provider. We omit fields unnecessary for these exercises and reject unexpected keys under this version of the teaching contract.

Source structure and DN’s explicit fixture choices
Field or relationshipSource anchorDN fixture rule
Account and currencyLuno Transaction fieldsThree invented accounts: ZAR, XBT and ETH; currency stays fixed within each account.
Statement rowListTransactions sourceRows 1–10 in each account; account plus row index is the fixture identity.
Balance and balance deltaTransaction decimal fieldsPrior balance plus signed delta equals resulting balance.
Available amount and its deltaSeparate Transaction fieldsChecked independently; available can differ from balance.
Transaction referenceSource allows multiple entries per referenceWithdrawal and fee intentionally share a reference.
TimestampTransaction comment specifies Unix millisecondsInteger milliseconds; invented one-minute spacing is a DN choice.
Decimal representationPinned Decimal JSON serializerPlain decimal strings; no floating-point conversion or exponential notation in this contract.

The ListTransactions source describes sequential account rows. The Decimal serializer emits JSON strings. DN’s validator is deliberately stricter than the upstream decoder: rejecting a numeric JSON amount is a rule of this fixture, not a claim that the SDK rejects every unquoted number.

One ledger that can be checked by hand

The ZAR example opens with 1,000 invented units. The ten balance changes are +100, −20, −1, 0, +25, −7.5, 0, −0.5, +2 and −3. They sum to +95, leaving 1,095. This is statement arithmetic, not trading profit: the entries have invented meanings and include transfers and fees.

Rows two and three model a withdrawal and its fee. They have different statement positions but the same reference. A deduplicator using only reference would silently discard one legitimate fixture entry. A deduplicator using account plus row can distinguish them while detecting a repeated statement entry.

Selected entries from the invented ZAR account
RowBalance deltaBalanceAvailableMeaning in this fixture
OpeningNot applicable1,0001,000Declared initial state
1+1001,1001,100Invented incoming transfer
2−201,0801,080Invented withdrawal; shared reference
3−11,0791,079Separate fee; same reference as row 2
401,0791,069Invented availability hold of 10
701,096.51,096.5Invented release of that hold
10−31,0951,095Final state

The XBT and ETH accounts use the same deliberately small pattern with different decimal scales. Their final balances are 0.010095 XBT and 1.095 ETH. Those units remain separate. Adding them to ZAR would require a valuation method and price observations that this package neither needs nor supplies.

The hold and release entries are DN teaching cases for independent available-balance arithmetic. They are not observations of a particular provider event sequence. That distinction travels inside the fixture so the JSON cannot reasonably be mistaken for an extracted customer statement.

Six defects the local checks actually reject

After generating the valid dataset, the exercise makes six independent copies and damages each one in a specified way. The original stays unchanged. Every negative case records its expected error, observed errors and mutated input, allowing a reader to inspect the condition that was tested.

Executed negative variants
MutationExpected rejectionWhy it matters
Append a repeated account-row entryDuplicate account-row identityA repeated statement row must not become a new movement.
Change a resulting balanceBalance equation mismatchA well-formed decimal can still contradict the history.
Change currency inside one accountCurrency changedA unit change cannot be treated as a numeric adjustment.
Use numeric JSON instead of a decimal stringDecimal-string contract violationSerialization must match the deliberately chosen contract.
Remove the required reference fieldField-set mismatchA missing field must not be silently invented.
Use boolean true as a row indexInteger-type rejectionIn Python, booleans can pass careless integer checks.

The positive cases are equally important. The two entries sharing a transaction reference remain valid. The temporary difference between balance and available balance remains valid. An overly restrictive validator could reject both, producing an apparently strict tool that misrepresents the structure it is supposed to understand.

The completed check is bounded: 30 valid entries across three accounts, six deliberate invalid variants rejected, and three independently stated final balances matched. These are local results from DN’s own code. They do not establish completeness against every legal provider response, recovery after a restart or correctness of a production import.

Download, run and adapt the fixture

Download the synthetic ledger pack. It includes ledger.json, the invalid variants, source mapping, verification output, an integrity manifest and ledger_fixture.py. You can also inspect the valid JSON directly. The script uses Python’s standard library only and makes no network requests.

python ledger_fixture.py --verify ledger.json
python ledger_fixture.py --write regenerated

The first command checks the supplied ledger under the DN contract. The second deterministically generates the example and runs the included positive and negative exercises. The package records the runtime used for DN’s execution; the stated Python compatibility is an instruction for reproduction, not a claim of testing on every supported interpreter.

Before adapting it, write the defect you need to reproduce. Preserve only the structural conditions that make that defect visible. Add an intentional failing case and an independently understandable expected result. If a field is omitted, say whether it is outside the local contract or prohibited. If a schema version changes, issue a new fixture version instead of silently broadening the old one.

For the shared-reference case, the smallest demonstration is two different account rows carrying one reference. For a decimal defect, use a value that makes rounding or formatting matter. For an available-balance defect, retain separate deltas. These choices make a review conversation concrete without needing a customer example.

What this method does and does not protect

This package was authored from public structure and invented values. It has no customer-data input path. That is a statement about how this artifact was built, not a guarantee about any file a reader later creates. A dataset produced by copying and altering private records would have a different provenance and would need a different review.

A synthetic label also does not make inaccurate semantics useful. If the real integration accepts optional fields, pending entries or a different ordering convention, the local fixture must state how those cases are represented. This version covers a small posted-statement-style subset. It does not model pending-entry lifecycle, API authentication, paging while records change or a complete accounting system.

Keep artifact integrity separate from provenance. The supplied digests help detect changes relative to the saved manifest. They do not authenticate the person who supplied a replacement manifest or establish that a hypothetical event occurred in the real world.

Related DN work and next step

The five-file research handover shows how a calculation and its evidence can travel together. The ledger restart replay audit addresses checkpoint and duplicate-application behavior. This article adds the earlier data-construction task: a reusable, source-mapped synthetic input with both acceptable and unacceptable cases.

Use the free pack to write one defect-specific fixture before asking someone to reproduce an import problem. For a larger evidence design, the DN Research Desk offers optional scoped paid research. The fixture and method remain freely available.

Frequently asked questions

Were any customer records anonymized to make this ledger?

No. The entries were invented from the published field structure and explicitly authored arithmetic.

Is this a valid complete Luno API response?

No. It is a DN wrapper and deliberately limited field contract inspired by pinned SDK source. The synthetic account identifiers are not provider account IDs.

Why are repeated references accepted?

The source explains that separate statement entries can belong to the same transaction. The fixture’s uniqueness boundary is account plus row index.

Did DN run the upstream SDK?

No. DN inspected pinned source and executed its own standard-library generator and validator. No Luno account or trading API was called.

Editorial disclosure: All transaction values and account identities in the pack are synthetic. No provider paid for inclusion, and the source links are not referral links. Source-backed corrections: press@decentralised.news.

Get the most talked about stories directly in your inbox

Join the Decentralised News briefing for independent crypto, DeFi and AI analysis. No spam, unsubscribe anytime.