LibPriceCache (v.1.1.0)
LibPriceCache Central Price Library for ESO
Version: 1.1.0 | Author: Hyborem & Grok | Language: English
📦 MAIN FEATURES
Price aggregation collects and averages prices from TTC, MM, ATT, ESO‑Hub, UESP
Own price database stores prices in 4 separate categories (gear, items, consumables, crafting)
UI price override replaces sell values in inventory and guild store
Tooltips shows average and detailed prices in item tooltips
Item scanning automatic queuing and price fetching
API for other addons simple LPC_GetPrice(link) function
đź”§ REQUIREMENTS (mandatory)
LibAddonMenu-2.0
LibSavedVars
LibCustomMenu
📡 RECOMMENDED (for full data)
Tamriel Trade Centre
Master Merchant
Arkadius Trade Tools (ATT)
LibEsoHubPrices
uespLogSalesPrices
Inventory Insight (IIfA)
đź’ˇ DESCRIPTION & USE CASES
LibPriceCache is a lightweight library that collects item prices from popular trading addons (TTC, MM, ATT, ESO‑Hub, UESP), stores them in a centralised database and provides an averaged price. Additionally, it can override the displayed sell prices in the inventory and guild store, and enrich tooltips with market prices.
For regular players: After installing and enabling all recommended trading addons, LibPriceCache will automatically show an averaged market price (and per‑source prices) in item tooltips. You can also enable Override inventory prices in the settings the inventory sell price will then show the calculated market price instead of the vendor price (useful when listing items on a guild store).
For addon developers: The library provides a simple API just call LPC_GetPrice(itemLink) to receive an average price (or nil if no data is available). All internal functions are described in the technical section.
⚙️ CONFIGURATION & OPTIMISATION
First run: Play for a few days with all trading addons (TTC, MM, ATT, ESO‑Hub, UESP) enabled the library will collect item IDs and prices. The more data, the more accurate the calculations.
Quick full‑account scan: Install Inventory Insight (IIfA) and enable Auto‑scan IIfA on login in LPC settings. The library will then scan every item on your account (bank, craft bag, alts) and add them to the price queue.
Manual scanning: Use /lpcscan scans backpack, bank and guild bank and adds items to the queue. /lpcfulldbscan refreshes prices for all items already in the database.
UI price override: Enable Override inventory prices in the settings. You can choose whether to show the stack price, unit price, or both. Sorting by the Value column in the inventory will now use the LPC stack price instead of the vendor price.
Guild store integration: When Override guild store prices is enabled, prices in guild store search results will be replaced with LPC average prices.
🎮 SLASH COMMANDS
/lpcscan quick scan of inventory/bank/guild bank
/lpcfulldbscan full price refresh for all known items
/lpcguildscan scan all guild store listings
/lpcrescan full rescan (IIfA + database + guild store)
/lpcscanii manual IIfA scan
/lpcstatus shows addon status and last scan date
/lpcpo toggles UI price override (requires /reloadui)
🛠️ TECHNICAL SECTION FOR ADDON DEVELOPERS
LibPriceCache is designed as a library it can be used by other addons to retrieve averaged item prices. Below is a description of the architecture and API.
1. Global API function
LPC_GetPrice(itemLink) → number or nil
Returns the weighted average price of an item (weights are taken from user settings). If no data is available or the item is bound, returns nil.
2. Database structure
Data is stored in 4 modules (LPC01LPC04), each as a separate SavedVariable:
LPC01 gear (weapons, armour, jewellery)
LPC02 general items (materials, recipes, motifs)
LPC03 consumables (potions, food, poisons)
LPC04 crafting & collectibles (style materials, upgrade items)
Each module has its own `db.data` table, where the key is `itemKey` (format: `”SERVER:ITEM_ID:CP:QUALITY”`) and the value is a compressed string containing prices for each source. Compression is handled by `LPC_Cache:SerializeItemData` / `DeserializeItemData`.
3. Fetching prices from sources
TTC `TamrielTradeCentrePrice:GetPriceInfo(link)`
MM `MasterMerchant:itemStats(link, false)`
ATT `ArkadiusTradeTools.Modules.Sales:GetAveragePricePerItem(link, fromTimeStamp)`
ESO-Hub `LibEsoHubPrices.GetSimpleItemPrice(link)`
UESP custom function `LPC_Utils:GetUESP(link)` (parses the `uespLog.SalesPrices` structure)
All calls are wrapped in `pcall` for safety. Prices are stored with a timestamp and can be filtered by age (`MaxPriceAgeDays`).
4. Queue & scanning system
LPC_Scanner manages the queue of items to process (`pendingItems`). Each item is unique (by `itemKey`).
LPC_Extensions extends scanning with IIfA, guild store, context menus and chat links.
LPC_Calc calculates weighted averages and formats prices for display.
LPC_PriceOverride overrides UI prices (uses `SecurePostHook` on inventory list `setupCallback` and modifies `slotData.lpcValue` for sorting).
5. Adding a custom price source
To add a new price source:
Add a fetching function in `LPC_Utils.lua` (template: `GetXXX(link)`).
Add entries in `LPC.db` (e.g. `UseXXXPrice`, `Weight_XXX`).
In `LPC_Scanner:ProcessNextPendingItem()` add a conditional block that calls your new function and saves the price using `LPC_Cache:SetPrice(…)`.
Update `LPC_Calc` to include the new source in tooltips and the weighted average.
6. IIfA integration
If `IIfA` is installed and the `AutoScanIIfA` option is enabled, the library will read `IIfA:GetInventoryDB()` after login and add all account‑wide items to the scanning queue. This greatly speeds up database population.
7. UI price override (inventory & guild store)
Override works on two levels:
Display `SecurePostHook` on the `setupCallback` of every inventory list replaces the text of the `SellPriceText` control.
Sorting the default `stackSellPrice` sort key is replaced by `lpcValue` in the sort headers. `lpcValue` is added to each slot via a hook in `ZO_SharedInventoryManager.CreateOrUpdateSlotData` (preserving the original function).
8. Example usage in another addon
local price = LPC_GetPrice(itemLink)
if price then
d(“Average price: ” .. price)
else
d(“No price data for this item”)
end
📜 LICENSE & ACKNOWLEDGEMENTS
This library is released under the MIT license. The source code is open and available on GitHub (link in authors profile).
Special thanks to the authors of the trading addons who provided APIs: Tamriel Trade Centre (Mladen90), Master Merchant (Sharlikran, Dan Stone, Philgo68), Arkadius Trade Tools (Aldanga, Arkadius1), ESO-Hub (Seerah, Ayantir), UESP (uesp).
Many thanks to DeepSeek for coding assistance and optimisation.
If you wish to support development, you can send an in‑game donation to @HyboremInfernal or use the Donate button in LPC settings.

