1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
//! Constants ported from Curve LLAMMA `constants.vy` and `AMM.vy`.
//!
//! Source: <https://github.com/curvefi/curve-stablecoin/blob/master/curve_stablecoin/constants.vy>
//! Source: <https://github.com/curvefi/curve-stablecoin/blob/master/curve_stablecoin/AMM.vy>
use U256;
/// 1e18 — standard Curve/EVM precision unit.
///
/// `constants.vy`: `WAD: constant(uint256) = 10**18`
pub const WAD: U256 = U256from_limbs;
/// Maximum number of bands a single user position can span.
///
/// `constants.vy`: `MAX_TICKS: constant(int256) = 50`
pub const MAX_TICKS: i64 = 50;
/// Same as MAX_TICKS but unsigned.
///
/// `constants.vy`: `MAX_TICKS_UINT: constant(uint256) = 50`
pub const MAX_TICKS_UINT: u64 = 50;
/// Maximum number of empty bands the AMM will skip during a swap.
///
/// `constants.vy`: `MAX_SKIP_TICKS: constant(int256) = 1024`
pub const MAX_SKIP_TICKS: i64 = 1024;
/// Same as MAX_SKIP_TICKS but unsigned.
///
/// `constants.vy`: `MAX_SKIP_TICKS_UINT: constant(uint256) = 1024`
pub const MAX_SKIP_TICKS_UINT: u64 = 1024;
/// Oracle price smoothing delay in seconds.
///
/// `AMM.vy`: `PREV_P_O_DELAY: constant(uint256) = 2 * 60 # s = 2 min`
pub const PREV_P_O_DELAY: U256 = U256from_limbs;
/// Maximum relative oracle price change per update.
/// Approximately `2^(1/3) * 1e18 ≈ 1.2599e18`, ensuring fee < 50%.
///
/// `AMM.vy`: `MAX_P_O_CHG: constant(uint256) = 12500 * 10**14`
pub const MAX_P_O_CHG: U256 = U256from_limbs;
/// Dead shares constant for initial band deposits.
///
/// `constants.vy`: `DEAD_SHARES: constant(uint256) = 1000`
pub const DEAD_SHARES: U256 = U256from_limbs;