PERCOLATOR

Percolator Logo
Sharded Perpetual Exchange Protocol
Capital Efficiency Through Cross-Slab Portfolio Margin
CA: 77mP6LDQSbYzy7APZ52zftZoeBf8NfYALxWqjQMMpump
54
Unit Tests Passing
Capital Efficiency
~4KB
Slab State (v0)
2
On-Chain Programs

THE KILLER PROOF

$0
margin required for zero net exposure
Instead of $10,000 on traditional exchanges!

Overview

Percolator is a sharded perpetual exchange protocol for Solana that achieves infinite capital efficiency through cross-slab portfolio margin. Users can execute offsetting positions across multiple markets with zero margin requirement when net exposure is zero.

v0 Architecture

Router Program
Global Coordinator
Portfolio Margin
Slab A
BTC-PERP
$50,000
Slab B
BTC-PERP
$50,010
Slab C
ETH-PERP
$3,000

The Proof: Capital Efficiency

❌ Traditional Exchange
Long 1 BTC @ $50,000
Margin: $5,000
Short 1 BTC @ $50,010
Margin: $5,000
Total Capital Required: $10,000
Profit: $10
ROI: 0.1%
✓ Percolator
Long 1 BTC Slab A @ $50,000
Short 1 BTC Slab B @ $50,010
Net Exposure: 0 BTC
Total Capital Required: $0
Profit: $10
ROI: ∞
Capital Efficiency Savings: $10,000 (100%)

Architecture

1. Router Program

Program ID: RoutR1VdCpHqj89WEMJhb6TkGT9cPfr1rVjhM3e2YQr

The global coordinator managing collateral, portfolio margin, and cross-slab routing.

State Structures:

2. Slab Program

Program ID: SLabZ6PsDLh2X6HzEoqxFDMqCVcJXDKCNEYuPzUvGPk

LP-run perp engines with ~4KB state in v0 (10MB budget for v1).

struct SlabState { header: SlabHeader, // 256 bytes - metadata + seqno quote_cache: QuoteCache, // 256 bytes - best 4 bid/ask levels book: BookArea, // 3KB - price-time order queues }

3. v0 Instructions

Key Features

Sharded Architecture
Multiple independent "slabs" run by LPs, coordinated by the Router. Unlimited scalability.
💰
Portfolio Margin
Margin calculated on net exposure across all slabs, not per-market. Capital efficient.
🔒
Atomic Execution
Order splits and commits across multiple slabs in a single transaction.
🛡️
Security by Design
Slabs cannot access Router vaults directly. Complete isolation between markets.
📊
Proven Concept
54 unit tests passing, covering all critical scenarios including capital efficiency proof.
🚀
v0 Simplified
Streamlined architecture (~1000 LOC) that proves the core thesis.

Project Status

Completed

🚧 In Progress

📋 Next Steps

  1. Compile with cargo build-sbf
  2. Deploy to local validator
  3. Complete end-to-end tests
  4. Client SDK (TypeScript/Rust)
  5. Web trading interface
  6. Security audits

Test Coverage

$ cargo test running 54 tests percolator-common (27 tests) ✓ VWAP calculations ✓ PnL calculations ✓ Funding payments ✓ Tick/lot alignment ✓ Margin calculations percolator-router (7 tests) ✓ Vault operations ✓ Portfolio tracking ✓ Margin aggregation ✓ Exposure tracking percolator-slab (20 tests) ✓ Pool allocation ✓ Header validation ✓ Reserve operations ✓ Size constraint (≤10 MB) test result: ok. 54 passed; 0 failed; 0 ignored

v0 Critical Tests

Technology Stack

Code Reduction

~5,000 LOC
Complex Initial Design
~1,000 LOC
v0 Simplified
80% reduction while proving the core concept!

Why Percolator?

  1. Maximum Capital Efficiency: Enable arbitrage and hedging strategies with near-zero margin
  2. Scalability: Sharded architecture allows unlimited slab additions
  3. Security: Complete isolation between slabs, no cross-contamination risk
  4. Flexibility: Each LP can innovate on their slab independently
  5. Performance: Fast atomic execution on Solana

📚 Documentation & Getting Started

Quick Start

1. Clone the repository:
git clone https://github.com/TheMasterPump/Percolatorv0.git

2. Build the project:
cargo build --release

3. Run the tests:
cargo test

4. Run the demo:
demo.bat (Windows) or ./demo.sh (Mac/Linux)

Program IDs

Router Program:
RoutR1VdCpHqj89WEMJhb6TkGT9cPfr1rVjhM3e2YQr
Slab Program:
SLabZ6PsDLh2X6HzEoqxFDMqCVcJXDKCNEYuPzUvGPk

Key Features

Resources & Files

Development Roadmap

✅ Step 1 - v0 (Current)

  • Core router and slab programs
  • Portfolio margin calculation
  • 54 unit tests passing
  • Documentation and demo

🔄 Step 2 - Testnet

  • Deploy to Solana devnet
  • Community testing
  • UI development
  • Security audit preparation

⏳ Step 3 - Mainnet

  • Professional security audits
  • Mainnet deployment
  • LP onboarding
  • Public launch