Architecture

Auctions

The auction service runs independent loops for JIT and AOT markets. Each loop is deterministic, replayable, and exposes the exact rules we use to select winners.

JIT Loop

  1. Collect sealed bids for 2 seconds.
  2. Validate priority fee ≥ minBid (currentPriorityFee * 1.05).
  3. Sort by amount; highest bid wins first-price allocation.
  4. Emit reservation receipt + unlock lane for MEV shield.

AOT Loop

  1. Initialize slot auctions 35–120 slots ahead.
  2. Accept incremental bids until closing time.
  3. Anti-sniping: if bid < 30s before close, extend close by 30s.
  4. Clearing price becomes the winning bid; we emit a reservation + schedule.

API Surface

auction.ts
import { useAuctionStore } from '@/stores/auctionStore'

const { createJITAuction, submitJITBid } = useAuctionStore.getState()

const auction = createJITAuction(minBid)
submitJITBid(auction.auctionId, {
  bidId: crypto.randomUUID(),
  amount: 0.006,
  priorityFee: 0.0045,
  account: walletAddress,
  timestamp: Date.now(),
})