A web-based arbitrage calculator designed for Path of Exile 2 currency trading. This tool helps players identify profitable trading opportunities by analyzing currency conversion rates and finding optimal trading paths.
arbitrage-calc/
βββ public/ # Static assets
βββ src/
β βββ components/ # React components
β β βββ app/ # Application-specific components
β β β βββ BaseCurrencyFilterSelect.tsx
β β β βββ IconDisplay.tsx
β β β βββ IconPicker.tsx
β β β βββ PrecisionInput.tsx
β β β βββ RiskFilterSelect.tsx
β β β βββ SearchInput.tsx
β β β βββ SortBySelect.tsx
β β β βββ iconConstants.ts
β β βββ ui/ # Reusable UI components (shadcn/ui)
β β βββ ArbitrageDashboard.tsx
β β βββ CurrencyManagement.tsx
β β βββ Navigation.tsx
β β βββ RateConfiguration.tsx
β βββ hooks/ # Custom React hooks
β β βββ use-toast.ts # Toast notification hook
β βββ lib/ # Utility libraries
β β βββ utils.ts # Common utility functions
β βββ types/ # TypeScript type definitions
β β βββ index.ts # Core type definitions
β βββ utils/ # Utility functions and helpers
β β βββ arbitrage.ts # Core arbitrage calculation logic
β β βββ arbitrage.test.ts # Comprehensive test suite
β β βββ storage.ts # Local storage management
β βββ App.tsx # Main application component
β βββ main.tsx # Application entry point
β βββ index.css # Global styles
βββ components.json # shadcn/ui configuration
βββ eslint.config.js # ESLint configuration
βββ package.json # Dependencies and scripts
βββ postcss.config.js # PostCSS configuration
βββ tailwind.config.js # Tailwind CSS configuration
βββ tsconfig.json # TypeScript configuration
βββ tsconfig.app.json # TypeScript app configuration
βββ tsconfig.node.json # TypeScript Node configuration
βββ vite.config.ts # Vite build configuration
- React - Frontend library for building user interfaces
- TypeScript - Type-safe JavaScript superset
- Vite - Fast build tool and development server
- React Router DOM - Client-side routing
- Tailwind CSS - Utility-first CSS framework
- Radix UI - Low-level UI primitives for React
- shadcn/ui - Pre-built component library based on Radix UI
- Lucide React - Icon library
- React Hook Form - Form handling with minimal re-renders
- Zod - Schema validation library
- Hookform Resolvers - Form validation integration
- ESLint - Code linting and style enforcement
- Vitest - Unit testing framework
- PostCSS - CSS processing and optimization
- TypeScript Project References - Modular TypeScript configuration
- Add Custom Currencies: Create and manage Path of Exile 2 currencies with custom icons and gold cost values
- Icon System: Choose from a variety of predefined icons or use custom icons for currencies
- Currency Validation: Ensure all currencies have valid names and gold cost values
- Bulk Operations: Edit, update, and delete currencies with persistent storage
- Interactive Rate Input: Configure conversion rates between any two currencies
- Bidirectional Rates: Set up both directions of currency conversion (AβB and BβA)
- Rate Validation: Real-time validation of conversion rates with visual feedback
- Quantity-Based Input: Input rates using specific quantity ratios (e.g., 5 Currency A = 3 Currency B)
- Rate Statistics: View total valid rates and possible rate combinations
- Opportunity Detection: Automatically identify profitable 3-way arbitrage opportunities
- Advanced Filtering: Filter opportunities by:
- Currency search (find opportunities involving specific currencies)
- Base currency selection (filter by starting currency)
- Risk level (low, medium, high)
- Profit thresholds
- Confidence scores
- Precision Controls: Adjustable precision settings for quantity calculations
- Sorting Options: Sort opportunities by profit, risk, or confidence
- Detailed Analysis: View complete trading paths with:
- Step-by-step conversion quantities
- Profit calculations
- Risk assessments
- Gold cost analysis
- Confidence scores
- Multi-Step Calculations: Calculate optimal quantities for complex trading chains
- Precision Control: Adjustable precision settings for quantity calculations
- Gold Cost Analysis: Factor in gold costs for each currency transaction
- Risk Assessment: Evaluate risk scores based on profit margins and rate volatility
- Local Storage: All currencies and rates are automatically saved to browser storage
- Data Integrity: Automatic cleanup of invalid rates when currencies are deleted
- Session Recovery: Restore previous work when returning to the application
- Modern UI: Clean, responsive design with dark/light theme support
- Real-time Updates: Instant recalculation of opportunities when rates change
- Visual Feedback: Color-coded risk indicators and profit highlights
- Mobile Responsive: Optimized for desktop and mobile usage
- Intuitive Navigation: Clean navigation between different sections
- Rate Matrix Building: Efficient internal representation of currency conversion rates
- Cycle Detection: Identifies profitable circular trading paths
- Confidence Scoring: Algorithmic confidence assessment based on market conditions
- Performance Optimization: Memoized calculations for smooth user experience
- Comprehensive Testing: Full test suite with unit tests for arbitrage calculations
- Modular Architecture: Well-organized component structure with reusable UI elements
The application follows a modular component architecture with clear separation of concerns:
- ArbitrageDashboard: Main dashboard displaying opportunities with filtering and sorting
- CurrencyManagement: Interface for adding, editing, and deleting currencies
- RateConfiguration: Tool for setting up conversion rates between currencies
- Navigation: Application navigation with routing support
- BaseCurrencyFilterSelect: Filter opportunities by base currency
- IconDisplay: Display currency icons with fallback support
- IconPicker: Interactive icon selection interface
- PrecisionInput: Adjustable precision controls for calculations
- RiskFilterSelect: Filter opportunities by risk level
- SearchInput: Search functionality for filtering
- SortBySelect: Sorting options for opportunity lists
Built on shadcn/ui and Radix UI primitives, providing consistent and accessible interface elements.
-
Install Dependencies
npm install
-
Start Development Server
npm run dev
-
Build for Production
npm run build
-
Run Tests
npm run test # Run tests in watch mode npm run test:run # Run tests once npm run test:ui # Run tests with UI interface
- Setup Currencies: Add the Path of Exile 2 currencies you want to trade
- Configure Rates: Input the current market conversion rates between currencies
- Find Opportunities: The calculator automatically identifies profitable arbitrage paths
- Execute Trades: Follow the recommended trading sequence to maximize profits
The calculator uses advanced algorithms to detect triangular arbitrage opportunities, where you can profit by converting through a chain of currencies and ending up with more of your starting currency than you began with.
Mateus Junior (juniormateusknd@gmail.com)
This project is licensed under the MIT License.

