Projects / Bank Stats

Bank Stats

COMPLETE

Project Summary

A RuneLite plugin to track the fluctuation of value of all items you own over time. QoL features such as hyper fast real time market data lookup, charts, and batch item overviews. Supports data export and hotkeys.

Architecture Overview

  • Controller-led plugin boundary: Keep the RuneLite plugin entry point focused on lifecycle hooks, event subscriptions, toolbar registration, and hotkeys, while a central controller coordinates bank capture, pricing, analysis, persistence, and UI updates. Core capabilities sit behind injected interfaces, reducing framework coupling and keeping implementations replaceable.
  • Canonical snapshot-based analysis: Read bank data on RuneLite’s client thread, discard placeholders, canonicalize item variants, and merge stack quantities into an immutable snapshot. The analyzer compares the union of baseline and current holdings, using explicit price statuses so missing market data is not silently treated as a valid zero-value item.
  • Adaptive cost-basis baselines: Store named baselines as per-item quantities and unit costs while preserving the original total bank value. When holdings change, retain the existing cost for reduced positions, remove exited positions, initialize new items at their current price, and calculate a weighted-average cost for additional quantities.
  • Thread-aware asynchronous workflow: Keep RuneLite API access on the client thread, perform remote market requests with CompletableFuture, and marshal Swing updates onto the event-dispatch thread. Monotonic generation IDs invalidate callbacks from superseded loads or profile changes, preventing stale asynchronous results from overwriting newer state.
  • Specialized market-data paths: Use a pluggable provider and valuation policy for bank calculations while keeping live item lookup and historical charting in separate API clients. Search results and historical requests are cached, failed futures are evicted for retry, and range-specific filtering and sampling prevent raw market history from overwhelming the chart UI.
  • Versioned local multi-baseline storage: Persist each named baseline as a schema-versioned JSON file inside RuneLite’s data directory instead of introducing an external database. The synchronized repository validates filenames, rejects duplicates and unsupported versions, migrates legacy configuration data, and resolves the selected baseline through explicit default and most-recent fallbacks.

Screenshots

Use the arrows to browse, then select a screenshot to enlarge it.