One realm, every rule
67 is one Gno package, gno.land/r/nym-sixseven067/markets. It holds each market's collateral, the published quotes, every position and the payouts. The app only reads it and asks Adena to sign calls to it.
Administrator g13wgyakt05a202ekc09vk8mgdg9g4gdp6upxuna
Units
All amounts are whole ugnot: one GNOT is 1,000,000 ugnot. A share is 1,000,000 micro-shares, and a winning micro-share pays 1 ugnot, so a winning share pays exactly 1 GNOT.
Prices are parts per million of that payout. A Yes price of 420000 means 0.42 GNOT per share; the No price is always the rest, 580000.
What each call does
Each function checks its own conditions and stops the whole transaction when one fails. The refusals are its exact messages.
CreateMarket
Administrator. Lists a market and freezes every field used to match the external result: the question, the rules and their hash, the Polymarket condition, both outcome tokens, the closing time and the oracle. There is no function that edits any of them afterwards.
CreateMarket(cur, id, question, rules, conditionID, yesTokenID, noTokenID string, closesAt, yesPricePpm int64, oracle address)
Refuses with administrator only, market already exists, closing time must be in the future, invalid fixed price.
Fund
Anyone. Adds reserve collateral to one market. The money belongs to that market only and nothing withdraws it, not even the administrator.
Fund(cur, id string)
Refuses with market funding closed.
SetQuote
Administrator. Publishes a new fixed Yes price while trading is open and adds it to the quote history. The expected version stops an operator from overwriting a quote they have not seen.
SetQuote(cur, id string, yesPricePpm, expectedVersion int64)
Refuses with trading closed, quote version changed, quote unchanged.
Buy
Any account. Buys Yes or No shares at the price the buyer reviewed. The payment must be the exact cost, and the market's collateral must cover the larger side if it wins.
Buy(cur, id, outcome string, microShares, expectedPricePpm int64)
Refuses with trading closed, price does not match review, send the exact quoted ugnot amount, insufficient market collateral.
FinalizeByOracle
The market's oracle. Records the final outcome once, with a hash of the evidence. The call must repeat the market's whole source binding, so a result for another question cannot land here. Trading stops in the same transaction.
FinalizeByOracle(cur, id, conditionID, rulesHash, yesTokenID, noTokenID, winner, evidenceHash string)
Refuses with oracle only, outcome already final, source binding mismatch.
Claim
A position holder. Pays the caller's winning shares, 1 GNOT each, from that market's collateral. A losing position closes with zero; a second claim is refused.
Claim(cur, id string) int64
Refuses with outcome is not final, no position, position already claimed.
ProposeAdministrator
Administrator. Starts a two-step handover. Nothing changes until the proposed address accepts from its own account, so a mistyped address cannot take over. Markets keep the oracle they were created with.
ProposeAdministrator(cur, next address)
Refuses with administrator only, invalid administrator.
AcceptAdministrator
The proposed address. Completes the handover.
AcceptAdministrator(cur)
Refuses with pending administrator only.
Read without signing
MarketsJSON()MarketJSON(id)PositionsJSON(owner)QuoteHistory(id)Quote(id, outcome, microShares)Render(path)
Events for indexers: MarketCreated, QuoteUpdated, Funded, Bought, Finalized, Claimed, AdministratorProposed, AdministratorAccepted.
What it cannot do
- Edit a question, its rules, its source or its oracle
- Withdraw collateral, for anyone
- Sell or cancel a position
- Learn a result by itself: only the pinned oracle can finalize