← Back to JournalTechnical

Deep Dive: Runner Protocol Architecture

Runner Engineering·January 15, 2024·12 min read

Building a continuous clearing auction protocol on Solana requires careful consideration of the network's unique characteristics. This post explores the architectural decisions that make Runner fast, secure, and MEV-resistant.

At the core of Runner is the Auction Program, a native Solana program written in Rust using the Anchor framework. The program manages the entire lifecycle of an auction: initialization, bidding, settlement, and claims.

Each auction creates a set of Program Derived Addresses (PDAs) that store the auction state, bid commitments, and settlement data. This design ensures that all auction data is fully on-chain and verifiable.

The bidding phase records bids directly on-chain. Bidders commit capital to the auction, and the smart contract records their bid amount and price. The key insight is that we don't need to hide bid amounts—the uniform clearing price mechanism means everyone pays the same price, so knowing others' bids provides no strategic advantage.

Settlement is triggered permissionlessly after the auction end time. The settlement function iterates through all bids, calculates the clearing price using our on-chain algorithm, and updates the auction state with final allocations and refund amounts.

Claims are processed in a single transaction per user, distributing both tokens and USDC refunds atomically. This minimizes transaction costs and ensures users receive their complete allocation in one operation.

Share

Related Articles