Skip to content

TODO: Implement real fee calculation in melt() #23

@shroominic

Description

@shroominic

TODO Location

sixty_nuts/wallet.py:634

Priority

🟡 Medium Priority - Important for preventing failed transactions

Current Code

fee_reserve = melt_quote.get("fee_reserve", 0)
total_needed = invoice_amount + fee_reserve
# TODO: check if we have enough balance in the target mint with real fee calculation

What needs to be done

  • Calculate actual fees including both Lightning fees and mint input fees
  • Verify sufficient balance exists after accounting for all fees
  • Prevent failed melts due to insufficient balance

Implementation

  1. Calculate mint input fees using calculate_total_input_fees()
  2. Add Lightning fee reserve from melt quote
  3. Verify balance covers amount + all fees
  4. Trigger rebalancing if needed

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions