⚡ Algorithm Visualizations

Interactive demonstrations of AbyssBook's core algorithms

🎯 Order Matching Algorithm O(log n)

Algorithm Complexity:
  • Time Complexity: O(log n) for order insertion using skip list
  • Space Complexity: O(n) for order storage
  • Matching Complexity: O(k) where k is number of matched orders
Step 1: Initialize

📈 Buy Orders (Bids)

📉 Sell Orders (Asks)

🚀 SIMD Vectorized Operations O(n/8)

SIMD Optimization:
  • Vector Width: 8 elements (256-bit AVX2)
  • Throughput: 8x parallel operations per instruction
  • Memory Bandwidth: Optimized for cache line alignment
Step 1: Load Vectors

Price Vector

Amount Vector

⊕ VECTORIZED COMPARISON ⊕

Match Results

🏗️ Sharded Orderbook Architecture O(n/s)

Sharding Benefits:
  • Parallel Processing: s concurrent shards reduce contention
  • Cache Locality: Price-based partitioning improves cache hits
  • Scalability: Linear performance scaling with shard count
Step 1: Hash Price

Price Range Sharding

Shard 0
$9000-9250
0 orders
Shard 1
$9250-9500
0 orders
Shard 2
$9500-9750
0 orders
Shard 3
$9750-10000
0 orders

📊 TWAP Order Execution O(t)

TWAP Algorithm:
  • Time Complexity: O(t) where t is number of time intervals
  • Volume Distribution: Equal slices across time periods
  • Market Impact: Minimized through time-weighted execution
Interval 1/10

📋 TWAP Parameters

Total Amount: 10,000
Duration: 60 seconds
Intervals: 10
Per Interval: 1,000

📈 Execution Progress

Executed: 0 / 10,000
Average Price: $0.00