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

doc.gno

1.70 Kb · 29 lines
 1// Package impl is the v0 implementation of the GnoSwap limit order realm.
 2// It registers itself with gno.land/r/gnoswap/order/limit at init.
 3//
 4// Files:
 5//   - order.gno: CreateOrder, CancelOrder, CleanupExpiredOrders, CleanupExpiredOrdersByIDs
 6//   - execute.gno: ExecuteOrder, pool swaps, balance checks, and fill settlement
 7//   - execution_fee.gno: SetExecutionFeeRate, pending fees, and protocol fee collection
 8//   - swap.gno: swap price limits and pool amount decoding
 9//   - config.gno: admin configuration of order limits and cleanup batches
10//   - getter.gno: read-only queries
11//   - assert.gno, utils.gno: shared checks and helpers
12//
13// Each fill uses the keeper's pool fee tier on the order's token pair; the
14// pool must be whitelisted for Limit orders. A zero sqrtPriceLimitX96 requires
15// the entire maxAmountIn to be consumed; a nonzero limit permits partial
16// consumption. Actual balance deltas must match the pool result, and the
17// owner-net output must satisfy the order's slippage-adjusted ratio on the
18// actual input, after the incremental cumulative execution fee.
19//
20// Filled orders are removed before paying the owner. Execution fees are
21// forwarded to the protocol fee realm, or kept pending if collection is
22// halted or rejected; later fills or CollectPendingExecutionFee retry them.
23// Expired orders cannot be filled. Owner cancellation and public bounded
24// cleanup refund unsold input and remove orders from both indexes.
25// Roles: gno.land/r/gnoswap/order/keeper restricts ExecuteOrder to
26// LimitKeeperRole at deployment. Admin or governance configures order limits
27// and fees; PoolManagerRole manages the separate Limit pool whitelist through
28// gno.land/r/gnoswap/order/whitelist.
29package impl