Skip to content

Payark-Inc/arts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PayArk ARTS: Amortized Real-Time Settlement

A high-performance interbank clearing protocol for sovereign payment systems.

What is ARTS?

ARTS (Amortized Real-Time Settlement) is a three-layer clearing protocol that:

  1. Layer 1 - Aggregation: Aggregates citizen transactions into net interbank obligations
  2. Layer 2 - Netting: Applies multilateral net-position settlement to minimize transfers
  3. Layer 3 - RTGS: Emits a minimal settlement vector (≤N-1 transfers for N banks)

Architecture

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   Parser    │────▶│ Aggregator  │────▶│  BankGraph  │
│ (64B wire)  │     │ (20×20 mat)│     │ (multilateral)│
└─────────────┘     └─────────────┘     └─────────────┘
                                                │
                   ┌─────────────┐              │
                   │     WAL     │◀─────────────┘
                   │(checkpoint) │
                   └─────────────┘
                          │
                   ┌─────────────┐
                   │ Settlement  │
                   │ (BLAKE3)    │
                   └─────────────┘

Key Results

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)

Quick Start

# Build and run
cargo build --release
cargo run --release

# Run benchmarks
cargo bench

# Run with specific netting mode
cargo run -- --netting-mode multilateral

Features

  • 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

Project Structure

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

License

MIT

About

Amortized Real-Time Settlement

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages