sheardocs

Protocol

Running the steps

Every step that moves a round along can be sent by any wallet. Shear runs a keeper that sends them on time, and the app offers the ones that need no oracle data.

StepWhen it can runNeeds
start_roundA session is open and the next expiry is 1–8 days awayA fresh verified Pyth update; rent for the round’s accounts
finalize_auctionAfter the auction’s five minutesNothing
observe_expiryWithin one hour after expiryThe verified Pyth update for close − 1
challenge_expiryWithin 15 minutes of the markA conflicting verified update
settle_round15 minutes after the mark, or at once if no calls soldNothing
timeout_settleSeven days after expiry, if Active or DisputedNothing
process_ticketAfter settlement, once per ticketNothing
close_roundAfter every ticket is processedNothing

In the app#

When a step that needs no oracle data is due, the round band in the app shows a button for it: finalize the auction, settle a round with no calls sold, process a waiting ticket, close the round. Sending one costs a transaction fee and changes nothing about who gets paid.

Shear’s keeper#

The keeper reads finalized chain state and the maintained calendar. It starts each round in the first eligible session, finalizes the auction when it ends, requests Pyth’s update for the exact close second and posts it fully verified, settles after the dispute window, processes every ticket, and closes the round. If a conflicting mark appears during the dispute window, it submits challenge_expiry. It can’t replace a mark or choose a price.

Every keeper action is journaled before it is sent, so a restart resends the same signed transaction rather than doing a step twice.

Costs#

Whoever sends a step pays its transaction fee. start_round also pays rent for the round account, its three TSLAx accounts, its USDC escrow and its call mint. Instructions reserve 400,000 compute units.