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

Function

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

Gno Expression Evaluator

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