Skip to content Search Apps Documentation Source Content File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

Community realm. Read the code first. Community realm, deployed by its author. Read the code before you interact or send coins.

v2 state

Back to all declarations

MarketJSON

func(id string) string

MarketJSON returns one market with its quote history.

Open
OID
0fbca8…5c03:3
MarketJSON details

Inspect func

MarketsJSON

func() string

MarketsJSON returns every market in creation order as one JSON array.

Open
OID
0fbca8…5c03:5
MarketsJSON details

Inspect func

PositionJSON

func(id string, owner .uverse.address) string

PositionJSON returns one open position; an empty one if the owner holds nothing there or has claimed.

Open
OID
0fbca8…5c03:6
PositionJSON details

Inspect func

PositionsJSON

func(owner .uverse.address) string

PositionsJSON returns the owner's open positions in market creation order. Claimed positions are gone; their record is in the Claimed events.

Open
OID
0fbca8…5c03:7
PositionsJSON details

Inspect func

RealmJSON

func() string

RealmJSON returns the roles, settings, limits and totals.

Open
OID
0fbca8…5c03:8
RealmJSON details

Inspect func

historyJSON

func(points []v2.QuotePoint) string
Open
OID
0fbca8…5c03:9
historyJSON details

Inspect func

jsonString

func(value string) string
Open
OID
0fbca8…5c03:10
jsonString details

Inspect func

scale

int64

Value

1000000

maxInt64

int64

Value

9223372036854775807

MaxFeePpm

int64

Value

70000

MinPricePpm

int64

Value

30000

MaxPricePpm

int64

Value

970000

DisputeWindow

int64

Value

86400

AbandonAfter

int64

Value

5184000

minQuoteTTL

int64

Value

300

maxQuoteTTL

int64

Value

604800

maxMinSpread

int64

Value

100000

maxHistory

untyped bigint

Value

(96 <untyped> bigint)

StateOpen

untyped string

Market states. A market moves between open and paused, from either to proposed, and from proposed to final. A cancelled proposal returns it to paused; abandonment takes an open or paused market to final (Void).

Value

"open"

StatePaused

untyped string

Market states. A market moves between open and paused, from either to proposed, and from proposed to final. A cancelled proposal returns it to paused; abandonment takes an open or paused market to final (Void).

Value

"paused"

StateProposed

untyped string

Market states. A market moves between open and paused, from either to proposed, and from proposed to final. A cancelled proposal returns it to paused; abandonment takes an open or paused market to final (Void).

Value

"proposed"

StateFinal

untyped string

Market states. A market moves between open and paused, from either to proposed, and from proposed to final. A cancelled proposal returns it to paused; abandonment takes an open or paused market to final (Void).

Value

"final"

Market

type

All amounts are integer ugnot. One million micro-shares is one share; a winning micro-share pays one ugnot (one whole share pays one GNOT).

Value

v2.Market

QuotePoint

type

QuotePoint records one published quote, in block-time order.

Value

v2.QuotePoint

Position

type

Position is an open holding. It is deleted when its holder claims, so the storage it used is released; the Claimed event keeps the record.

Value

v2.Position

marketRecord

type

Value

v2.marketRecord

Limits

type

Limits bound new purchases. They never affect claims.

Value

v2.Limits

administrator

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

pendingAdministrator

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<zero>

quoter

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

pendingQuoter

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

guardian

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

pendingGuardian

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<zero>

lister

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

pendingLister

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

listingOracle

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

listingTreasury

.uverse.address

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

<gnolang.StringValue>

listingFeePpm

int64

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

40000

realmPaused

bool

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

false

quoteTTL

int64

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

86400

minSpreadPpm

int64

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

0

maxExposure

int64

// micro-shares owed if every open market ends on its larger side

Value

200000000000

openExposure

int64

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Value

16046870

defaultLimits

v2.Limits

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Open
OID
0fbca8…5c03:28
defaultLimits details

Inspect ref

records

map[string]*v2.marketRecord

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Open
OID
0fbca8…5c03:30
records details

Inspect map

marketIDs

[]string (len=70)

OriginCaller is used only at package initialization, to capture the deployer as the first holder of every role. Entry points use the live caller.

Open
OID
0fbca8…5c03:947
marketIDs details (len=70)

+70 more Inspect slice

totalHeldUgnot

int64

// every market's escrow plus fees still held

Value

219000000

Administrator

func() .uverse.address
Open
OID
0fbca8…5c03:33
Administrator details

Inspect func

ProposeRole

func(role string, next .uverse.address)

ProposeRole starts a two-step handover of "admin", "quoter", "guardian" or "lister". The proposed address accepts from its own direct call, so a mistyped address cannot take a role.

Open
OID
0fbca8…5c03:38
ProposeRole details

Inspect func

AcceptRole

func(role string)

AcceptRole completes a handover started by ProposeRole.

Open
OID
0fbca8…5c03:39
AcceptRole details

Inspect func

RevokeRole

func(role string)

RevokeRole empties the quoter, guardian or lister role at once, for a lost or stolen key. The administrator role can only be handed over.

Open
OID
0fbca8…5c03:40
RevokeRole details

Inspect func

SetSettings

func(quoteTTLSeconds int64, minimumSpreadPpm int64, maxExposureMicroShares int64)

SetSettings changes the quote lifetime, the minimum spread and the realm-wide exposure cap. They apply to new quotes and purchases only.

Open
OID
0fbca8…5c03:41
SetSettings details

Inspect func

SetLimits

func(id string, maxTradeMicroShares int64, maxHolderMicroShares int64, maxSideMicroShares int64)

SetLimits changes one market's purchase limits, or with id "" the limits new markets start with.

Open
OID
0fbca8…5c03:42
SetLimits details

Inspect func

SetListingTerms

func(oracle .uverse.address, treasury .uverse.address, feePpm int64)

SetListingTerms fixes the oracle, treasury and fee rate every market listed by the lister must carry. A lister key can then only add markets on these terms; it can never choose who settles them or where their surplus goes.

Open
OID
0fbca8…5c03:43
SetListingTerms details

Inspect func

CreateMarket

func(id string, question string, rules string, conditionID string, yesTokenID string, noTokenID string, yesLabel string, noLabel string, tradingEndsAt int64, yesPricePpm int64, noPricePpm int64, feePpm int64, oracle .uverse.address, treasury .uverse.address, topic string)

CreateMarket freezes every field used to match an external result, the fee rate, the oracle and the treasury. Nothing but the quote and the limits can change later. The administrator chooses the terms; the lister must use the listing terms.

Open
OID
0fbca8…5c03:44
CreateMarket details

Inspect func

SetQuote

func(id string, yesPricePpm int64, noPricePpm int64, expectedVersion int64)

SetQuote publishes both prices while trading is open or paused. The quoter may sign it with a session key. expectedVersion refuses a quote made from a stale view. The same prices again only renew the quote's time, so the keeper can keep an unchanged quote from expiring without a new version.

Open
OID
0fbca8…5c03:45
SetQuote details

Inspect func

Pause

func(id string)

Pause stops new purchases in one market, or with id "" in every market. The quoter (also with a session key), the guardian and the administrator can pause; only the administrator resumes. Claims are never paused.

Open
OID
0fbca8…5c03:46
Pause details

Inspect func

Resume

func(id string)

Resume reopens one paused market, or with id "" lifts the realm-wide pause.

Open
OID
0fbca8…5c03:47
Resume details

Inspect func

Fund

func(id string)

Fund adds reserve capital to one market. It backs that market's sales and returns to the market's treasury only after the market is final.

Open
OID
0fbca8…5c03:48
Fund details

Inspect func

Buy

func(id string, outcome string, microShares int64, expectedPricePpm int64)

Buy creates a position after exact payment of cost plus fee, within the limits, and only while the market's escrow covers its larger side. expectedPricePpm is the price of the chosen outcome that the buyer reviewed. A buyer may sign with a session key: the position is always the account's.

Open
OID
0fbca8…5c03:49
Buy details

Inspect func

ProposeOutcome

func(id string, conditionID string, rulesHash string, yesTokenID string, noTokenID string, outcome string, evidenceHash string)

ProposeOutcome records the oracle's Yes, No or Void with the market's entire source binding and an evidence hash. Trading stops at once. After the dispute window anyone can make it final; within it the guardian can cancel. A Polymarket 50-50 result is proposed as Void.

Open
OID
0fbca8…5c03:50
ProposeOutcome details

Inspect func

CancelProposal

func(id string)

CancelProposal lets the guardian reject a proposed outcome within the dispute window. The market returns to paused; the oracle can propose again.

Open
OID
0fbca8…5c03:51
CancelProposal details

Inspect func

Finalize

func(id string)

Finalize makes a proposed outcome final once the dispute window has passed. Anyone can call it.

Open
OID
0fbca8…5c03:52
Finalize details

Inspect func

VoidAbandoned

func(id string)

VoidAbandoned voids a market that is still unsettled AbandonAfter trading ended. Anyone can call it; every holder then takes back what they paid.

Open
OID
0fbca8…5c03:53
VoidAbandoned details

Inspect func

settle

func(r *v2.marketRecord, outcome string)
Open
OID
0fbca8…5c03:54
settle details

Inspect func

Claim

func(id string) int64

Claim settles the caller's position in a final market and deletes it. On Yes or No each winning micro-share pays one ugnot; on Void the holder gets back the cost and the fee they paid. A losing position closes with zero.

Open
OID
0fbca8…5c03:55
Claim details

Inspect func

WithdrawSurplus

func(id string) int64

WithdrawSurplus sends what a final market no longer owes anyone to its fixed treasury: the escrow above unclaimed payouts or refunds, and on Yes or No the fees. Anyone can call it; the destination was fixed at listing.

Open
OID
0fbca8…5c03:56
WithdrawSurplus details

Inspect func

Surplus

func(id string) (collateralUgnot int64, feesUgnot int64)

Surplus returns what WithdrawSurplus would send now: collateral and fees. It is zero for a market that is not final.

Open
OID
0fbca8…5c03:57
Surplus details

Inspect func

owedCollateral

func(m v2.Market, outcome string) int64

owedCollateral is what the escrow must still pay holders for an outcome.

Open
OID
0fbca8…5c03:58
owedCollateral details

Inspect func

owedFees

func(m v2.Market, outcome string) int64

owedFees is what the fees must still return to holders: all of them on Void.

Open
OID
0fbca8…5c03:59
owedFees details

Inspect func

GetMarket

func(id string) v2.Market
Open
OID
0fbca8…5c03:60
GetMarket details

Inspect func

GetPosition

func(id string, owner .uverse.address) v2.Position
Open
OID
0fbca8…5c03:61
GetPosition details

Inspect func

Quote

func(id string, outcome string, microShares int64) (costUgnot int64, feeUgnot int64)

Quote returns the exact cost and fee for buying microShares of an outcome at the current price. A buyer sends cost + fee.

Open
OID
0fbca8…5c03:64
Quote details

Inspect func

Fee

func(microShares int64, pricePpm int64, feePpm int64) int64

Fee is the service fee in ugnot for microShares at pricePpm and rate feePpm: θ × shares × price × (1 − price) GNOT, rounded up to the ugnot. It is computed exactly as ceil(microShares × feePpm × price × (10^6 − price) / 10^18).

Open
OID
0fbca8…5c03:65
Fee details

Inspect func

ListMarkets

func() []v2.Market
Open
OID
0fbca8…5c03:66
ListMarkets details

Inspect func

QuoteHistory

func(id string) []v2.QuotePoint

QuoteHistory returns a detached copy of the published quotes.

Open
OID
0fbca8…5c03:67
QuoteHistory details

Inspect func

BindingHash

func(question string, rules string) string

Hash UTF-8 length-framed text, shared exactly with the backend source binding.

Open
OID
0fbca8…5c03:68
BindingHash details

Inspect func

caller

func(int, context .uverse.realm) .uverse.address
Open
OID
0fbca8…5c03:69
caller details

Inspect func

assertUser

func(int, context .uverse.realm)
Open
OID
0fbca8…5c03:70
assertUser details

Inspect func

assertOwnKey

func(int, context .uverse.realm)

assertOwnKey also refuses a session key: listing, settings, roles, resuming and resolution need the account's own signature. Session keys may only quote, pause, buy and claim.

Open
OID
0fbca8…5c03:71
assertOwnKey details

Inspect func

assertBankCoverage

func(int, context .uverse.realm, required int64)
Open
OID
0fbca8…5c03:74
assertBankCoverage details

Inspect func

mustMarket

func(id string) *v2.marketRecord
Open
OID
0fbca8…5c03:75
mustMarket details

Inspect func

checkQuote

func(yesPricePpm int64, noPricePpm int64)

checkQuote keeps each side inside the band and the pair at or above one GNOT plus the minimum spread, so buying both sides can never be a sure gain.

Open
OID
0fbca8…5c03:76
checkQuote details

Inspect func

outcomePrice

func(m v2.Market, outcome string) int64
Open
OID
0fbca8…5c03:77
outcomePrice details

Inspect func

quoteCost

func(microShares int64, price int64) int64
Open
OID
0fbca8…5c03:78
quoteCost details

Inspect func

checkedAdd

func(a int64, b int64) int64
Open
OID
0fbca8…5c03:79
checkedAdd details

Inspect func

maximum

func(a int64, b int64) int64
Open
OID
0fbca8…5c03:80
maximum details

Inspect func

require

func(ok bool, message string)
Open
OID
0fbca8…5c03:81
require details

Inspect func

isSlug

func(s string) bool

isSlug keeps market IDs safe in paths and links: lowercase letters, digits and single hyphens.

Open
OID
0fbca8…5c03:83
isSlug details

Inspect func

isTopic

func(s string) bool

isTopic allows an empty topic or up to 24 letters and spaces, such as "Politics".

Open
OID
0fbca8…5c03:84
isTopic details

Inspect func

isLabel

func(s string) bool

isLabel allows an outcome name of 1 to 48 bytes of printable UTF-8 without surrounding spaces or markup characters, such as "Yes" or "Los Angeles Dodgers".

Open
OID
0fbca8…5c03:85
isLabel details

Inspect func

appURL

untyped string

appURL is the exchange interface; the realm page links to it for trading.

Value

"https://the67.click"

pagePath

string

pagePath is this realm's gnoweb path, captured at deployment so links between its pages work on any chain and namespace.

Value

"/r/nym-sixseven067/markets/v2"

historyRows

untyped bigint

Value

(10 <untyped> bigint)

Render

func(path string) string

Render draws the realm's public page on gnoweb: the market list at the root and one page per market at ":\<id>". It is informational; the app reads JSON.

Open
OID
0fbca8…5c03:89
Render details

Inspect func

renderMarket

func(r *v2.marketRecord) string
Open
OID
0fbca8…5c03:92
renderMarket details

Inspect func

outcomeName

func(m v2.Market, outcome string) string

outcomeName is the outcome as the market names it: Yes and No are the first and second token, shown by their names fixed at listing.

Open
OID
0fbca8…5c03:94
outcomeName details

Inspect func

priceText

func(value int64) string

priceText formats millionths like the app: at least two decimals, no trailing zeros beyond them (420000 is "0.42", 425000 is "0.425").

Open
OID
0fbca8…5c03:95
priceText details

Inspect func

timeText

func(unix int64) string
Open
OID
0fbca8…5c03:97
timeText details

Inspect func

countText

func(n int64, one string, many string) string
Open
OID
0fbca8…5c03:98
countText details

Inspect func

escapeText

func(s string) string

escapeText keeps question and rules text literal in Markdown, tables included.

Open
OID
0fbca8…5c03:99
escapeText details

Inspect func

escapeCode

func(s string) string

escapeCode keeps an untrusted path inside one inline code span.

Open
OID
0fbca8…5c03:100
escapeCode details

Inspect func
MarketJSON : func(id string) string Inspect
MarketsJSON : func() string Inspect
PositionJSON : func(id string, owner .uverse.address) string Inspect
PositionsJSON : func(owner .uverse.address) string Inspect
RealmJSON : func() string Inspect
historyJSON : func(points []v2.QuotePoint) string Inspect
jsonString : func(value string) string Inspect
scale : int64 =1000000
maxInt64 : int64 =9223372036854775807
MaxFeePpm : int64 =70000
MinPricePpm : int64 =30000
MaxPricePpm : int64 =970000
DisputeWindow : int64 =86400
AbandonAfter : int64 =5184000
minQuoteTTL : int64 =300
maxQuoteTTL : int64 =604800
maxMinSpread : int64 =100000
maxHistory : untyped bigint =(96 <untyped> bigint)
StateOpen : untyped string ="open"
StatePaused : untyped string ="paused"
StateProposed : untyped string ="proposed"
StateFinal : untyped string ="final"
Market : type =v2.Market
QuotePoint : type =v2.QuotePoint
Position : type =v2.Position
marketRecord : type =v2.marketRecord
Limits : type =v2.Limits
administrator : .uverse.address =<gnolang.StringValue>
pendingAdministrator : .uverse.address =<zero>
quoter : .uverse.address =<gnolang.StringValue>
pendingQuoter : .uverse.address =<gnolang.StringValue>
guardian : .uverse.address =<gnolang.StringValue>
pendingGuardian : .uverse.address =<zero>
lister : .uverse.address =<gnolang.StringValue>
pendingLister : .uverse.address =<gnolang.StringValue>
listingOracle : .uverse.address =<gnolang.StringValue>
listingTreasury : .uverse.address =<gnolang.StringValue>
listingFeePpm : int64 =40000
realmPaused : bool =false
quoteTTL : int64 =86400
minSpreadPpm : int64 =0
maxExposure : int64 =200000000000
openExposure : int64 =16046870
defaultLimits : v2.Limits Inspect
records : map[string]*v2.marketRecord Inspect
marketIDs : []string (len=70) Inspect
totalHeldUgnot : int64 =219000000
Administrator : func() .uverse.address Inspect
Quoter : func() .uverse.address Inspect
Guardian : func() .uverse.address Inspect
Lister : func() .uverse.address Inspect
ProposeRole : func(role string, next .uverse.address) Inspect
AcceptRole : func(role string) Inspect
RevokeRole : func(role string) Inspect
SetSettings : func(quoteTTLSeconds int64, minimumSpreadPpm int64, maxExposureMicroShares int64) Inspect
SetLimits : func(id string, maxTradeMicroShares int64, maxHolderMicroShares int64, maxSideMicroShares int64) Inspect
SetListingTerms : func(oracle .uverse.address, treasury .uverse.address, feePpm int64) Inspect
CreateMarket : func(id string, question string, rules string, conditionID string, yesTokenID string, noTokenID string, yesLabel string, noLabel string, tradingEndsAt int64, yesPricePpm int64, noPricePpm int64, feePpm int64, oracle .uverse.address, treasury .uverse.address, topic string) Inspect
SetQuote : func(id string, yesPricePpm int64, noPricePpm int64, expectedVersion int64) Inspect
Pause : func(id string) Inspect
Resume : func(id string) Inspect
Fund : func(id string) Inspect
Buy : func(id string, outcome string, microShares int64, expectedPricePpm int64) Inspect
ProposeOutcome : func(id string, conditionID string, rulesHash string, yesTokenID string, noTokenID string, outcome string, evidenceHash string) Inspect
CancelProposal : func(id string) Inspect
Finalize : func(id string) Inspect
VoidAbandoned : func(id string) Inspect
settle : func(r *v2.marketRecord, outcome string) Inspect
Claim : func(id string) int64 Inspect
WithdrawSurplus : func(id string) int64 Inspect
Surplus : func(id string) (collateralUgnot int64, feesUgnot int64) Inspect
owedCollateral : func(m v2.Market, outcome string) int64 Inspect
owedFees : func(m v2.Market, outcome string) int64 Inspect
GetMarket : func(id string) v2.Market Inspect
GetPosition : func(id string, owner .uverse.address) v2.Position Inspect
IsPaused : func() bool Inspect
QuoteTTL : func() int64 Inspect
Quote : func(id string, outcome string, microShares int64) (costUgnot int64, feeUgnot int64) Inspect
Fee : func(microShares int64, pricePpm int64, feePpm int64) int64 Inspect
ListMarkets : func() []v2.Market Inspect
QuoteHistory : func(id string) []v2.QuotePoint Inspect
BindingHash : func(question string, rules string) string Inspect
caller : func(int, context .uverse.realm) .uverse.address Inspect
assertUser : func(int, context .uverse.realm) Inspect
assertOwnKey : func(int, context .uverse.realm) Inspect
assertNoSend : func() Inspect
singleSend : func() int64 Inspect
assertBankCoverage : func(int, context .uverse.realm, required int64) Inspect
mustMarket : func(id string) *v2.marketRecord Inspect
checkQuote : func(yesPricePpm int64, noPricePpm int64) Inspect
outcomePrice : func(m v2.Market, outcome string) int64 Inspect
quoteCost : func(microShares int64, price int64) int64 Inspect
checkedAdd : func(a int64, b int64) int64 Inspect
maximum : func(a int64, b int64) int64 Inspect
require : func(ok bool, message string) Inspect
isHash : func(s string) bool Inspect
isSlug : func(s string) bool Inspect
isTopic : func(s string) bool Inspect
isLabel : func(s string) bool Inspect
isTokenID : func(s string) bool Inspect
decimal : func(value int64) string Inspect
appURL : untyped string ="https://the67.click"
pagePath : string ="/r/nym-sixseven067/markets/v2"
historyRows : untyped bigint =(10 <untyped> bigint)
Render : func(path string) string Inspect
renderIndex : func() string Inspect
renderMarket : func(r *v2.marketRecord) string Inspect
status : func(m v2.Market) string Inspect
outcomeName : func(m v2.Market, outcome string) string Inspect
priceText : func(value int64) string Inspect
dayText : func(unix int64) string Inspect
timeText : func(unix int64) string Inspect
countText : func(n int64, one string, many string) string Inspect
escapeText : func(s string) string Inspect
escapeCode : func(s string) string Inspect