arena_core/
config.rs

1use alloy::primitives::U256;
2
3use super::*;
4
5/// Configuration for the simulation.
6pub struct Config {
7    /// Number of steps to run the simulation for.
8    pub steps: usize,
9
10    /// Pool manager fee.
11    pub manager_fee: U256,
12
13    /// Pool tick spacing.
14    pub tick_spacing: Signed<24, 1>,
15
16    /// Pool hook data.
17    pub hook_data: Bytes,
18
19    /// Pool sqrt price x96.
20    pub sqrt_price_x96: Uint<160, 3>,
21
22    /// Pool fee.
23    pub pool_fee: Uint<24, 1>,
24
25    /// Initial price.
26    pub initial_price: U256,
27
28    /// Pool hooks.
29    pub hooks: Address,
30}
31
32impl Config {
33    /// Public constructor function for a new [`Config`].
34    #[allow(clippy::too_many_arguments)]
35    pub fn new(
36        steps: usize,
37        manager_fee: U256,
38        tick_spacing: Signed<24, 1>,
39        hook_data: Bytes,
40        sqrt_price_x96: Uint<160, 3>,
41        pool_fee: Uint<24, 1>,
42        initial_price: U256,
43        hooks: Address,
44    ) -> Self {
45        Self {
46            steps,
47            manager_fee,
48            tick_spacing,
49            hook_data,
50            sqrt_price_x96,
51            pool_fee,
52            initial_price,
53            hooks,
54        }
55    }
56}