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

dca package

Overview

Package dca is the GnoSwap DCA (dollar-cost averaging) order realm.

Users escrow inputToken and sell amountPerExecution of it for outputToken every interval, executionCount times, at a chosen slot of the interval (e.g. 09:00 UTC daily). Orders of the same pair, interval, and slot form a group that keepers execute in one pool swap per round, on the pair's best whitelisted pool, without the router. Each round's swap output accrues to the orders and is paid by Claim, or by keepers through ClaimGroupOrders; each payout deducts the execution fee at the rate the order snapshotted when it was created.

This package is the permanent entry point. It owns the escrow address, the KV store shared by every version, and the upgrade switch; the business logic lives in a registered implementation (impl/v0).

Files:

  • proxy.gno: state-changing entry points
  • getter.gno: read-only queries
  • store.gno: KV store and store keys
  • state.gno: realm state and the active implementation
  • upgrade.gno: implementation registration and upgrades

Functions

AddAllowedInterval

func AddAllowedInterval(cur realm, interval int64)
Ask AI Claude ChatGPT

AddAllowedInterval allows new orders to use interval, in seconds (one minute to one year). The interval starts with a single slot, offset 0 (see SetSlotStep). Admin or governance only.

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/gnoswap/order/dca" -func "AddAllowedInterval" -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/gnoswap/order/dca" -func "AddAllowedInterval" -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
  

CancelOrder

func CancelOrder(cur realm, orderID uint64) (int64, int64)
Ask AI Claude ChatGPT

CancelOrder pays accrued output, refunds unsold input, and closes the order. It returns the refunded input and the output paid by this call.

Owner only. Reverts while the withdraw operation is halted.

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/gnoswap/order/dca" -func "CancelOrder" -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/gnoswap/order/dca" -func "CancelOrder" -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, orderID uint64) int64
Ask AI Claude ChatGPT

Claim pays accrued output to the order owner and returns the amount. Anyone may call it, e.g. a keeper delivering output; proceeds always go to the owner. The order's execution logs whose rounds all executed are released, and their storage deposit is refunded to the caller.

Reverts while the withdraw operation is halted.

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/gnoswap/order/dca" -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/gnoswap/order/dca" -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
  

ClaimGroupOrders

func ClaimGroupOrders(cur realm, groupID string, startAfterOrderID uint64, maxOrderCount int) (int, uint64)
Ask AI Claude ChatGPT

ClaimGroupOrders pays accrued output to the owners of a group's active orders, as Claim does, so owners receive output without claiming. Anyone may call it; output always goes to the order owner.

One call examines at most min(maxOrderCount, maxClaimBatchSize) orders after startAfterOrderID, in ID order. It returns the number of orders paid or completed and the cursor for the next call; repeat until the cursor is 0.

Each order's execution logs whose rounds all executed are released and finished orders are deleted; the freed storage deposit is refunded to the caller, so the reward grows with the orders and rounds claimed.

Reverts while the withdraw operation is halted.

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/gnoswap/order/dca" -func "ClaimGroupOrders" -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/gnoswap/order/dca" -func "ClaimGroupOrders" -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
  

CollectPendingExecutionFee

func CollectPendingExecutionFee(cur realm, tokenPath string) (int64, int64)
Ask AI Claude ChatGPT

CollectPendingExecutionFee forwards the execution fee pending for tokenPath (see GetPendingExecutionFeeAmount) to the protocol fee realm and returns the amount forwarded and the amount left pending. Payouts keep each order's execution fee as pending, and every round forwards the pending fee of its output token; this forwards it when no round of that output token runs. If the protocol fee realm rejects it, for example while its collection is halted, the fee stays pending. Anyone may call it: the fee only moves to the protocol fee realm.

Reverts while the withdraw operation is halted.

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/gnoswap/order/dca" -func "CollectPendingExecutionFee" -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/gnoswap/order/dca" -func "CollectPendingExecutionFee" -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
  

CreateOrder

func CreateOrder( cur realm, inputToken string, outputToken string, interval int64, slotOffset int64, amountPerExecution int64, executionCount int64, ) uint64
Ask AI Claude ChatGPT

CreateOrder creates an order that sells amountPerExecution of inputToken for outputToken every interval seconds, executionCount times, and returns its ID.

The caller must first approve Address() for amountPerExecution*executionCount. amountPerExecution must be at least GetMinAmountPerExecution(inputToken), and the pair direction needs a price limit (see SetPairPriceLimit). The order snapshots the execution fee rate in effect (see GetExecutionFeeRate) for its lifetime: the fee is that share of the order's output, deducted when the output is paid out. Later rate changes apply only to orders created afterwards. Orders with the same inputToken, outputToken, interval, and slotOffset share one group and execute together. Each round trades on the pair's best whitelisted pool, chosen at execution time (see GetExecutionQuote).

The caller also pays the storage deposit of the order's execution logs, one per three rounds; each is refunded to whoever releases it after all of its rounds execute (see ClaimGroupOrders).

Parameters:

  • inputToken, outputToken: at least one whitelisted direct pool must connect them (see gno.land/r/gnoswap/order/whitelist.AddWhitelistedPool).
  • interval: one of GetConfig().AllowedIntervals().
  • slotOffset: seconds after each interval boundary of the unix epoch at which rounds run, a multiple of GetConfig().SlotStep(interval) in [0, interval). Boundaries are UTC midnights for daily intervals; weekly boundaries fall on Thursdays 00:00 UTC (1970-01-01 was one), so a Monday slot is 4 days. The first round waits for the next slot, or runs now if it is due.

Reverts while the execute operation is halted for DCA in gno.land/r/gnoswap/order/halt.

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/gnoswap/order/dca" -func "CreateOrder" -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/gnoswap/order/dca" -func "CreateOrder" -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
  

ExecuteGroup

func ExecuteGroup(cur realm, groupID string, expectedAmountIn int64, amountOutMin int64, minOrderAmountOut int64) (int64, int64)
Ask AI Claude ChatGPT

ExecuteGroup runs the next round of a group once it is due. Only accounts holding the DCA keeper role in gno.land/r/gnoswap/order/keeper may call it: the ExecuteGroup selector is assigned to DCAKeeperRole at deployment, and admin or governance grants the role or reassigns it. It returns the round input and the output credited to the orders, before their execution fees, which each order pays when paid out.

Parameters:

  • groupID: see GetExecutableGroups.
  • amountOutMin: minimum pool output, before the execution fee; 0 disables it.
  • expectedAmountIn: the group orderAmount amountOutMin was quoted for. The round reverts if the orderAmount differs; 0 is accepted only with amountOutMin 0.
  • minOrderAmountOut: the least output every order of the round must be credited after its own execution fee rate (see GetExecutionQuote), in the output token's smallest unit; 0 means 1. The round reverts when its smallest order would receive less.

Pool selection: among the pair's whitelisted pools (one per fee tier), the pool with the best quote for the full round is used. The round swaps on that pool directly through gno.land/r/gnoswap/pool, without the router, so no router fee is charged. The swap's price limit comes from the pair price limit (see SetPairPriceLimit), so no unit of input is sold below it, whatever amountOutMin is. The round reverts when no whitelisted pool can fill it within the limit.

Reverts while the execute or withdraw operation is halted.

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/gnoswap/order/dca" -func "ExecuteGroup" -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/gnoswap/order/dca" -func "ExecuteGroup" -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
  

ExistsGroup

func ExistsGroup(groupID string) bool
Ask AI Claude ChatGPT

ExistsGroup reports whether a group is stored.

Parameters:

  • groupID: pdca.MakeGroupID(inputToken, outputToken, interval, slotOffset)

Returns:

  • bool: true when the group exists

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.ExistsGroup()"

Result

ExistsOrder

func ExistsOrder(orderID uint64) bool
Ask AI Claude ChatGPT

ExistsOrder reports whether an order is active. Finished orders are deleted.

Parameters:

  • orderID: order to look up

Returns:

  • bool: true while the order is active

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.ExistsOrder()"

Result

ForceCancelOrder

func ForceCancelOrder(cur realm, orderID uint64) (int64, int64)
Ask AI Claude ChatGPT

ForceCancelOrder closes an order that blocks its group's rounds. As with CancelOrder, accrued output and unsold input go to the order owner; the caller receives nothing but the freed storage deposit of the order's execution logs. It returns the refunded input and the output paid.

The order must have rounds left and be, as checked on-chain:

  • below the minimum per execution a new order of its token needs now (reason below_min_amount), or
  • in a due round that, as quoted now, credits it less than one output unit after its execution fee (no_order_output), or
  • the largest order (by amountPerExecution, ties included) of a due round that no pool can fill as quoted now while a pool fills part of it, with some output, within the price limit (exceeds_pool_capacity). A round that needs several orders gone is shrunk one largest order per call.

Any other order reverts with "order does not block its group". DCAOrderForceCancelled reports the reason.

Only accounts holding the role assigned to the ForceCancelOrder selector in gno.land/r/gnoswap/order/keeper (DCAKeeperRole at deployment). Reverts while the withdraw operation is halted.

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/gnoswap/order/dca" -func "ForceCancelOrder" -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/gnoswap/order/dca" -func "ForceCancelOrder" -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
  

GetAllowedIntervals

func GetAllowedIntervals() []int64
Ask AI Claude ChatGPT

GetAllowedIntervals returns the intervals new orders may use.

Returns:

  • []int64: allowed intervals in seconds, ascending

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetAllowedIntervals()"

Result

GetClaimableAmount

func GetClaimableAmount(orderID uint64) int64
Ask AI Claude ChatGPT

GetClaimableAmount returns the output an order can claim now, net of the order's execution fee.

Parameters:

  • orderID: order to look up

Returns:

  • int64: output the next Claim pays the owner; 0 when the order is not active

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetClaimableAmount()"

Result

GetConfig

func GetConfig() *pdca.Config
Ask AI Claude ChatGPT

GetConfig returns a copy of the configuration.

Returns:

  • *pdca.Config: copy of the stored configuration

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetConfig()"

Result

GetExecutableGroups

func GetExecutableGroups(cursor string, count int) ([]*pdca.Group, error)
Ask AI Claude ChatGPT

GetExecutableGroups returns copies of up to count groups due now, oldest first.

Paging: start with cursor "", then pass pdca.FormatScheduleCursor of the last group back until fewer than count groups return. The cursor is a fixed schedule position, so groups executed between pages do not shift it.

Parameters:

  • cursor: "" or "<nextExecutionTimestamp>|<groupID>" of the last group seen
  • count: maximum number of groups returned

Returns:

  • []*pdca.Group: copies of due groups without their round marks; empty while execution is halted
  • error: non-nil when cursor is malformed

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetExecutableGroups(,)"

Result

GetExecutionFeeRate

func GetExecutionFeeRate() int64
Ask AI Claude ChatGPT

GetExecutionFeeRate returns the execution fee rate new orders snapshot: the share of an order's output sent to the protocol fee realm. An existing order's rate is pdca.Order.ExecutionFeeRate (see GetOrder).

Returns:

  • int64: execution fee rate, in basis points

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetExecutionFeeRate()"

Result

GetExecutionLogs

func GetExecutionLogs() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetExecutionLogs returns the read-only index of unreleased execution logs. Iterate the [pdca.ExecutionLogPrefix(orderID), pdca.PrefixEnd(prefix)) range for one order's logs; the key suffix decodes to the first round.

Returns:

  • *rotree.ReadOnlyTree: pdca.ExecutionLogKey(orderID, firstRound) -> uint64 lastRound

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetExecutionLogs()"

Result

GetExecutionQuote

func GetExecutionQuote(groupID string) string
Ask AI Claude ChatGPT

GetExecutionQuote returns, as JSON, how the group's next round would trade now: its input, the selected pool, the expected pool output, an estimate of the orders' execution fees on that output and of what is left for the orders, and every candidate pool's quote or ineligibility reason. Orders pay their own snapshotted fee rates when paid out, each rounding its own cumulative fee. The fee and order output totals instead charge executionFeeRate, the highest rate of the orders the round sells (0 when none does), once on the whole output, so they are estimates, not bounds: the fees the orders pay can exceed expectedExecutionFeeAmount by rounding. minAmountsByExecutionFeeRate lists, by ascending fee rate, the smallest order of each rate the round sells. The round reverts unless every listed order is credited at least max(1, minOrderAmountOut) net of its rate; expectedMinOrderAmountOut is the least such output at expectedAmountOut, and minAmountPerExecution the smallest order overall. Keepers set amountOutMin from expectedAmountOut and pass amountIn as expectedAmountIn.

Parameters:

  • groupID: group to quote

Returns:

  • string: JSON quote; "" when the group does not exist

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetExecutionQuote()"

Result

GetGroup

func GetGroup(groupID string) (*pdca.Group, error)
Ask AI Claude ChatGPT

GetGroup returns a copy of a group without its round marks. The copy's round mark tree is empty; read the marks through GetGroupRoundMarks.

Parameters:

  • groupID: group to look up

Returns:

  • *pdca.Group: copy of the group's fields
  • error: non-nil when the group does not exist

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetGroup()"

Result

GetGroupRoundMarks

func GetGroupRoundMarks(groupID string) *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetGroupRoundMarks returns a read-only view of a group's round marks: one per round at which an unfinalized order ends.

Parameters:

  • groupID: group to look up

Returns:

  • *rotree.ReadOnlyTree: pdca.RoundKey(round) -> *pdca.RoundMark; each mark read from the view is a copy. nil when the group does not exist

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetGroupRoundMarks()"

Result

GetGroups

func GetGroups() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetGroups returns a read-only view of every group.

Returns:

  • *rotree.ReadOnlyTree: groupID -> *pdca.Group; each group read from the view is a copy without its round marks, as GetGroup returns

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetGroups()"

Result

GetImplementationPackagePath

func GetImplementationPackagePath() string
Ask AI Claude ChatGPT

GetImplementationPackagePath returns the active implementation path.

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetImplementationPackagePath()"

Result

GetMaxClaimBatchSize

func GetMaxClaimBatchSize() int64
Ask AI Claude ChatGPT

GetMaxClaimBatchSize returns the most orders one ClaimGroupOrders call examines.

Returns:

  • int64: maximum claim batch size

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetMaxClaimBatchSize()"

Result

GetMaxExecutionCount

func GetMaxExecutionCount() int64
Ask AI Claude ChatGPT

GetMaxExecutionCount returns the maximum executions of a new order.

Returns:

  • int64: maximum executionCount

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetMaxExecutionCount()"

Result

GetMaxPairPriceLimitAge

func GetMaxPairPriceLimitAge() int64
Ask AI Claude ChatGPT

GetMaxPairPriceLimitAge returns how long, in seconds, a pair price limit stays usable after it was set (see SetMaxPairPriceLimitAge).

Returns:

  • int64: maximum age in seconds

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetMaxPairPriceLimitAge()"

Result

GetMaxPoolPriceDeviationRate

func GetMaxPoolPriceDeviationRate() int64
Ask AI Claude ChatGPT

GetMaxPoolPriceDeviationRate returns how far, in basis points of price, a pool's price may sit on the favorable side of its swap price limit and still be quoted (see SetMaxPoolPriceDeviationRate); 0 means the check is off.

Returns:

  • int64: rate in basis points

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetMaxPoolPriceDeviationRate()"

Result

GetMinAmountPerExecution

func GetMinAmountPerExecution(tokenPath string) int64
Ask AI Claude ChatGPT

GetMinAmountPerExecution returns the minimum input per execution a new order selling tokenPath needs: the larger of GetConfig().MinAmountPerExecution() and GetTokenMinAmountPerExecution(tokenPath).

Parameters:

  • tokenPath: input token path

Returns:

  • int64: effective minimum, in raw token units

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetMinAmountPerExecution()"

Result

GetMinExecutionGapRate

func GetMinExecutionGapRate() int64
Ask AI Claude ChatGPT

GetMinExecutionGapRate returns the minimum gap between a group's executions.

Returns:

  • int64: minimum gap, in basis points of the group interval

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetMinExecutionGapRate()"

Result

GetNextOrderID

func GetNextOrderID() uint64
Ask AI Claude ChatGPT

GetNextOrderID returns the ID the next created order receives.

Returns:

  • uint64: next order ID

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetNextOrderID()"

Result

GetOrder

func GetOrder(orderID uint64) (*pdca.Order, error)
Ask AI Claude ChatGPT

GetOrder returns a copy of an active order. Finished orders are deleted and return an error.

Parameters:

  • orderID: order to look up

Returns:

  • *pdca.Order: copy of the order
  • error: non-nil when the order is not active

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrder()"

Result

GetOrderAmountsByGroup

func GetOrderAmountsByGroup() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetOrderAmountsByGroup returns the read-only group index of orders by executionFeeRate, then amountPerExecution, which a round reads for the smallest order of each fee rate. Iterate the [pdca.GroupOrderPrefix(groupID), pdca.PrefixEnd(prefix)) range for one group's orders by ascending executionFeeRate, amountPerExecution, then ID, or the [pdca.GroupOrderFeeRatePrefix(groupID, rate), pdca.PrefixEnd(prefix)) range for the orders of one fee rate. A finished order's entry stays until the order is paid out or a later round of its group removes it.

Returns:

  • *rotree.ReadOnlyTree: pdca.GroupOrderAmountKey(groupID, executionFeeRate, amountPerExecution, orderID) -> uint64 endRound

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrderAmountsByGroup()"

Result

GetOrderExecutionLogs

func GetOrderExecutionLogs(orderID uint64, count int) ([]*pdca.ExecutionLog, error)
Ask AI Claude ChatGPT

GetOrderExecutionLogs returns copies of up to count of an active order's unreleased execution logs, oldest first: each covers up to three rounds, [FirstRound, LastRound], and the input the order sells in each. A log is released once all of its rounds executed and the order is claimed; the rounds' swap results are in the DCAGroupExecuted events.

Parameters:

  • orderID: order to look up
  • count: maximum number of logs returned

Returns:

  • []*pdca.ExecutionLog: copies of the order's unreleased logs
  • error: non-nil when the order is not active

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrderExecutionLogs(,)"

Result

GetOrderIDsByGroup

func GetOrderIDsByGroup(groupID string, startAfterID uint64, count int) []uint64
Ask AI Claude ChatGPT

GetOrderIDsByGroup returns up to count active order IDs of a group, ascending and greater than startAfterID. Page as GetOrderIDsByOwner.

Parameters:

  • groupID: group to look up
  • startAfterID: exclusive lower bound of the returned IDs
  • count: maximum number of IDs returned

Returns:

  • []uint64: active order IDs, ascending

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrderIDsByGroup(,,)"

Result

GetOrderIDsByOwner

func GetOrderIDsByOwner(owner address, startAfterID uint64, count int) []uint64
Ask AI Claude ChatGPT

GetOrderIDsByOwner returns up to count active order IDs of owner, ascending and greater than startAfterID (0 starts from the first). Page by passing the last returned ID.

Parameters:

  • owner: order owner
  • startAfterID: exclusive lower bound of the returned IDs
  • count: maximum number of IDs returned

Returns:

  • []uint64: active order IDs, ascending

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrderIDsByOwner(,,)"

Result

GetOrders

func GetOrders() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetOrders returns a read-only view of active orders.

Returns:

  • *rotree.ReadOnlyTree: pdca.OrderKey(orderID) -> *pdca.Order; each order read from the view is a copy

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrders()"

Result

GetOrdersByGroup

func GetOrdersByGroup() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetOrdersByGroup returns the read-only group index of active orders. Iterate the [pdca.GroupOrderPrefix(groupID), pdca.PrefixEnd(prefix)) range for one group's orders in ID order.

Returns:

  • *rotree.ReadOnlyTree: pdca.GroupOrderKey(groupID, orderID) -> uint64 orderID

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrdersByGroup()"

Result

GetOrdersByOwner

func GetOrdersByOwner() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetOrdersByOwner returns the read-only owner index of active orders. Iterate the [pdca.OwnerOrderPrefix(owner), pdca.PrefixEnd(prefix)) range for one owner's orders in ID order.

Returns:

  • *rotree.ReadOnlyTree: pdca.OwnerOrderKey(owner, orderID) -> uint64 orderID

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetOrdersByOwner()"

Result

GetPairPriceLimit

func GetPairPriceLimit(inputToken string, outputToken string) (string, int64)
Ask AI Claude ChatGPT

GetPairPriceLimit returns the price limit of selling inputToken for outputToken (see SetPairPriceLimit).

Parameters:

  • inputToken, outputToken: the pair direction

Returns:

  • string: minOutputPerInputX128, decimal Q128; "0" when none is set
  • int64: unix time the limit was set; 0 when none is set

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetPairPriceLimit(,)"

Result

GetPairPriceLimits

func GetPairPriceLimits() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetPairPriceLimits returns a read-only view of the pair price limits, in key order. Entries are copies.

Returns:

  • *rotree.ReadOnlyTree: "inputToken:outputToken" -> *pdca.PairPriceLimit

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetPairPriceLimits()"

Result

GetPendingExecutionFeeAmount

func GetPendingExecutionFeeAmount(tokenPath string) int64
Ask AI Claude ChatGPT

GetPendingExecutionFeeAmount returns the execution fee of tokenPath held by this realm: fees payouts charged, and fees the protocol fee realm could not accept yet. It is forwarded by the next round whose output token is tokenPath, or by CollectPendingExecutionFee.

Parameters:

  • tokenPath: fee token path

Returns:

  • int64: pending execution fee, in raw token units

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetPendingExecutionFeeAmount()"

Result

GetPendingExecutionFees

func GetPendingExecutionFees() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetPendingExecutionFees returns the read-only index of pending execution fees. A token whose pending fee was forwarded keeps its entry at 0.

Returns:

  • *rotree.ReadOnlyTree: tokenPath -> int64 pending amount

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetPendingExecutionFees()"

Result

GetScheduledGroups

func GetScheduledGroups() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetScheduledGroups returns the read-only schedule of groups with input to sell, ordered by next execution timestamp, then group ID. pdca.ScheduleKeyTimestamp decodes a key's timestamp.

Returns:

  • *rotree.ReadOnlyTree: pdca.ScheduleKey(nextExecutionTimestamp, groupID) -> string groupID

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetScheduledGroups()"

Result

GetSlotStep

func GetSlotStep(interval int64) int64
Ask AI Claude ChatGPT

GetSlotStep returns the spacing of the slot offsets new orders may use at interval.

Parameters:

  • interval: round interval, in seconds

Returns:

  • int64: slot step in seconds; 0 when interval is not allowed

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetSlotStep()"

Result

GetTokenMinAmountPerExecution

func GetTokenMinAmountPerExecution(tokenPath string) int64
Ask AI Claude ChatGPT

GetTokenMinAmountPerExecution returns the minimum input per execution the manager set for tokenPath (see SetTokenMinAmountPerExecution).

Parameters:

  • tokenPath: input token path

Returns:

  • int64: minimum in raw token units; 0 when none is set

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetTokenMinAmountPerExecution()"

Result

GetTokenMinAmountsPerExecution

func GetTokenMinAmountsPerExecution() *rotree.ReadOnlyTree
Ask AI Claude ChatGPT

GetTokenMinAmountsPerExecution returns the read-only index of per-token minimums, in key order.

Returns:

  • *rotree.ReadOnlyTree: tokenPath -> int64

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.GetTokenMinAmountsPerExecution()"

Result

IsAllowedInterval

func IsAllowedInterval(interval int64) bool
Ask AI Claude ChatGPT

IsAllowedInterval reports whether new orders may use interval.

Parameters:

  • interval: round interval, in seconds

Returns:

  • bool: true when interval is allowed

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.IsAllowedInterval()"

Result

NewBPTreeN

func NewBPTreeN(fanout int) *bptree.BPTree
Ask AI Claude ChatGPT

NewBPTreeN allocates an empty B+tree in the order/dca realm. Implementations create the store trees through it, so the trees are owned by the realm that stores them.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.NewBPTreeN()"

Result

NewDCAOrderStore

func NewDCAOrderStore(kvStore store.KVStore) pdca.IDCAOrderStore
Ask AI Claude ChatGPT

NewDCAOrderStore wraps the domain KV store.

Param

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.NewDCAOrderStore()"

Result

NewSwapCallback

func NewSwapCallback(_ int, rlm realm, tokenIn string, zeroForOne bool, maxAmountIn int64) func(cur realm, amount0Delta, amount1Delta int64, _ *pool.CallbackMarker) error
Ask AI Claude ChatGPT

NewSwapCallback returns the callback of one round's pool.Swap. It pays the pool the round input, at most maxAmountIn of tokenIn, from the escrow.

The callback is declared in this realm, so it transfers as the escrow itself: the escrow never grants an allowance for a swap. That makes the callback a payment capability, so it is guarded on creation and on use:

  • only the escrow's own current realm can create one, so only code the proxy hands its realm to (the active implementation) can;
  • only the pool can invoke it (cur.Previous()); the pool's swap lock admits no other swap while a round's swap runs;
  • it pays only while a round is executing, once, and only an exact-input delta of the sold token: positive input, no positive output, at most maxAmountIn.

zeroForOne is the swap direction: it selects which pool delta is tokenIn.

Params

Command

gnokey query vm/qeval -remote "https://rpc.onyx.testnets.gno.land" -data "gno.land/r/gnoswap/order/dca.NewSwapCallback(,,,,)"

Result

RegisterInitializer

func RegisterInitializer(cur realm, initializer func(_ int, rlm realm, dcaStore pdca.IDCAOrderStore) pdca.IDCAOrder)
Ask AI Claude ChatGPT

RegisterInitializer registers an implementation version. Each version calls it from init with a factory that receives the shared store. Only packages under this realm's path may register, and the first registration becomes active. A nil initializer is rejected here, instead of panicking later when the version is activated.

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/gnoswap/order/dca" -func "RegisterInitializer" -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/gnoswap/order/dca" -func "RegisterInitializer" -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
  

RemoveAllowedInterval

func RemoveAllowedInterval(cur realm, interval int64)
Ask AI Claude ChatGPT

RemoveAllowedInterval stops new orders from using interval. Existing orders and groups of that interval keep running until they finish; its slot step is dropped, and re-adding it starts from a single slot. At least one interval must stay allowed. Admin or governance only.

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/gnoswap/order/dca" -func "RemoveAllowedInterval" -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/gnoswap/order/dca" -func "RemoveAllowedInterval" -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
  

SetExecutionFeeRate

func SetExecutionFeeRate(cur realm, executionFeeRate int64)
Ask AI Claude ChatGPT

SetExecutionFeeRate sets the share of an order's output, in basis points (0 to 1000, at most 10%), sent to the protocol fee realm. Orders created afterwards snapshot it; existing orders keep their rate.

Admin or governance only.

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/gnoswap/order/dca" -func "SetExecutionFeeRate" -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/gnoswap/order/dca" -func "SetExecutionFeeRate" -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
  

SetMaxClaimBatchSize

func SetMaxClaimBatchSize(cur realm, maxClaimBatchSize int64)
Ask AI Claude ChatGPT

SetMaxClaimBatchSize caps the orders one ClaimGroupOrders call examines, bounding its gas. Admin or governance only.

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/gnoswap/order/dca" -func "SetMaxClaimBatchSize" -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/gnoswap/order/dca" -func "SetMaxClaimBatchSize" -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
  

SetMaxPairPriceLimitAge

func SetMaxPairPriceLimitAge(cur realm, maxPairPriceLimitAge int64)
Ask AI Claude ChatGPT

SetMaxPairPriceLimitAge sets how long, in seconds, a pair price limit stays usable after the pool manager set it (see SetPairPriceLimit), 60 to 604800. Under an older limit every pool is ineligible (code price_limit_stale), so rounds stop until the limit is refreshed instead of trading at a stale price. v0 starts at 3600 (one hour). Admin or governance only.

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/gnoswap/order/dca" -func "SetMaxPairPriceLimitAge" -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/gnoswap/order/dca" -func "SetMaxPairPriceLimitAge" -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
  

SetMaxPoolPriceDeviationRate

func SetMaxPoolPriceDeviationRate(cur realm, maxPoolPriceDeviationRate int64)
Ask AI Claude ChatGPT

SetMaxPoolPriceDeviationRate sets how far, in basis points of price, a pool's price may sit on the favorable side of its swap price limit (see SetPairPriceLimit) and still be quoted, 0 to 10000; 0 disables the check. A pool further away is ineligible without a quote: its quote or swap would walk every tick between its price and the limit, which an empty or manipulated pool far from the oracle price makes unbounded. v0 starts at 2000 (20%). Admin or governance only.

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/gnoswap/order/dca" -func "SetMaxPoolPriceDeviationRate" -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/gnoswap/order/dca" -func "SetMaxPoolPriceDeviationRate" -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
  

SetMinExecutionGapRate

func SetMinExecutionGapRate(cur realm, minExecutionGapRate int64)
Ask AI Claude ChatGPT

SetMinExecutionGapRate sets the minimum gap between two executions of a group, in basis points of its interval (0 to 10000), so a late execution is not followed right away by the next one. Admin or governance only.

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/gnoswap/order/dca" -func "SetMinExecutionGapRate" -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/gnoswap/order/dca" -func "SetMinExecutionGapRate" -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
  

SetOrderLimits

func SetOrderLimits(cur realm, minAmountPerExecution int64, maxExecutionCount int64)
Ask AI Claude ChatGPT

SetOrderLimits sets the minimum input per execution and the maximum executions per order. Admin or governance only.

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/gnoswap/order/dca" -func "SetOrderLimits" -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/gnoswap/order/dca" -func "SetOrderLimits" -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
  

SetPairPriceLimit

func SetPairPriceLimit(cur realm, inputToken string, outputToken string, minOutputPerInputX128 string)
Ask AI Claude ChatGPT

SetPairPriceLimit sets the least pool output, before the execution fee, that rounds selling inputToken for outputToken accept per unit of input: minOutputPerInputX128 is raw outputToken units per raw inputToken unit, in Q128 fixed point, as a decimal string. "0" removes the limit.

Every quote and round of the pair direction passes the limit to the pool as its swap price limit, adjusted for the pool's fee tier, so each unit of input fills at a rate of at least the limit and a swap crosses only the ticks up to it. A pool whose price is past the limit is skipped, and a round that cannot be filled within it reverts. A pair direction without a limit cannot be quoted, executed, or receive new orders. The limit applies from the next quote or round, to existing orders too. Its update time is recorded but not checked on-chain.

Admin, governance, or accounts holding the role assigned to the SetPairPriceLimit selector in gno.land/r/gnoswap/order/keeper (PoolManagerRole at deployment).

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/gnoswap/order/dca" -func "SetPairPriceLimit" -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/gnoswap/order/dca" -func "SetPairPriceLimit" -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
  

SetSlotStep

func SetSlotStep(cur realm, interval int64, slotStep int64)
Ask AI Claude ChatGPT

SetSlotStep sets the spacing, in seconds, of the slot offsets new orders may use at interval: slotStep must divide the interval, and the interval then has interval/slotStep slots. slotStep == interval allows offset 0 only.

Existing groups keep their slot, even one the new step no longer allows; only new orders are checked. Finer steps split each pair's orders into more groups, so each round sells less in more swaps.

Admin or governance only.

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/gnoswap/order/dca" -func "SetSlotStep" -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/gnoswap/order/dca" -func "SetSlotStep" -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
  

SetTokenMinAmountPerExecution

func SetTokenMinAmountPerExecution(cur realm, tokenPath string, minAmountPerExecution int64)
Ask AI Claude ChatGPT

SetTokenMinAmountPerExecution sets the minimum input per execution of new orders selling tokenPath, in raw token units, applied on top of the global minimum (see SetOrderLimits); 0 removes it. The pool manager derives it from an oracle price, so every order is worth a set value per round whatever the token's decimals. Existing orders are unaffected.

Admin, governance, or accounts holding the role assigned to the SetTokenMinAmountPerExecution selector in gno.land/r/gnoswap/order/keeper (PoolManagerRole at deployment).

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/gnoswap/order/dca" -func "SetTokenMinAmountPerExecution" -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/gnoswap/order/dca" -func "SetTokenMinAmountPerExecution" -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
  

UpgradeImpl

func UpgradeImpl(cur realm, packagePath string)
Ask AI Claude ChatGPT

UpgradeImpl activates a previously registered version by package path. Admin or governance only.

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/gnoswap/order/dca" -func "UpgradeImpl" -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/gnoswap/order/dca" -func "UpgradeImpl" -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
  

Gno Expression Evaluator

Evaluate any read-only Gno expression against gno.land/r/gnoswap/order/dca, for example a function call with arguments.