calculate_currency_exchange
Convert currencies with bank margin fees: computes mid-market value, amount after margin, and fees lost. Enter amount and source/target rates vs USD.
Instructions
Calculate currency exchange with bank margin and show fees lost. Returns: {amount_source, from_rate_vs_usd, to_rate_vs_usd, mid_market_amount, amount_after_margin, fees_lost, ...}. See list_bundles for related 'voyage' calculators.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to exchange in source currency | |
| from_rate | Yes | Source currency rate vs USD (e.g. EUR=1.08) | |
| to_rate | Yes | Target currency rate vs USD (e.g. JPY=150) | |
| bank_margin_pct | No | Bank/exchange margin percentage (default 2.5%) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | No | Computed result. Object whose fields depend on the tool (e.g. {tax, marginal_rate, brackets} for tax tools, {volume_l, gallons} for volume tools). | |
| formula | No | Human-readable formula or method used (e.g. "I=P·r·t", "Magnus formula"). | |
| source | No | Authoritative source for the rule or formula (e.g. "Article 197 CGI", "NF DTU 21"). | |
| reference_url | No | Link to a calcul2 page documenting the calculation in detail. |