consts.gno
2.52 Kb · 70 lines
1package impl
2
3const (
4 dcaBPTreeFanOut int = 16
5
6 // maxExecutionCountLimit bounds the configurable executions per order,
7 // so cancelling an order releases its execution logs within one block.
8 maxExecutionCountLimit int64 = 10_000
9
10 // Bounds of an allowed interval: one minute to one year.
11 minAllowedInterval int64 = 60
12 maxAllowedInterval int64 = 365 * 24 * 60 * 60
13
14 // maxClaimBatchSizeLimit bounds the configurable ClaimGroupOrders batch.
15 maxClaimBatchSizeLimit int64 = 500
16
17 // minOrderAmountOutFloor is the least output a round credits each of
18 // its orders, whatever minOrderAmountOut ExecuteGroup is given.
19 minOrderAmountOutFloor int64 = 1
20
21 defaultMinAmountPerExecution int64 = 1
22 defaultMaxExecutionCount int64 = 1_000
23 defaultMaxClaimBatchSize int64 = 50
24 defaultExecutionFeeRate int64 = 15 // basis points
25
26 // Starting execution gap: half an interval; tune per deployment.
27 defaultMinExecutionGapRate int64 = 5_000
28
29 // defaultMaxPoolPriceDeviationRate is the starting
30 // Config.MaxPoolPriceDeviationRate: 20%, in basis points of price.
31 defaultMaxPoolPriceDeviationRate int64 = 2_000
32
33 // defaultMaxPairPriceLimitAge is the starting Config.MaxPairPriceLimitAge:
34 // one hour, in seconds.
35 defaultMaxPairPriceLimitAge int64 = 60 * 60
36
37 // Bounds of Config.MaxPairPriceLimitAge: one minute to seven days.
38 minMaxPairPriceLimitAge int64 = 60
39 maxMaxPairPriceLimitAge int64 = 7 * 24 * 60 * 60
40)
41
42// Intervals new orders may use after deployment, in seconds.
43// A month is a fixed 30 days, so every round in a group has the same length.
44const (
45 intervalMinute int64 = 60
46 intervalHour int64 = 60 * intervalMinute
47 intervalDay int64 = 24 * intervalHour
48 intervalWeek int64 = 7 * intervalDay
49 intervalMonth int64 = 30 * intervalDay
50)
51
52// defaultAllowedIntervals returns the initial allowed intervals, ascending.
53func defaultAllowedIntervals() []int64 {
54 return []int64{intervalMinute, intervalHour, intervalDay, intervalWeek, intervalMonth}
55}
56
57// defaultSlotSteps returns the initial slot step of the intervals split
58// into several slots: daily orders pick an hour, weekly and 30-day orders
59// a day. A 30-day slot is a day of the 30-day cycle counted from the unix
60// epoch, not a calendar date.
61// Minute and hourly orders keep a single slot, offset 0: finer slots would
62// split liquidity for little gain.
63// Each slot is its own group, so the steps bound the groups per pair.
64func defaultSlotSteps() map[int64]int64 {
65 return map[int64]int64{
66 intervalDay: intervalHour,
67 intervalWeek: intervalDay,
68 intervalMonth: intervalDay,
69 }
70}