This is a web application that provides the conversion of currency values and finds possible arbitrage paths between three currencies. The application fetches live exchange rates using the Exchange Rates API and shows conversion results together with the best arbitrage opportunities.
- Currency Conversion: Converts a given amount from a starting currency to a final currency using live exchange rates.
- Arbitrage Finder: Identifies and displays the top three arbitrage paths involving an intermediate currency for maximizing potential profits.
- Frontend: HTML, CSS, and JavaScript
- API: Exchange Rates API
- A modern web browser.
- A valid API key for the Exchange Rates API. Replace
API_URLwith your API key in the following format:const API_URL = 'https://v6.exchangerate-api.com/v6/YOUR_API_KEY/latest/';
- Clone or download the repository.
- Open the
index.htmlfile in a web browser. - Enter the required details:
- Starting currency.
- Final currency.
- Amount.
- Click the "Submit" button.
- The results will display:
- Converted amount.
- Top 3 arbitrage paths.
- index.html: Contains the HTML structure for the app.
- style.css: Provides styling for the application.
- script.js: Implements the logic for fetching data, converting currency, and finding arbitrage paths.
Finds the top three arbitrage paths for a given currency conversion scenario.
- Parameters:
conversion_rates: Object containing exchange rates for the starting currency.starting_currency: The base currency code (e.g., USD).final_currency: The target currency code (e.g., EUR).amount: The amount to convert.
- Output:
- Updates the DOM with the top three arbitrage paths.
- Fetches live exchange rates for the starting currency.
- Converts the amount and displays the result.
- Invokes
find_best_routeto calculate arbitrage opportunities.
- Validates user inputs (e.g., non-empty fields and valid amount).
- Catches and logs errors during API calls.
- Alerts the user if there is an issue with fetching exchange rates.
- Starting Currency:
USD - Final Currency:
EUR - Amount:
100
- Conversion Result:
100 USD = 85.00 EUR - Best Paths:
USD → GBP → EUR: 86.50 EURUSD → CAD → EUR: 85.90 EURUSD → AUD → EUR: 85.30 EUR
- Requires an active internet connection to fetch live exchange rates.
- Limited by the API’s rate limits and accuracy.
This project is licensed under the MIT License.
- Exchange Rates API for providing exchange rate data.
- Flaticon for providing icons and images used.
- For educational purposes only. Content and images belong to their respective owners.