Skip to content

falleng0d/PoE2-Arbitrage-Calculator

Repository files navigation

Path of Exile 2 Arbitrage Calculator

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.

πŸ“ Folder Structure

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

πŸ› οΈ Main Dependencies and Technologies

Core Technologies

  • 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

UI Framework & Styling

  • 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

Form Management & Validation

  • React Hook Form - Form handling with minimal re-renders
  • Zod - Schema validation library
  • Hookform Resolvers - Form validation integration

Development Tools

  • ESLint - Code linting and style enforcement
  • Vitest - Unit testing framework
  • PostCSS - CSS processing and optimization
  • TypeScript Project References - Modular TypeScript configuration

✨ Main Features

🏦 Currency Management

  • 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

βš–οΈ Rate Configuration

  • 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

rates.png

πŸ“Š Arbitrage Dashboard

  • 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

opportunities.png

🎯 Trading Path Optimization

  • 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

πŸ’Ύ Data Persistence

  • 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

🎨 User Experience

  • 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

πŸ”§ Advanced Features

  • 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

πŸ—οΈ Component Architecture

The application follows a modular component architecture with clear separation of concerns:

Main Components

  • 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

App-Specific Components (src/components/app/)

  • 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

UI Components (src/components/ui/)

Built on shadcn/ui and Radix UI primitives, providing consistent and accessible interface elements.

πŸš€ Getting Started

  1. Install Dependencies

    npm install
  2. Start Development Server

    npm run dev
  3. Build for Production

    npm run build
  4. 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

πŸ“ˆ How It Works

  1. Setup Currencies: Add the Path of Exile 2 currencies you want to trade
  2. Configure Rates: Input the current market conversion rates between currencies
  3. Find Opportunities: The calculator automatically identifies profitable arbitrage paths
  4. 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.

Author

Mateus Junior (juniormateusknd@gmail.com)

License

This project is licensed under the MIT License.

About

A powerful React PWA arbitrage calculator for Path of Exile 2

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors