A high-performance interbank clearing protocol for sovereign payment systems.
ARTS (Amortized Real-Time Settlement) is a three-layer clearing protocol that:
- Layer 1 - Aggregation: Aggregates citizen transactions into net interbank obligations
- Layer 2 - Netting: Applies multilateral net-position settlement to minimize transfers
- Layer 3 - RTGS: Emits a minimal settlement vector (≤N-1 transfers for N banks)
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Parser │────▶│ Aggregator │────▶│ BankGraph │
│ (64B wire) │ │ (20×20 mat)│ │ (multilateral)│
└─────────────┘ └─────────────┘ └─────────────┘
│
┌─────────────┐ │
│ WAL │◀─────────────┘
│(checkpoint) │
└─────────────┘
│
┌─────────────┐
│ Settlement │
│ (BLAKE3) │
└─────────────┘
| Metric | Value |
|---|---|
| Transaction Reduction | 1,000,000 → 19 (99.998%) |
| Value Efficiency | 33% (2× bilateral) |
| Throughput | 7M packets/second |
| Latency | 7µs netting, 13.5ms p50 |
| LP Verified Optimal | Yes (4,547 graphs) |
# Build and run
cargo build --release
cargo run --release
# Run benchmarks
cargo bench
# Run with specific netting mode
cargo run -- --netting-mode multilateral- Zero-copy wire protocol (64-byte fixed-width packets)
- Multilateral greedy netting with LP optimality verification
- BLAKE3 settlement hashing
- Write-ahead log for crash recovery
- TCP backpressure handling
src/
├── protocol.rs # Wire format, parse_fast
├── aggregator.rs # Citizen → interbank aggregation
├── graph.rs # BankGraph with netting algorithms
├── settlement.rs # BLAKE3 Merkle hashing
├── wal.rs # Write-ahead log
├── tcp.rs # TCP mediator with backpressure
├── executor.rs # Epoch processing
└── main.rs # CLI entry point
benches/
└── bench_core.rs # Criterion benchmarks
MIT