Skip to content

Conversation

@Voxsylvae
Copy link
Contributor

@Voxsylvae Voxsylvae commented Aug 9, 2025

Overview

Enhancement to Rs2GrandExchange utility with more market data retrieval and advanced offer management capabilities.

Key Features Added

Real-Time Market Data

  • OSRS Wiki API Integration: Primary source for current market prices
  • GE Tracker Fallback: Backup price source for reliability
  • Price Caching: 1-minute cache duration to reduce API calls
  • Adaptive Pricing: Smart price calculations based on market conditions and retry attempts

Time-Series Analysis

  • Historical Data: Fetch price history with configurable intervals (5m, 1h, 6h, 24h)
  • Statistical Analysis: Price volatility, volume stability, and market health indicators
  • Smart Recommendations: Algorithm-driven buy/sell price suggestions
  • Wait Time Estimation: Predict order completion times based on market activity

Enhanced Offer Management

  • Slot-Based Operations: Direct slot manipulation and monitoring
  • Offer Discovery: Find offers by item ID or name across all slots
  • Quantity Tracking: Precise tracking of bought/sold quantities
  • Collection Management: Enhanced collection with quantity verification
  • State Analysis: Comprehensive offer state and progress tracking

Technical Improvements

  • Proper Logging: Added @Slf4j with structured error reporting
  • Null Safety: Comprehensive null checks and error handling
  • Method Fixes: Corrected Rs2Bank.useBank()Rs2Bank.openBank()

New Model Classes

Class Purpose
GrandExchangeOfferDetails Comprehensive offer state and progress tracking
TimeSeriesAnalysis Statistical analysis of historical market data
ItemMappingData Item metadata including trade limits and alch values
TimeSeriesDataPoint Individual price/volume data points
TimeSeriesInterval Time interval enums for API calls
WikiPrice Cached price data with expiration handling

API Methods Added

Market Data

  • getRealTimePrices(itemId) - Current market prices with caching
  • getTimeSeriesData(itemId, interval) - Historical price analysis
  • getAdaptiveBuyPrice(itemId, basePercentage, retryAttempt) - Smart buy pricing
  • getAdaptiveSellPrice(itemId, basePercentage, retryAttempt) - Smart sell pricing
  • getItemMappingData(itemId) - Item metadata and trade limits

Offer Management

  • findSlotForItem(itemId/itemName, isSelling) - Locate offers by item
  • getOfferDetails(slot) - Detailed offer information
  • collectOffer(slot, toBank) - Slot-specific collection
  • getItemsBoughtFromOffer(slot) / getItemsSoldFromOffer(slot) - Quantity tracking
  • getCompletedOffers() - Find all ready-to-collect offers
  • collectOfferAndGetQuantity(slot, toBank, itemId) - Collection with quantity return

Files Changed

  • Rs2GrandExchange.java - Core enhancements (+1180 lines)
  • 6 new model classes in models/ package (+185 lines)

Total: 7 files changed, 1,185 insertions, 5 deletions

…nced offer management

Major Enhancements:
- Real-time price integration via OSRS Wiki API with GE Tracker fallback
- Time-series market analysis with configurable intervals (5m, 1h, 6h, 24h)
- Item mapping data including trade limits and alch values
- Adaptive pricing algorithms based on market conditions and retry attempts
- Enhanced offer management with slot-based operations
- Comprehensive offer tracking and collection methods

New Features:
- getRealTimePrices(): Cached real-time market prices
- getTimeSeriesData(): Historical price analysis
- getAdaptiveBuyPrice()/getAdaptiveSellPrice(): Smart pricing with retries
- findSlotForItem(): Locate offers by item ID/name
- getOfferDetails(): Detailed offer information
- collectOfferAndGetQuantity(): Track collected item quantities
- getCompletedOffers(): Find all ready-to-collect offers

New Model Classes:
- GrandExchangeOfferDetails: Comprehensive offer state tracking
- TimeSeriesAnalysis: Statistical market data analysis
- ItemMappingData: Item metadata with trade limits
- TimeSeriesDataPoint/Interval: Historical data structures
- WikiPrice: Cached price data with expiration

Bug Fixes:
- Fixed Rs2Bank.useBank() -> Rs2Bank.openBank() method call
- Improved error handling and null checks in collectOffer()
- Added @slf4j logging throughout

This enhancement significantly improves Grand Exchange automation capabilities with professional-grade market data analysis and reliable offer management.
@Voxsylvae Voxsylvae force-pushed the feat/grand-exchange-enhanced-api branch from 26ef19e to fd53599 Compare August 9, 2025 10:53
@gmason0 gmason0 merged commit ac00347 into chsami:development Aug 10, 2025
1 check passed
@Voxsylvae Voxsylvae deleted the feat/grand-exchange-enhanced-api branch August 10, 2025 04:12
@chsami chsami mentioned this pull request Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants