Match amounts (FX drift)
match_amounts_with_fx_driftCompare two currency amounts using an exchange rate and verify if their percentage difference falls within a specified FX drift tolerance for cross-currency reconciliation.
Instructions
Compare two amounts in different currencies within an FX drift tolerance.
Purpose: Converts currency amounts using a provided exchange rate and verifies if the percentage difference falls within an acceptable tolerance window using exact decimal arithmetic.
When to use:
When reconciling cross-currency payments with conversion timing or rate variance.
When evaluating FX tolerance bounds on cross-border transactions.
When NOT to use:
Do NOT use for same-currency comparisons where standard tolerance applies; use reconcile.
Do NOT use with non-positive FX rates.
Behavioral transparency: Pure mathematical calculation; read-only and idempotent.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fx_rate | Yes | Units of currency_a per one unit of currency_b (e.g. an EUR/USD quote of 1.08 is USD per EUR). | |
| amount_a | Yes | Amount denominated in currency_a. | |
| amount_b | Yes | Amount denominated in currency_b. | |
| currency_a | Yes | ISO 4217 code of amount_a. | |
| currency_b | Yes | ISO 4217 code of amount_b. | |
| tolerance_pct | No | Max percentage difference still counted as a match. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||