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.

markets package

Overview

Package markets keeps collateral, positions and winning payouts on Gno. It does not discover external outcomes: each market trusts its pinned oracle.

Functions

AcceptAdministrator

func AcceptAdministrator(cur realm)
Ask AI Claude ChatGPT

AcceptAdministrator completes the handover started by ProposeAdministrator.

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "AcceptAdministrator" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "AcceptAdministrator" -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

BindingHash

func BindingHash(question, rules string) string
Ask AI Claude ChatGPT

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

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.BindingHash(,)"

Result

Buy

func Buy(cur realm, id, outcome string, microShares, expectedPricePpm int64)
Ask AI Claude ChatGPT

Buy creates positions only after exact payment and full market-specific collateral coverage. expectedPricePpm is the selected outcome's captured price.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "Buy" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "Buy" -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Claim

func Claim(cur realm, id string) int64
Ask AI Claude ChatGPT

Claim pays only the immediate caller's winning shares. Repeated calls abort; a losing position can be closed once with zero payout. A panic rolls back both state and bank effects in the Gno transaction.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "Claim" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "Claim" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

CreateMarket

func CreateMarket(cur realm, id, question, rules, conditionID, yesTokenID, noTokenID string, closesAt, yesPricePpm int64, oracle address)
Ask AI Claude ChatGPT

CreateMarket freezes every field used to match an external result. There are deliberately no question/rules/source/oracle/price update functions.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "CreateMarket" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "CreateMarket" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

FinalizeByOracle

func FinalizeByOracle(cur realm, id, conditionID, rulesHash, yesTokenID, noTokenID, winner, evidenceHash string)
Ask AI Claude ChatGPT

FinalizeByOracle accepts only the pinned oracle and the entire immutable source binding. EvidenceHash commits to an externally verified final record. Neither a price threshold nor an unverified API response can call this by itself. A source can resolve before the planned closing date. Oracle finalization therefore closes trading immediately, without waiting for that deadline.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "FinalizeByOracle" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "FinalizeByOracle" -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Fund

func Fund(cur realm, id string)
Ask AI Claude ChatGPT

Fund adds non-refundable reserve capital, allocated solely to this market. No withdrawal or banker capability is exposed, even to the administrator.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "Fund" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "Fund" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

MarketJSON

func MarketJSON(id string) string
Ask AI Claude ChatGPT

Gno 1.5.0 does not include encoding/json. These read-only projections use explicit fields and JSON string escaping, without an external package.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.MarketJSON()"

Result

MarketsJSON

func MarketsJSON() string
Ask AI Claude ChatGPT

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

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.MarketsJSON()"

Result

PositionJSON

func PositionJSON(id string, owner address) string
Ask AI Claude ChatGPT

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.PositionJSON(,)"

Result

PositionsJSON

func PositionsJSON(owner address) string
Ask AI Claude ChatGPT

PositionsJSON returns the owner's positions across all markets, in market creation order. Markets where the owner never bought are omitted.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.PositionsJSON()"

Result

ProposeAdministrator

func ProposeAdministrator(cur realm, next address)
Ask AI Claude ChatGPT

ProposeAdministrator starts a two-step handover. The proposed address must accept from its own direct user call, so a mistyped address cannot take over. Each market keeps the oracle it was created with.

Param

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "ProposeAdministrator" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "ProposeAdministrator" -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

Quote

func Quote(id, outcome string, microShares int64) int64
Ask AI Claude ChatGPT

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.Quote(,,)"

Result

Render

func Render(path string) string
Ask AI Claude ChatGPT

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.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.Render()"

Result

SetQuote

func SetQuote(cur realm, id string, yesPricePpm, expectedVersion int64)
Ask AI Claude ChatGPT

SetQuote publishes a new fixed quote while trading is open. expectedVersion prevents an operator from overwriting a quote it has not seen. Every Buy still checks the exact price its buyer reviewed.

Params

Command

# WARNING: This command is running in an INSECURE mode.
# It is strongly recommended to use a hardware device for signing
# and avoid trusting any computer connected to the internet,
# as your private keys could be exposed.

gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "SetQuote" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -chainid "onyx-1" -remote "https://rpc.onyx.testnets.gno.land" ADDRESSgnokey query -remote "https://rpc.onyx.testnets.gno.land" auth/accounts/ADDRESS
gnokey maketx call -pkgpath "gno.land/r/nym-sixseven067/markets" -func "SetQuote" -args $'' -args $'' -args $'' -gas-fee 1000000ugnot -gas-wanted 1_000_000_000 -send "" -broadcast=false ADDRESS > call.tx
gnokey sign -tx-path call.tx -chainid "onyx-1" -account-number ACCOUNTNUMBER -account-sequence SEQUENCENUMBER ADDRESS
gnokey broadcast -remote "https://rpc.onyx.testnets.gno.land" call.tx
  

GetMarket

func GetMarket(id string) Market
Ask AI Claude ChatGPT

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.GetMarket()"

Result

ListMarkets

func ListMarkets() []Market
Ask AI Claude ChatGPT

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.ListMarkets()"

Result

GetPosition

func GetPosition(id string, owner address) Position
Ask AI Claude ChatGPT

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.GetPosition(,)"

Result

QuoteHistory

func QuoteHistory(id string) []QuotePoint
Ask AI Claude ChatGPT

QuoteHistory returns a detached copy of the published quotes.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/nym-sixseven067/markets.QuoteHistory()"

Result