Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,27 @@ impl Config {
),
_ => {}
}
let grt_wei = self.tap.max_amount_willing_to_lose_grt.get_value();
let decimal = BigDecimal::from_u128(grt_wei).unwrap();
let divisor = &self.tap.rav_request.trigger_value_divisor;
let trigger_value = (decimal / divisor)
.to_u128()
.expect("Could not represent the trigger value in u128");
let minimum_recommended_for_max_willing_to_lose_grt = 0.1;
if trigger_value
< minimum_recommended_for_max_willing_to_lose_grt
.to_u128()
.unwrap()
{
warn!(
"Trigger value is too low, currently below 0.1 GRT. \
Please modify `max_amount_willing_to_lose_grt` or `trigger_value_divisor`. \
It is best to have a higher trigger value, ideally above 1 GRT. \
Anything lower and the system may constantly deny the sender. \
`Trigger value` is defined by: \
(max_amount_willing_to_lose_grt / trigger_value_divisor) "
)
}

let ten: BigDecimal = 10.into();
let usual_grt_price = BigDecimal::from_str("0.0001").unwrap() * ten;
Expand Down
Loading