All posts
ENGINEERING

Why Stratum uses Bitfinex ledger data

ST
Stratum Engineering
·May 12, 2026·8 min read

When you ask a lending bot how much you earned last month, the report should be easy to reconcile against Bitfinex's own funding data. That starts with ledger events, not headline APR.

A simple balance snapshot can be useful, but it is not enough for audit-friendly reporting. Deposits, transfers, fees, interest credits, currency conversion timing, and reversals all affect what a lender sees over time.

For that reason, Stratum treats Bitfinex ledger events as the reporting source. Each credit or fee can be stored with the original payload and traced back later when you export, review, or reconcile.

"The useful promise is not magic precision. It is traceability: every report line should point back to exchange data."

The ledger-based approach

Stratum syncs Bitfinex funding ledger data, dedupes by event identity, and keeps the raw exchange payload where practical. That gives reports a stable trail back to what Bitfinex returned at the time.

typescript · ledger-replay.ts
const events = await bitfinex.ledger.list({
  category: 'funding-credit',
  start: lastSyncCursor,
});

for (const e of events) {
  await db.ledger.upsert({
    id: e.id,                          // dedupe key
    timestamp: e.mts,                  // ms since epoch
    currency: e.currency,
    amount: e.amount,                  // signed, native units
    usdAt: await fxAt(e.currency, e.mts),
    raw: e,                            // archive original
  });
}

That last field — raw — is the key. Keeping the original payload makes reports easier to debug and explain later.

What this gets you

Questions or feedback on this post? Join the community waitlist and we'll open discussion when it launches.