Merge pull request #1673 from comit-network/bob-extensive-quote-log

feat (Bob): Log extensive information about deposit requirements
This commit is contained in:
Byron Hambly 2024-06-07 09:41:43 +02:00 committed by GitHub
commit 9594b0c46b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -882,19 +882,24 @@ where
loop { loop {
let min_outstanding = bid_quote.min_quantity - max_giveable; let min_outstanding = bid_quote.min_quantity - max_giveable;
let min_fee = estimate_fee(min_outstanding).await?; let min_bitcoin_lock_tx_fee = estimate_fee(min_outstanding).await?;
let min_deposit = min_outstanding + min_fee; let min_deposit_until_swap_will_start = min_outstanding + min_bitcoin_lock_tx_fee;
let max_deposit_until_maximum_amount_is_reached =
maximum_amount - max_giveable + min_bitcoin_lock_tx_fee;
tracing::info!( tracing::info!(
"Deposit at least {} to cover the min quantity with fee!", "Deposit at least {} to cover the min quantity with fee!",
min_deposit min_deposit_until_swap_will_start
); );
tracing::info!( tracing::info!(
%deposit_address, %deposit_address,
%min_deposit, %min_deposit_until_swap_will_start,
%max_deposit_until_maximum_amount_is_reached,
%max_giveable, %max_giveable,
%minimum_amount, %minimum_amount,
%maximum_amount, %maximum_amount,
%min_bitcoin_lock_tx_fee,
price = %bid_quote.price,
"Waiting for Bitcoin deposit", "Waiting for Bitcoin deposit",
); );
@ -913,7 +918,7 @@ where
tracing::info!(%new_balance, %max_giveable, "Received Bitcoin"); tracing::info!(%new_balance, %max_giveable, "Received Bitcoin");
if max_giveable < bid_quote.min_quantity { if max_giveable < bid_quote.min_quantity {
tracing::info!("Deposited amount is less than `min_quantity`"); tracing::info!("Deposited amount is not enough to cover `min_quantity` when accounting for network fees");
continue; continue;
} }