Pearn

How it works

The life of a market, from creation to the last claim.

Actors

ActorDoes
CreatorAnyone. Picks the question, the close time and a resolver
BettorBets stNEAR on YES or NO, claims principal plus winnings
SponsorAdds stNEAR to a market's pot. Gets it back only if nobody bets
ResolverSet per market, ideally a DAO. Reports the outcome after close
GuardianCan only turn an outcome into Invalid, and only during the 24 h challenge window
KeeperAnyone. Calls oracle.sync(); ours runs every 12 h

Lifecycle

Create

createMarket(question, closeTime, resolver). The close is at least an hour away; the question is at most 280 bytes.

Bet

bet(id, side, amount) takes stNEAR. Your principal is fixed in NEAR at the current rate, and your weight is principal × seconds until close. Bets need an oracle reading younger than 2 days.

Resolve

After close, once the oracle has synced again, the resolver calls resolve(id, Yes | No | Invalid). That fixes the settlement rate and the pot. If nobody resolves within 7 days, anyone can call voidExpired(id).

Challenge window

For 24 h the guardian may call overrideInvalid(id). It changes who shares the pot, never its size.

Claim

claim(id) pays your principal back in stNEAR at the settlement rate, plus your share of the pot. See payouts.

Why time weight

Without it, a whale could bet on the obvious side just before close and take the yield that early bettors produced. With weight = principal × time left, a late bet earns almost nothing.

On this page