Apply cargo formatter
This commit is contained in:
parent
f9c6f0dce1
commit
0779d3794f
|
|
@ -43,7 +43,8 @@ pub async fn set_unit_usdt() {
|
||||||
&& asset_info.current_total_usdt < dec!(2000.0)
|
&& asset_info.current_total_usdt < dec!(2000.0)
|
||||||
{
|
{
|
||||||
// set_unit_trade_usdt = dec!(150.0); // $150 for each trade
|
// set_unit_trade_usdt = dec!(150.0); // $150 for each trade
|
||||||
set_unit_trade_usdt = decimal_mul(asset_info.current_total_usdt, dec!(0.1)); // 10% of total usdt
|
set_unit_trade_usdt = decimal_mul(asset_info.current_total_usdt, dec!(0.1));
|
||||||
|
// 10% of total usdt
|
||||||
} else if dec!(2000.0) <= asset_info.current_total_usdt
|
} else if dec!(2000.0) <= asset_info.current_total_usdt
|
||||||
&& asset_info.current_total_usdt < dec!(5000.0)
|
&& asset_info.current_total_usdt < dec!(5000.0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ use reqwest::{Client, ClientBuilder};
|
||||||
use rust_decimal::{prelude::FromPrimitive, prelude::ToPrimitive, Decimal, RoundingStrategy};
|
use rust_decimal::{prelude::FromPrimitive, prelude::ToPrimitive, Decimal, RoundingStrategy};
|
||||||
use rust_decimal_macros::dec;
|
use rust_decimal_macros::dec;
|
||||||
use sqlx::FromRow;
|
use sqlx::FromRow;
|
||||||
use std::{io, io::Write, process::Stdio, path::Path};
|
use std::{io, io::Write, path::Path, process::Stdio};
|
||||||
use tokio::{fs::*, io::ErrorKind, process::Command, task::JoinHandle, time::*};
|
use tokio::{fs::*, io::ErrorKind, process::Command, task::JoinHandle, time::*};
|
||||||
|
|
||||||
const STRATEGIST_NUMBER: u32 = 16;
|
const STRATEGIST_NUMBER: u32 = 16;
|
||||||
|
|
@ -36,10 +36,10 @@ async fn initialize_webdriver() {
|
||||||
match os_type {
|
match os_type {
|
||||||
"linux" => {
|
"linux" => {
|
||||||
chrome_webdriver_path.push("chromedriver");
|
chrome_webdriver_path.push("chromedriver");
|
||||||
},
|
}
|
||||||
"windows" => {
|
"windows" => {
|
||||||
chrome_webdriver_path.push("chromedriver.exe");
|
chrome_webdriver_path.push("chromedriver.exe");
|
||||||
},
|
}
|
||||||
_ => {
|
_ => {
|
||||||
eprintln!("\ntradingbot supports only Linux and Windows.");
|
eprintln!("\ntradingbot supports only Linux and Windows.");
|
||||||
panic!();
|
panic!();
|
||||||
|
|
@ -47,7 +47,10 @@ async fn initialize_webdriver() {
|
||||||
}
|
}
|
||||||
|
|
||||||
if !chrome_webdriver_path.exists() {
|
if !chrome_webdriver_path.exists() {
|
||||||
eprintln!("\nCheck if there is chromedriver.exe ({})", chrome_webdriver_path.to_str().unwrap());
|
eprintln!(
|
||||||
|
"\nCheck if there is chromedriver.exe ({})",
|
||||||
|
chrome_webdriver_path.to_str().unwrap()
|
||||||
|
);
|
||||||
panic!();
|
panic!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user