optimalized parameters

This commit is contained in:
2025-12-15 09:33:32 +01:00
parent b85fcb8246
commit 109ef7cd24
3 changed files with 196 additions and 26 deletions

View File

@ -644,6 +644,11 @@ def main():
unclaimed0 = from_wei(fees_sim[0], pos_details['token0_decimals'])
unclaimed1 = from_wei(fees_sim[1], pos_details['token1_decimals'])
except: pass
# Calculate Total Fee Value in Token1 (USDC)
# Get Current Price from Pool Data
current_price = price_from_sqrt_price_x96(pool_data['sqrtPriceX96'], pos_details['token0_decimals'], pos_details['token1_decimals'])
total_fees_usd = (unclaimed0 * current_price) + unclaimed1
# Check Range
is_out_of_range = False
@ -657,7 +662,7 @@ def main():
print(f"\nID: {token_id} | Type: {pos_type} | Status: {status_str}")
print(f" Range: {position['range_lower']:.2f} - {position['range_upper']:.2f}")
print(f" Fees: {unclaimed0:.4f} {pos_details['token0_symbol']} / {unclaimed1:.4f} {pos_details['token1_symbol']}")
print(f" Fees: {unclaimed0:.4f} {pos_details['token0_symbol']} / {unclaimed1:.4f} {pos_details['token1_symbol']} (~${total_fees_usd:.2f})")
# --- AUTO CLOSE LOGIC (AUTOMATIC ONLY) ---
if pos_type == 'AUTOMATIC' and CLOSE_POSITION_ENABLED and is_out_of_range: