Skip to content

Commit

Permalink
cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
mvines committed Jun 10, 2024
1 parent 225c5f0 commit b0a485e
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/bin/sys-lend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1340,10 +1340,11 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
}
}
Command::Rebalance => {
let msg_prefix = format!("Rebalance of {} from {withdraw_pool} ({withdraw_pool_apy:.2}% -> {simulation_withdraw_pool_apy:.2}%) \
to {deposit_pool} ({deposit_pool_apy:.2}% -> {simulation_deposit_pool_apy:.2}%)",
maybe_token.format_amount(amount)
);
let msg_prefix = format!("Rebalance of {} from \
{withdraw_pool} ({withdraw_pool_apy:.2}% -> {simulation_withdraw_pool_apy:.2}%) \
to {deposit_pool} ({deposit_pool_apy:.2}% -> {simulation_deposit_pool_apy:.2}%)",
maybe_token.format_amount(amount)
);

if simulation_apy_improvement_bps < minimum_apy_bps as isize {
(
Expand All @@ -1355,13 +1356,13 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
)
} else if amount < minimum_amount {
(
format!(
"Will not rebalance. {} is less than the minimum rebalance amount of {}",
maybe_token.format_amount(amount),
maybe_token.format_amount(minimum_amount)
),
false
)
format!(
"Will not rebalance. {} is less than the minimum rebalance amount of {}",
maybe_token.format_amount(amount),
maybe_token.format_amount(minimum_amount)
),
false
)
} else {
(format!("{msg_prefix} for an additional {simulation_apy_improvement_bps}bps"), true)
}
Expand Down

0 comments on commit b0a485e

Please sign in to comment.