Skip to content Search Apps Documentation Source Content Run Reset Eval Playground 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.

pool state

Back to all declarations

TransferOwnership

func(next .uverse.address)
Open
OID
0cb759…5c07:3
TransferOwnership details

Inspect func

CancelOwnershipTransfer

func()
Open
OID
0cb759…5c07:5
CancelOwnershipTransfer details

Inspect func

QueueOracle

func(next .uverse.address)
Open
OID
0cb759…5c07:7
QueueOracle details

Inspect func

SetArbiter

func(next .uverse.address)
Open
OID
0cb759…5c07:11
SetArbiter details

Inspect func

QueueFeeRecipient

func(next .uverse.address)
Open
OID
0cb759…5c07:12
QueueFeeRecipient details

Inspect func

CancelFeeRecipient

func()
Open
OID
0cb759…5c07:13
CancelFeeRecipient details

Inspect func

ExecuteFeeRecipient

func()
Open
OID
0cb759…5c07:14
ExecuteFeeRecipient details

Inspect func

SetAuditAgent

func(next string)

SetAuditAgent appoints the reviewer that may dispute with a bond; "" disables it.

Open
OID
0cb759…5c07:16
SetAuditAgent details

Inspect func

SetCaps

func(market int64, account int64)

SetCaps sets guarded launch caps in net mUSD units (0 = none). They only gate new stakes.

Open
OID
0cb759…5c07:17
SetCaps details

Inspect func

SetLockAt

func(id int64, at int64)

SetLockAt closes a market to new stakes early (kickoff), by its creator or the owner. Only ever earlier.

Open
OID
0cb759…5c07:18
SetLockAt details

Inspect func

owed

func(m *pool.Market, p *pool.Position) (gross int64, feeBase int64)

owed is what \`user\` is owed from a resolved market: gross = stake back + share of the losing side. Full refund when either side is empty or on DRAW / UNRESOLVABLE. feeBase is the profit copy fees may be charged on: the user's NET profit (the share less their own stake on the losing side, so a hedger never pays a copy fee on their own money), counted only on the copied part of the winning stake. Deposits at or after the settlement cutoff are late: their net principal comes back and they share in nothing.

Open
OID
0cb759…5c07:19
owed details

Inspect func

winnerPayout

func(m *pool.Market, p *pool.Position) bool
Open
OID
0cb759…5c07:21
winnerPayout details

Inspect func

copyFees

func(user .uverse.address, p *pool.Position, feeBase int64) (toRef int64, toPlatform int64)

copyFees are the copy-trade fees on the copied net profit: (to the referrer, to the platform). Nobody pays themselves: a referrer or fee recipient who is the user waives that leg.

Open
OID
0cb759…5c07:22
copyFees details

Inspect func

Claim

func(id int64)

Claim collects the caller's own payout.

Open
OID
0cb759…5c07:23
Claim details

Inspect func

ClaimFor

func(id int64, user .uverse.address)

ClaimFor lets anyone push a user's payout to them. The money only ever goes to \`user\`.

Open
OID
0cb759…5c07:24
ClaimFor details

Inspect func

claimFor

func(id int64, user .uverse.address)
Open
OID
0cb759…5c07:25
claimFor details

Inspect func

ClaimFees

func()

ClaimFees pays the caller's accrued fees (entry fees, copy fees, forfeited bonds).

Open
OID
0cb759…5c07:26
ClaimFees details

Inspect func

ClaimFeesTo

func(to .uverse.address)
Open
OID
0cb759…5c07:27
ClaimFeesTo details

Inspect func

claimFeesTo

func(to .uverse.address)
Open
OID
0cb759…5c07:28
claimFeesTo details

Inspect func

CreateMarket

func(question string, labelA string, labelB string, resolutionURL string, category string, deadline int64, side int, referrer string, amount int64) int64

CreateMarket opens a market with \`amount\` mUSD (pulled from the caller, less the entry fee) staked on \`side\` (SideA or SideB). \`referrer\` is the copied basket's creator, or "" for none. Returns the new market's id.

Open
OID
0cb759…5c07:29
CreateMarket details

Inspect func

Stake

func(id int64, side int, referrer string, amount int64)

Stake puts \`amount\` mUSD (less the entry fee) on \`side\`. Repeated stakes add up.

Open
OID
0cb759…5c07:31
Stake details

Inspect func

addStake

func(m *pool.Market, side int, referrer .uverse.address, amount int64)
Open
OID
0cb759…5c07:32
addStake details

Inspect func

StOpen

untyped bigint

Market states.

Value

(0 <untyped> bigint)

StProposed

untyped bigint

Market states.

Value

(1 <untyped> bigint)

StDisputed

untyped bigint

Market states.

Value

(2 <untyped> bigint)

StResolved

untyped bigint

Market states.

Value

(3 <untyped> bigint)

SideA

untyped bigint

Sides and outcomes.

Value

(1 <untyped> bigint)

SideB

untyped bigint

Sides and outcomes.

Value

(2 <untyped> bigint)

Draw

untyped bigint

Sides and outcomes.

Value

(3 <untyped> bigint)

Unresolvable

untyped bigint

Sides and outcomes.

Value

(4 <untyped> bigint)

MinStake

int64

Value

100000

DisputeBond

int64

Value

2000000

LockSeconds

int64

Value

60

MaxDeadlineAhead

int64

Value

31536000

MaxEntryBps

int64

Value

100

ReferrerFeeBps

int64

Value

100

CopyFeeBps

int64

Value

100

ResolutionGraceSeconds

int64

Value

604800

MaxDisputeWindow

int64

Value

604800

MinLiveDisputeWindow

int64

Value

86400

TestnetDisputeWindow

int64

Value

600

Deployer

.uverse.address

Initial roles. The owner can change each one afterwards.

Value

<gnolang.StringValue>

InitialOracle

.uverse.address

Initial roles. The owner can change each one afterwards.

Value

<gnolang.StringValue>

InitialArbiter

.uverse.address

Initial roles. The owner can change each one afterwards.

Value

<gnolang.StringValue>

Market

type

Value

pool.Market

Position

type

Value

pool.Position

markets

v0.Tree

// padded id -> \*Market

Open
OID
0cb759…5c07:34
markets details

Inspect ref

marketCount

int64

Value

3

accruedFees

v0.Tree

// address -> int64

Open
OID
0cb759…5c07:37
accruedFees details

Inspect ref

lifetimeFeesAccrued

int64

Value

225500

lifetimeFeesClaimed

int64

Value

0

disputeWindow

int64

Value

600

emit

func(typ string, attrs []string)
Open
OID
0cb759…5c07:45
emit details

Inspect func

getMarket

func(id int64) *pool.Market
Open
OID
0cb759…5c07:48
getMarket details

Inspect func

feesOf

func(a .uverse.address) int64
Open
OID
0cb759…5c07:49
feesOf details

Inspect func

accrue

func(id int64, to .uverse.address, amount int64)
Open
OID
0cb759…5c07:50
accrue details

Inspect func

pull

func(from .uverse.address, amount int64)

pull moves exactly amount mUSD from the caller into this realm (needs an allowance).

Open
OID
0cb759…5c07:51
pull details

Inspect func

push

func(to .uverse.address, amount int64)
Open
OID
0cb759…5c07:52
push details

Inspect func

parseReferrer

func(s string) .uverse.address
Open
OID
0cb759…5c07:56
parseReferrer details

Inspect func

entryBps

func(a .uverse.address) int64
Open
OID
0cb759…5c07:57
entryBps details

Inspect func

outcomeName

func(m *pool.Market, o int) string
Open
OID
0cb759…5c07:60
outcomeName details

Inspect func

renderMarket

func(m *pool.Market) string
Open
OID
0cb759…5c07:66
renderMarket details

Inspect func

hashOrNone

func(h string) string
Open
OID
0cb759…5c07:68
hashOrNone details

Inspect func

validOutcome

func(outcome int)
Open
OID
0cb759…5c07:69
validOutcome details

Inspect func

refundAt

func(m *pool.Market) int64

refundAt is when RefundExpired opens: grace from the latest deadline, proposal or dispute.

Open
OID
0cb759…5c07:72
refundAt details

Inspect func

setCutoff

func(m *pool.Market, cutoff int64)
Open
OID
0cb759…5c07:73
setCutoff details

Inspect func

Resolve

func(id int64, outcome int, summary string, evidenceHash string)

Resolve is the oracle's verdict: final at once with no dispute window, else a proposal.

Open
OID
0cb759…5c07:74
Resolve details

Inspect func

ResolveWithCutoff

func(id int64, outcome int, summary string, evidenceHash string, cutoff int64)

ResolveWithCutoff also sets the settlement cutoff: only deposits strictly before it compete; later ones get their net principal back.

Open
OID
0cb759…5c07:75
ResolveWithCutoff details

Inspect func

resolve

func(id int64, outcome int, summary string, evidenceHash string, cutoff int64)
Open
OID
0cb759…5c07:76
resolve details

Inspect func

Dispute

func(id int64)

Dispute escalates the proposal to the arbiter, pulling DisputeBond mUSD. Open to the market's participants, the audit agent and the arbiter.

Open
OID
0cb759…5c07:77
Dispute details

Inspect func

VetoProposal

func(id int64)

VetoProposal lets the owner send a proposal it believes wrong to the arbiter, inside the window. No bond; if the arbiter never rules, RefundExpired refunds every stake rather than honouring the vetoed proposal.

Open
OID
0cb759…5c07:78
VetoProposal details

Inspect func

Finalize

func(id int64)

Finalize settles an undisputed proposal once the window has closed. Anyone may call it.

Open
OID
0cb759…5c07:79
Finalize details

Inspect func

ResolveDispute

func(id int64, outcome int, summary string, evidenceHash string)

ResolveDispute is the arbiter's final word on a disputed market.

Open
OID
0cb759…5c07:80
ResolveDispute details

Inspect func

ResolveDisputeWithCutoff

func(id int64, outcome int, summary string, evidenceHash string, cutoff int64)
Open
OID
0cb759…5c07:81
ResolveDisputeWithCutoff details

Inspect func

resolveDispute

func(m *pool.Market, outcome int, summary string, evidenceHash string, cutoff int64)
Open
OID
0cb759…5c07:82
resolveDispute details

Inspect func

RefundExpired

func(id int64)

RefundExpired is the escape hatch, open to anyone once the grace has passed. A market the oracle never resolved is refunded in full; a dispute the arbiter never ruled on settles to the oracle's proposal and the bond is forfeited, so a cheap dispute cannot turn a loss into a free refund. A vetoed proposal, or any proposal while paused, refunds instead.

Open
OID
0cb759…5c07:83
RefundExpired details

Inspect func

settle

func(m *pool.Market, outcome int, summary string, evidenceHash string)
Open
OID
0cb759…5c07:84
settle details

Inspect func

settleBond

func(m *pool.Market, returnIt bool)
Open
OID
0cb759…5c07:85
settleBond details

Inspect func

AuditAgent

func() .uverse.address
Open
OID
0cb759…5c07:92
AuditAgent details

Inspect func

FeeRecipient

func() .uverse.address
Open
OID
0cb759…5c07:93
FeeRecipient details

Inspect func

AccruedFees

func(a .uverse.address) int64
Open
OID
0cb759…5c07:96
AccruedFees details

Inspect func

SideTotals

func(id int64) (int64, int64)

SideTotals are the pool sizes: the implied probability of A is totalA / (totalA + totalB).

Open
OID
0cb759…5c07:97
SideTotals details

Inspect func

StakeOf

func(id int64, user .uverse.address) (int64, int64)
Open
OID
0cb759…5c07:98
StakeOf details

Inspect func

EligibleTotals

func(id int64) (int64, int64)

EligibleTotals are the side totals that compete under the settlement cutoff.

Open
OID
0cb759…5c07:99
EligibleTotals details

Inspect func

Claimable

func(id int64, user .uverse.address) (payout int64, fee int64)

Claimable is what ClaimFor would pay \`user\` now (net) and the copy fees it would take. 0 if unresolved, already claimed or nothing owed.

Open
OID
0cb759…5c07:100
Claimable details

Inspect func

MarketJSON

func(id int64) string
Open
OID
0cb759…5c07:102
MarketJSON details

Inspect func

MarketsJSON

func(offset int, limit int) string

MarketsJSON lists markets newest first: \`offset\` skips that many from the newest.

Open
OID
0cb759…5c07:103
MarketsJSON details

Inspect func

PositionJSON

func(id int64, user .uverse.address) string

PositionJSON is one user's stake, claim state and claimable amount in a market.

Open
OID
0cb759…5c07:104
PositionJSON details

Inspect func

marketJSON

func(m *pool.Market) string
Open
OID
0cb759…5c07:105
marketJSON details

Inspect func
TransferOwnership : func(next .uverse.address) Inspect
CancelOwnershipTransfer : func() Inspect
AcceptOwnership : func() Inspect
QueueOracle : func(next .uverse.address) Inspect
RevokeOracle : func() Inspect
CancelOracle : func() Inspect
ExecuteOracle : func() Inspect
SetArbiter : func(next .uverse.address) Inspect
QueueFeeRecipient : func(next .uverse.address) Inspect
CancelFeeRecipient : func() Inspect
ExecuteFeeRecipient : func() Inspect
SetPaused : func(p bool) Inspect
SetAuditAgent : func(next string) Inspect
SetCaps : func(market int64, account int64) Inspect
SetLockAt : func(id int64, at int64) Inspect
owed : func(m *pool.Market, p *pool.Position) (gross int64, feeBase int64) Inspect
winnerPayout : func(m *pool.Market, p *pool.Position) bool Inspect
copyFees : func(user .uverse.address, p *pool.Position, feeBase int64) (toRef int64, toPlatform int64) Inspect
Claim : func(id int64) Inspect
ClaimFor : func(id int64, user .uverse.address) Inspect
claimFor : func(id int64, user .uverse.address) Inspect
ClaimFees : func() Inspect
ClaimFeesTo : func(to .uverse.address) Inspect
claimFeesTo : func(to .uverse.address) Inspect
CreateMarket : func(question string, labelA string, labelB string, resolutionURL string, category string, deadline int64, side int, referrer string, amount int64) int64 Inspect
Stake : func(id int64, side int, referrer string, amount int64) Inspect
addStake : func(m *pool.Market, side int, referrer .uverse.address, amount int64) Inspect
StOpen : untyped bigint =(0 <untyped> bigint)
StProposed : untyped bigint =(1 <untyped> bigint)
StDisputed : untyped bigint =(2 <untyped> bigint)
StResolved : untyped bigint =(3 <untyped> bigint)
SideA : untyped bigint =(1 <untyped> bigint)
SideB : untyped bigint =(2 <untyped> bigint)
Draw : untyped bigint =(3 <untyped> bigint)
Unresolvable : untyped bigint =(4 <untyped> bigint)
MinStake : int64 =100000
DisputeBond : int64 =2000000
LockSeconds : int64 =60
MaxDeadlineAhead : int64 =31536000
MaxEntryBps : int64 =100
ReferrerFeeBps : int64 =100
CopyFeeBps : int64 =100
ResolutionGraceSeconds : int64 =604800
MaxDisputeWindow : int64 =604800
MinLiveDisputeWindow : int64 =86400
TestnetDisputeWindow : int64 =600
Deployer : .uverse.address =<gnolang.StringValue>
InitialOracle : .uverse.address =<gnolang.StringValue>
InitialArbiter : .uverse.address =<gnolang.StringValue>
Market : type =pool.Market
Position : type =pool.Position
markets : v0.Tree Inspect
marketCount : int64 =3
accruedFees : v0.Tree Inspect
lifetimeFeesAccrued : int64 =225500
lifetimeFeesClaimed : int64 =0
roles : *mimir.Roles Inspect
disputeWindow : int64 =600
init.58 : func() Inspect
now : func() int64 Inspect
emit : func(typ string, attrs []string) Inspect
itoa : func(n int64) string Inspect
key : func(id int64) string Inspect
getMarket : func(id int64) *pool.Market Inspect
feesOf : func(a .uverse.address) int64 Inspect
accrue : func(id int64, to .uverse.address, amount int64) Inspect
pull : func(from .uverse.address, amount int64) Inspect
push : func(to .uverse.address, amount int64) Inspect
caller : func() .uverse.address Inspect
assertOwner : func() Inspect
assertNotPaused : func() Inspect
parseReferrer : func(s string) .uverse.address Inspect
entryBps : func(a .uverse.address) int64 Inspect
stateNames : []string (len=4) Inspect
outcomeName : func(m *pool.Market, o int) string Inspect
pct : func(a int64, b int64) int64 Inspect
when : func(unix int64) string Inspect
Render : func(path string) string Inspect
renderHome : func() string Inspect
renderMarket : func(m *pool.Market) string Inspect
hashOrNone : func(h string) string Inspect
validOutcome : func(outcome int) Inspect
validHash : func(h string) Inspect
refundAt : func(m *pool.Market) int64 Inspect
setCutoff : func(m *pool.Market, cutoff int64) Inspect
Resolve : func(id int64, outcome int, summary string, evidenceHash string) Inspect
ResolveWithCutoff : func(id int64, outcome int, summary string, evidenceHash string, cutoff int64) Inspect
resolve : func(id int64, outcome int, summary string, evidenceHash string, cutoff int64) Inspect
Dispute : func(id int64) Inspect
VetoProposal : func(id int64) Inspect
Finalize : func(id int64) Inspect
ResolveDispute : func(id int64, outcome int, summary string, evidenceHash string) Inspect
ResolveDisputeWithCutoff : func(id int64, outcome int, summary string, evidenceHash string, cutoff int64) Inspect
resolveDispute : func(m *pool.Market, outcome int, summary string, evidenceHash string, cutoff int64) Inspect
RefundExpired : func(id int64) Inspect
settle : func(m *pool.Market, outcome int, summary string, evidenceHash string) Inspect
settleBond : func(m *pool.Market, returnIt bool) Inspect
boolStr : func(b bool) string Inspect
MarketCount : func() int64 Inspect
Owner : func() .uverse.address Inspect
Arbiter : func() .uverse.address Inspect
Oracle : func() .uverse.address Inspect
AuditAgent : func() .uverse.address Inspect
FeeRecipient : func() .uverse.address Inspect
Paused : func() bool Inspect
DisputeWindow : func() int64 Inspect
AccruedFees : func(a .uverse.address) int64 Inspect
SideTotals : func(id int64) (int64, int64) Inspect
StakeOf : func(id int64, user .uverse.address) (int64, int64) Inspect
EligibleTotals : func(id int64) (int64, int64) Inspect
Claimable : func(id int64, user .uverse.address) (payout int64, fee int64) Inspect
ConfigJSON : func() string Inspect
MarketJSON : func(id int64) string Inspect
MarketsJSON : func(offset int, limit int) string Inspect
PositionJSON : func(id int64, user .uverse.address) string Inspect
marketJSON : func(m *pool.Market) string Inspect
kv : func(k string, v string) string Inspect