Enhance logging for insufficient funds in clp_manager.py
This commit is contained in:
@ -512,7 +512,16 @@ def check_and_swap_for_deposit(w3: Web3, router_contract, account: LocalAccount,
|
||||
logger.warning(f"⚠️ Swap executed but still short? T0: {bal0}/{amount0_needed}, T1: {bal1}/{amount1_needed}")
|
||||
return False
|
||||
|
||||
logger.warning(f"❌ Insufficient funds (No suitable swap found). T0: {bal0}/{amount0_needed}, T1: {bal1}/{amount1_needed}")
|
||||
# Human-readable format
|
||||
f_bal0 = Decimal(bal0) / Decimal(10**d0)
|
||||
f_need0 = Decimal(amount0_needed) / Decimal(10**d0)
|
||||
f_bal1 = Decimal(bal1) / Decimal(10**d1)
|
||||
f_need1 = Decimal(amount1_needed) / Decimal(10**d1)
|
||||
|
||||
tgt_inv = CONFIG.get("TARGET_INVESTMENT_AMOUNT", "N/A")
|
||||
range_w = CONFIG.get("RANGE_WIDTH_PCT", "N/A")
|
||||
|
||||
logger.warning(f"❌ Insufficient funds. Settings: [Target=${tgt_inv}, Range={range_w}]. Wallet: T0: {f_bal0:.4f} / {f_need0:.4f}, T1: {f_bal1:.4f} / {f_need1:.4f}")
|
||||
return False
|
||||
|
||||
def mint_new_position(w3: Web3, npm_contract, account: LocalAccount, token0: str, token1: str, amount0: int, amount1: int, tick_lower: int, tick_upper: int, d0: int, d1: int) -> Optional[Dict]:
|
||||
|
||||
Reference in New Issue
Block a user