Bridge Web2 & Web3 Ledgers

A reconciliation lab for hybrid finance. Synchronize your internal AlloyDB ledgers with on-chain state, handling exceptions and settlement windows with precision.

Off-chain + devnet
Ledgers
Pub/Sub + webhooks
Eventing
Policy-gated releases
Controls
Dual Ledger Architecture
  • Maintain an authoritative off-chain ledger in AlloyDB
  • Mirror state to on-chain devnets with double-entry integrity
  • Abstract wallet complexity for automated signing
Automated Reconciliation
  • Compare on-chain and off-chain states in real-time
  • Detect and flag mismatches (amount, currency, timing)
  • Route exceptions to human analysts or retry queues
Event-Driven Analytics
  • Stream ledger deltas and exceptions via Webhooks
  • Analyze reconciliation coverage with BigQuery
  • Visualize settlement health on Looker dashboards
Reconciliation Logic
// reconciliation/diff.ts
import { emitWebhook } from '@/lib/webhooks';

export async function emitDiff(diff) {
  // If no mismatches, we are clean
  if (!diff.mismatches.length) return { status: 'clean' };

  // Broadcast exceptions for downstream handling
  await Promise.all(
    diff.mismatches.map((mismatch) =>
      emitWebhook('ledger.diff', {
        id: mismatch.id,
        offChain: mismatch.offChain,
        onChain: mismatch.onChain,
        severity: calculateSeverity(mismatch)
      })
    )
  );

  return { status: 'exceptions_emitted', count: diff.mismatches.length };
}
Settlement Scheduler
// reconciliation/window-sim.ts
export function scheduleWindow(now, cadenceMinutes = 30) {
  // Calculate next settlement window based on bank cut-off times
  const current = new Date(now);
  const next = new Date(current.getTime() + cadenceMinutes * 60 * 1000);
  
  return { 
    current: current.toISOString(), 
    next: next.toISOString(),
    type: 'standard_settlement'
  };
}

Ready to reconcile?

Connect your reconciliation worker to Pub/Sub. Mirror balances to your devnet, and let the system automatically catch and route any discrepancies.