Skip to content

Commit 4fe469d

Browse files
committed
fixup! fixup! wip: skeleton for _strategy
1 parent 9192f6f commit 4fe469d

File tree

1 file changed

+10
-15
lines changed
  • discretionary_engine_strategy/src

1 file changed

+10
-15
lines changed

discretionary_engine_strategy/src/main.rs

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ struct SubmitArgs {
3939
//TODO!!!: allow providing a more precise primitive here (eg with Market, or with Market and Exchange); in which case it should understand that we want to skip engine suggestions for those, and for it to just accept the defined part of selection.
4040
#[arg(short, long)]
4141
coin: String,
42-
/// acquisition protocols parameters, in the format of "<protocol>-<params>", e.g. "ts:p0.5". Params consist of their starting letter followed by the value, e.g. "p0.5" for 0.5% offset. If multiple params are required, they are separated by '-'.
42+
/// protocols parameters, in the format of "<protocol>-<params>", e.g. "ts:p0.5".
43+
/// Params consist of their starting letter followed by the value, e.g. "p0.5" for 0.5% offset. If multiple params are required, they are separated by '-'.
44+
/// For more info, reference [CompactFormat](v_utils::macros::CompactFormat)
4345
#[arg(short, long)]
44-
acquisition_protocols: Vec<String>,
45-
/// followup protocols parameters, in the format of "<protocol>-<params>", e.g. "ts:p0.5". Params consist of their starting letter followed by the value, e.g. "p0.5" for 0.5% offset. If multiple params are required, they are separated by '-'.
46-
#[arg(short, long)]
47-
followup_protocols: Vec<String>,
46+
protocols: Vec<String>,
4847
}
4948

5049
#[derive(Args, Clone, Debug)]
@@ -64,11 +63,8 @@ fn build_cli_string(args: &SubmitArgs, testnet: bool) -> String {
6463
parts.push(format!("-s {}", args.size_usdt));
6564
parts.push(format!("-c {}", args.coin));
6665

67-
for proto in &args.acquisition_protocols {
68-
parts.push(format!("-a {proto}"));
69-
}
70-
for proto in &args.followup_protocols {
71-
parts.push(format!("-f {proto}"));
66+
for p in &args.protocols {
67+
parts.push(format!("-a {p}"));
7268
}
7369

7470
parts.join(" ")
@@ -99,15 +95,15 @@ async fn main() -> Result<()> {
9995
result = subscriber.next() => {
10096
match result {
10197
Ok(Some((id, cmd))) => {
102-
info!("Received command [{}]: {}", id, cmd);
98+
info!("Received command [{id}]: {cmd}");
10399
// TODO: Parse and forward to Nautilus Actor
104-
println!("[STRATEGY] Received: {}", cmd);
100+
println!("[STRATEGY] Received: {cmd}");
105101
}
106102
Ok(None) => {
107103
// Timeout, continue waiting
108104
}
109105
Err(e) => {
110-
tracing::error!("Error reading command: {}", e);
106+
tracing::error!("Error reading command: {e}");
111107
}
112108
}
113109
}
@@ -120,8 +116,7 @@ async fn main() -> Result<()> {
120116
}
121117
Commands::Submit(args) => {
122118
// Validate protocols first
123-
let _acquisition_protocols = interpret_protocol_specs(args.acquisition_protocols.clone()).wrap_err("Invalid acquisition protocols")?;
124-
let _followup_protocols = interpret_protocol_specs(args.followup_protocols.clone()).wrap_err("Invalid followup protocols")?;
119+
let _protocols = interpret_protocol_specs(args.protocols.clone()).wrap_err("Invalid protocols")?;
125120

126121
// Build CLI string and publish to Redis
127122
let cli_string = build_cli_string(&args, cli.testnet);

0 commit comments

Comments
 (0)