doc.gno
2.17 Kb · 36 lines
1// Package impl is the v0 implementation of the GnoSwap DCA order realm.
2// It registers itself with gno.land/r/gnoswap/order/dca at init.
3//
4// Files:
5// - order.gno: CreateOrder, CancelOrder, Claim, ForceCancelOrder
6// - execute.gno: ExecuteGroup and the pool swap; rounds credit gross output
7// - execution_fee.gno: SetExecutionFeeRate, pending payout fees, and forwarding them to the protocol fee realm
8// - pool_selection.gno: choosing the pool of a round
9// - swap.gno: the pool swap of a round and its callback
10// - manager.gno: per-token minimum order sizes and pair price limits
11// - price_limit.gno: converting a pair price limit to a swap price limit
12// - claim_group_orders.gno: ClaimGroupOrders
13// - config.gno: admin configuration and slot steps
14// - getter.gno: read-only queries
15// - assert.gno, utils.gno: shared checks and helpers
16//
17// The executed amount is protected by the pair price limit the pool manager
18// sets from an oracle price, which every quote and swap passes to the pool as
19// its price limit, by the best-quote pool selection, and by the keeper's
20// amountOutMin, quoted for the round's input. The price limit also bounds the
21// ticks a quote or swap crosses, and so its gas. The execution gap keeps
22// a group's next execution at least minExecutionGapRate of its interval after
23// the previous one, even after a late execution.
24// A round reverts unless it credits each of its orders at least the keeper's
25// minOrderAmountOut, and never less than one unit, of output after its own
26// execution fee rate. The order amount index sorts orders by fee rate, then
27// amount, so the smallest order of each fee rate bounds every order of that rate.
28// Roles: gno.land/r/gnoswap/order/keeper restricts executions and force cancellations
29// to DCAKeeperRole, and the shared pool whitelist, token minimums, and price
30// limits to PoolManagerRole, at deployment.
31//
32// Keepers earn storage deposits: each order stores one execution log per
33// three rounds at creation, paid by its owner. Claim and ClaimGroupOrders
34// release the order's logs whose rounds all executed and delete finished
35// orders, which refunds the freed deposit to the transaction signer.
36package impl