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
use Result;
use Decimal;
use crateCurrency;
/// Base trait for pool operations that provides common price and tick/bin
/// conversion methods
///
/// This trait provides a unified interface for converting between prices and
/// tick/bin indices across different pool protocols (Whirlpool, Raydium CLMM,
/// Meteora DLMM, etc.).
///
/// For protocols that use ticks (Whirlpool, Raydium CLMM), the methods convert
/// between price and tick index. For protocols that use bins (Meteora DLMM),
/// the methods convert between price and bin ID.