kabu_strategy_backrun/backrun_config.rs
1use alloy_primitives::Address;
2use kabu_types_entities::strategy_config::StrategyConfig;
3use serde::Deserialize;
4
5#[derive(Clone, Deserialize, Debug)]
6pub struct BackrunConfigSection {
7 pub backrun_strategy: BackrunConfig,
8}
9
10#[derive(Clone, Deserialize, Debug)]
11pub struct BackrunConfig {
12 eoa: Option<Address>,
13 smart: bool,
14}
15
16impl StrategyConfig for BackrunConfig {
17 fn eoa(&self) -> Option<Address> {
18 self.eoa
19 }
20}
21
22impl BackrunConfig {
23 pub fn smart(&self) -> bool {
24 self.smart
25 }
26
27 pub fn new_dumb() -> Self {
28 Self { eoa: None, smart: false }
29 }
30}
31
32impl Default for BackrunConfig {
33 fn default() -> Self {
34 Self { eoa: None, smart: true }
35 }
36}