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.

market/v1 package

Overview

Package market is the platform's immutable fixed-price market (design §2.5.4). It never holds a token: the seller approves this realm in core, the token stays in the seller's wallet, and Buy moves it through core's official grc721 RealmTeller in the same transaction that pays everyone. It never holds coins either (I-3).

A token has at most one listing, addressed by (cid, tid). Stale listings (RA H-2) cannot be bought: a listing pins the token's move counter and core's approval nonces at listing time, and Buy requires owner == seller, the counter unchanged and the approval it was listed under still in place, unchanged (I-8). Once stale, a listing stays dead: approving the market again later never revives it (SA-L3). A stale listing never blocks the new owner: List overwrites it and anyone may CancelStale it.

Storage (storage-cost-analysis M1-M3): a listing is one packed string in `listings` (key cid:tid) plus one key in the price index `byCollection` (floor, collection pages). Per-seller history comes from the indexer ("Listed"/"Cancelled" events), not from an on-chain index.

Deposit return: gno refunds a freed storage deposit to the signer of the transaction that frees it, so a Buy hands the buyer the deposit the seller locked for the listing. Buy therefore charges the buyer that amount on top of the price and pays it to the seller (ListingDeposit, measured). It is exact up to a few bytes because every listing costs the same storage objects: a sentinel key keeps both trees non-empty (an avl insert into an empty tree creates one node, any later insert two). Net, the seller is whole and the buyer pays the price (the chain's refund cancels the extra). Not compensated: the deposit of a per-token Approve, which the sale's transfer clears (~0.1-0.2 GNOT to the buyer, depending on the collection's other pending approvals); an approval-for-all is not cleared, so listing under SetApprovalForAll leaves nothing behind.

Pause ("trade" in core) stops List and Buy only. Cancel, CancelStale and UpdatePrice are never paused (I-2).

Function

Floor

func Floor(cid string) int64
Ask AI Claude ChatGPT

Floor is the lowest live price in cid, or -1. It inspects at most MaxPageSize listings from the cheapest, so spam cannot make it unbounded.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia2/market/v1.Floor()"

Result

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/g1jz6j9hj6rdf5ltl2kcrpa4jwtdh3w30z0yul06/sinopia2/market/v1, for example a function call with arguments.