Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt

Use this file to discover all available pages before exploring further.

Use the Fee Calculator in the Midaz Module to estimate fee calculations before processing real Transactions. The estimator is read-only — it does not create a Transaction or touch any Ledger balance.

Before you start


  • The Fees Engine plugin must be enabled in Midaz module settings.
  • You need at least one Fee Package saved.
  • You need the source and destination Account aliases you want to test against.

Running an estimation


1
In the Midaz Module sidebar, expand Fees Engine and click Calculator.
2
Fill in the estimated transaction. See the Field guide below for each input.
3
Click Calculate Fees to run the estimation.
4
Review the results displayed below the form.

Field guide


FieldWhat to enterExample
Transaction AmountTotal value to estimate fees against.100.00
CurrencyAsset code for the estimated transaction.BRL
Fee PackageFee Package to test.Standard Transfer Fee
From AccountAccount alias that would be debited.@customer_123
To AccountAccount alias that would be credited.@merchant_456
DescriptionOptional description for the estimation.Pix transfer test
The Fee Calculator is a read-only tool. It does not affect the ledger or create any transactions. You can run as many estimations as needed safely.

Understanding the results


After running an estimation, you’ll see a detailed breakdown of how fees are calculated:

Summary

  • Total Fee - The combined amount of all fees that would be charged
  • Net Amount - The amount the destination would receive after deductible fees

Fee breakdown

For each fee rule applied, you’ll see:
FieldDescription
Fee LabelName identifying the fee
PriorityOrder in which the fee was applied
Calculation Typeflat or percentage
Reference AmountThe base amount used for calculation
Calculated AmountThe actual fee value
Credit AccountAccount that would receive the fee
Is DeductibleWhether the fee is deducted from the transaction

Estimation examples


Scenario: Test a $2.00 flat fee on a $100 transferInput:
  • Fee Package: Standard Transfer Fee
  • Asset: USD
  • Amount: 100.00
  • Source: @customer/checking
  • Destination: @merchant/revenue
Expected Result:
  • Total Fee: $2.00
  • Net Amount: $98.00 (if deductible) or $100.00 (if not deductible)
Scenario: Test a 1.5% fee on a $500 transferInput:
  • Fee Package: Percentage Transaction Fee
  • Asset: USD
  • Amount: 500.00
  • Source: @customer/savings
  • Destination: @vendor/payments
Expected Result:
  • Total Fee: $7.50 (1.5% of $500)
  • Calculation: 500 × 0.015 = 7.50
Scenario: Test max(flat, percentage) fee on different amountsTest 1 - Small transaction ($30):
  • Flat: $1.00
  • Percentage: 2% = $0.60
  • Result: $1.00 (flat is higher)
Test 2 - Large transaction ($200):
  • Flat: $1.00
  • Percentage: 2% = $4.00
  • Result: $4.00 (percentage is higher)
Scenario: Package with two fees applied in priority orderFee A (Priority 1): 1% on original amount Fee B (Priority 2): 0.5% on after fees amountInput: $1000 transactionExpected Result:
  • Fee A: $10.00 (1% of $1000)
  • Fee B: $4.95 (0.5% of $990)
  • Total Fee: $14.95

Use cases for fee estimation


Validate new fee packages

Before enabling a new fee package, run estimations with various transaction amounts to ensure fees are calculated correctly across the entire amount range.

Test edge cases

Estimate transactions at minimum and maximum amount boundaries to verify fee behavior at the limits of your configured ranges.

Compare fee structures

Run the same transaction through different fee packages to compare outcomes and choose the best structure for your use case.

Document expected fees

Use simulation results to create documentation for your finance team or customers about expected fee amounts.

Debug fee issues

If transactions are showing unexpected fees, use the estimator to reproduce the scenario and understand the calculation breakdown.

Best practices


  • Test full amount ranges - Don’t just test one amount; estimate transactions at minimum, maximum, and several points in between.
  • Verify priority ordering - When packages have multiple fees, confirm they apply in the expected order.
  • Check waived accounts - Test with accounts that should be waived to confirm they’re excluded from fees.
  • Document your tests - Keep a record of estimation results for audit and compliance purposes.
  • Share with stakeholders - Use estimation breakdowns to align with finance teams on expected fee outcomes before going live.

What to do next


After validating the fee result, adjust the Fee Package if needed in Editing a Fee Package, or create a real Transaction in Creating a Transaction.