Docs/Examples/Sponsor Auction

SponsorAuction (Rolling Auction)

A perpetual ascending-bid auction with autonomous close — no VRF required.


Overview

SponsorAuction is the proof that AutoLoop's value extends beyond VRF. It's a perpetual ascending-bid auction for a single sponsorship slot, where auctions run back-to-back on a fixed schedule with no randomness involved.

PropertyValue
Base contractAutoLoopCompatible (no VRF)
VRF usageNone
Gas per tick~47k (no bids) to ~116k (with winner)
Sourceautoloop/src/games/SponsorAuction.sol
Tests37 passing (unit + fuzz)

Why AutoLoop Is Structurally Required

Timing-as-attack-surface: the auction close is a discrete event with strictly conflicting incentives. The current high bidder wants immediate close; prospective counter-bidders want extension; the slot receiver wants close at peak bid. No player-controlled trigger is fair — a neutral block-cadence scheduler is the only way to guarantee the close happens at the same moment for everyone.

This is the cleanest "no randomness but still needs autoloop" demo in the stack.

Game Mechanics

  • Auction cycle: each auction runs for auctionDuration seconds. Bids must exceed the current highest by minIncrementBps basis points.
  • Settlement: when progressLoop fires after the auction expires, the winner pays, the slot is awarded for sponsorshipPeriod seconds, and a new auction opens immediately.
  • Refunds: outbid bidders receive automatic pull-payment refunds. The slot receiver also claims via pull-payment.
  • No bids: if nobody bids, the slot goes empty and a new auction starts.

Revenue Model

  • 5% rake on every winning bid (to protocol)
  • AutoLoop gas fees on each close tick

Deploy

forge create src/games/SponsorAuction.sol:SponsorAuction \
  --constructor-args 120 3600 1000000000000000 500 500 0xYOUR_SLOT_RECEIVER \
  --rpc-url $RPC_URL --private-key $PRIVATE_KEY --broadcast

Args: auctionDuration, sponsorshipPeriod, minBid, minIncrementBps, protocolRakeBps, slotReceiver.

Dashboard

Play SponsorAuction on the AutoLoop Dashboard.