doc.gno
1.13 Kb · 23 lines
1// Package limit holds the immutable building blocks of the GnoSwap limit
2// order realm:
3//
4// - types.gno: interfaces between the proxy and its implementations
5// - order.gno, config.gno: domain types stored by the realm
6// - math.gno: owner-net minimum output and cumulative execution-fee math
7// - keys.gno: B+tree key encodings
8// - consts.gno: basis-point denominator and domain bounds
9//
10// Nothing here owns realm state. Storage, authorization, and token transfers
11// live in gno.land/r/gnoswap/order/limit and its implementations under impl/.
12//
13// Accounting: an order escrows makingAmount of tokenIn for takingAmount of
14// tokenOut. Each fill must pay its owner at least
15//
16// ceil(takingAmount * fillInput * (10000 - slippageBps) / (makingAmount * 10000))
17//
18// after the execution fee. The fee rate is snapshotted at creation; the total
19// fee is floor(cumulativeGrossOutput * executionFeeRate / 10000). Each fill
20// pays only the increase in that total, so splitting fills cannot reduce fees.
21// Filled and refunded input are tracked separately; only the remaining input
22// can be filled before expiry or refunded.
23package limit