-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
77 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,56 @@ | ||
use alloy::primitives::U256; | ||
|
||
use super::*; | ||
|
||
/// Configuration for the simulation. | ||
pub struct Config { | ||
/// Number of steps to run the simulation for. | ||
pub steps: usize, | ||
|
||
/// Pool manager fee. | ||
pub fee: U256, | ||
pub manager_fee: U256, | ||
|
||
/// Pool tick spacing. | ||
pub tick_spacing: Signed<24, 1>, | ||
|
||
/// Pool hook data. | ||
pub hook_data: Bytes, | ||
|
||
/// Pool sqrt price x96. | ||
pub sqrt_price_x96: Uint<160, 3>, | ||
|
||
/// Pool fee. | ||
pub pool_fee: Uint<24, 1>, | ||
|
||
/// Initial price. | ||
pub initial_price: U256, | ||
|
||
/// Pool hooks. | ||
pub hooks: Address, | ||
} | ||
|
||
impl Config { | ||
/// Public constructor function for a new [`Config`]. | ||
pub fn new(fee: U256, steps: usize) -> Self { | ||
Config { steps, fee } | ||
#[allow(clippy::too_many_arguments)] | ||
pub fn new( | ||
steps: usize, | ||
manager_fee: U256, | ||
tick_spacing: Signed<24, 1>, | ||
hook_data: Bytes, | ||
sqrt_price_x96: Uint<160, 3>, | ||
pool_fee: Uint<24, 1>, | ||
initial_price: U256, | ||
hooks: Address, | ||
) -> Self { | ||
Self { | ||
steps, | ||
manager_fee, | ||
tick_spacing, | ||
hook_data, | ||
sqrt_price_x96, | ||
pool_fee, | ||
initial_price, | ||
hooks, | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters