LoadingPreparing the Explorer shell…
Skip to contentRealm detail
zdex
gno.land/r/g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr/zdex/v2
Indexed deployment identity with independently loaded latest RPC source, functions, and Render.
Indexed deployment
Identity
- Package path
- gno.land/r/g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr/zdex/v2
- Deployed (UTC)
package zdex
import (
"gno.land/p/nt/ufmt/v0"
"gno.land/r/demo/defi/grc20reg"
)
// Height is the current chain height (for UI deadlines).
func Height() int64 {
return height()
}
// PoolList returns one pool id per line.
func PoolList() string {
out := ""
pools.Iterate("", "", func(k string, _ any) bool {
if out != "" {
out += "\n"
}
out += k
return false
})
return out
}
// PoolSnapshot is a single-line UI record:
// id;symbol;name;reserveU;reserveT;virtualU;totalLP;feeBps;launched;unlockH;snipeUntil;snipeMaxBps;creator;decimals
func PoolSnapshot(poolID string) string {
p := getPool(poolID)
return ufmt.Sprintf("%s;%s;%s;%d;%d;%d;%d;%d;%d;%d;%d;%d;%s;%d",
p.ID, p.Symbol, p.Name,
p.ReserveU, p.ReserveT, p.VirtualU, p.TotalLP, p.FeeBps,
btoi(p.Launched), p.UnlockHeight, p.SnipeUntil, p.SnipeMaxBps,
p.Creator.String(), p.Decimals)
}
// OrderList returns one order per line:
// id;pool;side;giveAmt;wantAmt;expireH;allOrNone;maker
func OrderList() string {
out := ""
orders.Iterate("", "", func(_ string, v any) bool {
o := v.(*Order)
side := "ask"
if o.GiveUgnot {
side = "bid"
}
line := ufmt.Sprintf("%d;%s;%s;%d;%d;%d;%d;%s",
int64(o.ID), o.PoolID, side, o.GiveAmt, o.WantAmt, o.ExpireH, btoi(o.AllOrNone), o.Maker.String())
if out != "" {
out += "\n"
}
out += line
return false
})
return out
}
func PointsSnapshot(owner address) string {
life, ep, cl := PointsOf(owner)
return ufmt.Sprintf("%d;%d;%d;%d", life, ep, cl, ClaimableFeeShare(owner))
}
func EpochSnapshot() string {
id, endH, pot, pts, cID, cPot, cPts := EpochInfo()
return ufmt.Sprintf("%d;%d;%d;%d;%d;%d;%d", id, endH, pot, pts, cID, cPot, cPts)
}
func tokenLine(symbol, name, key string, decimals int64, pooled, internal bool) string {
if name == "" {
name = symbol
}
return ufmt.Sprintf("%s;%s;%s;%d;%d;%d", symbol, name, key, decimals, btoi(pooled), btoi(internal))
}
// TokenCatalog lists known tokens (internal + pooled), one per line:
// symbol;name;key;decimals;pooled;internal
func TokenCatalog() string {
out := ""
seen := map[string]bool{}
add := func(line, symbol string) {
if seen[symbol] {
return
}
seen[symbol] = true
if out != "" {
out += "\n"
}
out += line
}
tokens.Iterate("", "", func(k string, v any) bool {
rec := v.(*tokenRec)
pooled := tryPool(poolIDFor(k)) != nil
add(tokenLine(rec.token.GetSymbol(), rec.token.GetName(), rec.token.ID(), int64(rec.token.GetDecimals()), pooled, true), k)
return false
})
pools.Iterate("", "", func(_ string, v any) bool {
p := v.(*Pool)
internal := tryTok(p.Symbol) != nil
add(tokenLine(p.Symbol, p.Name, p.Token, p.Decimals, true, internal), p.Symbol)
return false
})
return out
}
// LookupToken resolves an internal symbol, pool id, or GRC20 registry key.
// Same record as TokenCatalog, or empty if unknown.
func LookupToken(ref string) string {
if ref == "" {
return ""
}
if p := tryPool(ref); p != nil {
return tokenLine(p.Symbol, p.Name, p.Token, p.Decimals, true, tryTok(p.Symbol) != nil)
}
if rec := tryTok(ref); rec != nil {
return tokenLine(rec.token.GetSymbol(), rec.token.GetName(), rec.token.ID(), int64(rec.token.GetDecimals()), tryPool(poolIDFor(ref)) != nil, true)
}
if p := tryPool(poolIDFor(ref)); p != nil {
return tokenLine(p.Symbol, p.Name, p.Token, p.Decimals, true, tryTok(p.Symbol) != nil)
}
t := grc20reg.Get(ref)
if t == nil {
return ""
}
sym := t.GetSymbol()
return tokenLine(sym, t.GetName(), ref, int64(t.GetDecimals()), tryPool(poolIDFor(sym)) != nil, false)
}
Latest RPC state
Exported functions
- SetPaused(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, v bool)
- ProposeAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, next string)
- AcceptAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string})
- TransferAdmin(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, next string)
- Admin() string
- RealmAddr() string
- PendingAdmin() string
- Paused() bool
- CollectFees(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string) (int64, int64)
- PlaceBid(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, giveU int64, wantAmt int64, expireH int64, allOrNone bool) uint64
- PlaceAsk(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, giveT int64, wantU int64, expireH int64, allOrNone bool) uint64
Latest RPC state · Realm Render
zdex v2
GNOT-native AMM generation 2. Two-sided pools, native ugnot (no wrap), escrow limit orders.
Swap fee 0.30% default (tiers 0.05% / 0.30% / 1.00%). Protocol ~1/6 of the fee.
- Version: 2
- Package:
gno.land/r/g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr/zdex/v2
- Pools: 1
- Open orders: 0
- Admin:
g1mv0052e7r6s09f5t9xsqf00nj3tqsgt9dg52jr
Pools
| Pair | ugnot | token | virtual | fee | launch |
|---|---:|---:|---:|---:|---|
| ZDEX | 300000000 | 300000000000 | 0 | 30 bps | no |
Swap
Create a pool
Two-sided ugnot/GRC20. Min 1 GNOT. Fee tiers 5 / 30 / 100 bps. Protocol takes ~1/6 of the swap fee; the rest stays as LP.
Order book
FillOrder(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, orderID uint64, giveAmt int64) (int64, int64)CancelOrder(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, orderID uint64)OrderCount() intLaunch(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, symbol string, decimals int64, totalSupply int64, creatorKeepBps int64, virtualUgnot int64, vestBlocks int64, lockBlocks int64, snipeBlocks int64, snipeMaxBps int64) stringClaimVest(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string) int64VestingOf(symbol string, owner string) (int64, int64, int64)MulDiv(a int64, b int64, d int64) int64Sqrt(n int64) int64MulDivCeil(a int64, b int64, d int64) int64AmountOut(amountIn int64, reserveIn int64, virtualIn int64, reserveOut int64, virtualOut int64, feeBps int64) int64AmountIn(amountOut int64, reserveIn int64, virtualIn int64, reserveOut int64, virtualOut int64, feeBps int64) int64HarvestPoints(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string) int64ClaimFeeShare(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}) int64PointsOf(owner string) (int64, int64, int64)ClaimableFeeShare(owner string) int64EpochInfo() (int64, int64, int64, int64, int64, int64, int64)SetEpochBlocks(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, n int64)SetFeeShareBps(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, bps int64)CreatePool(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, tokenKey string, symbol string, amountU int64, amountT int64, feeBps int64) stringAddLiquidity(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, amountU int64, maxToken int64, minLP int64) int64RemoveLiquidity(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, lp int64, minU int64, minT int64) (int64, int64)PoolInfo(poolID string) (int64, int64, int64, int64, int64)PositionOf(poolID string, owner string) int64PoolCount() intHeight() int64PoolList() stringPoolSnapshot(poolID string) stringOrderList() stringPointsSnapshot(owner string) stringEpochSnapshot() stringTokenCatalog() stringLookupToken(ref string) stringRender(path string) stringQuote(poolID string, tokenIn string, amountIn int64) int64QuoteIn(poolID string, tokenOut string, amountOut int64) int64SwapExactIn(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, tokenIn string, amountIn int64, minOut int64, maxHeight int64) int64SwapExactOut(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, poolID string, tokenOut string, amountOut int64, maxIn int64, maxHeight int64) int64SpotPrice(poolID string) int64Transfer(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string, to string, amount int64)Approve(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string, spender string, amount int64)TransferFrom(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, symbol string, from string, to string, amount int64)BalanceOf(symbol string, owner string) int64TotalSupply(symbol string) int64TokenKey(symbol string) stringVersion() stringCaps() stringThisPkg() stringNextPkg() stringSetNextPkg(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, path string)ModuleOf(name string) stringSetModule(cur interface {.seal func(); Address func() .uverse.address; IsCode func() bool; IsCurrent func() bool; IsEphemeral func() bool; IsUser func() bool; IsUserCall func() bool; IsUserRun func() bool; PkgPath func() string; Previous func() .uverse.realm; String func() string; Sub func(string) .uverse.realm; Subpath func() string}, name string, pkg string)Modules() stringHubSnapshot() string