Repository navigation
fix(buyer): cap against the market instead of the static override - #45
Merged
Merged
Conversation
The seller prices off the moving average and the demand multiplier, both of which climb above the price override, while the buyer capped at the override plus 15 percent. Listings priced the way the bot prices its own were refused, which is what players see as an item the bot will not buy. The moving average was also reading stack totals as per item prices, because final_price holds what the whole stack went for. A twelve stack of leather therefore read as twelve times the price per leather and pushed the baseline into the avgPrice * 2 clamp for every item that sells in stacks. Closes #39
…uses The lookup costs two world database queries and a pass evaluates up to a hundred auctions per bid it places, so it now runs only for auctions the override cap would turn away, and the result is cached for the rest of the pass.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes Proposed:
final_priceis what the whole stack went for, and everything downstream works per item.GetMarketReferencePrice(): the demand-adjusted moving average for an item, or 0 without trading history.Issues Addressed:
SOURCE:
On the live realm the override for Rugged Leather (8170) is
avgPrice = minPrice = 11000, which collapses the cap to the average; #30's headroom lifts it to 12650 per leather. The bot's own listings for that item ran from 11241 to 13407 per item at the time of writing, five of eleven above its own buy ceiling, so a player pricing against what they see in the auction house lands above the cap about half the time. 6601 of 11469 override rows haveminPrice = avgPrice, so this is not one bad row.The unit bug feeds the same problem from the other side. The insert sites in
AuctionHouseBotAuctionHouseScript.cppwriteauction->bid/auction->buyout(stack totals) next toquantity, whileCalculateMovingAveragePrices()averagedfinal_priceas if it were a price per item. A twelve stack of leather therefore read as twelve times the price per leather, and the baseline ran into theavgPrice * 2clamp for every item that sells in stacks.Two things worth knowing about the new cap:
avgPrice * 2) for items that have an override row. An item without one has no ceiling on its average, and the buyer now reads that average. With the defaultAuctionCount = 100a single trade moves it by about a percent, so the drift is slow, but a very lowAuctionCountwould let a buyer and seller pair ratchet an unpriced item.DynamicPricingMinMultiplier/DynamicPricingMaxMultiplier(0.5 to 3.0 by default).Tests Performed:
AuctionHouseBot.cpp.obuilds clean on TEST against the current tree.AdjustPrices(),Sell()multiplies bystackCountonce at auction creation, and the buyer multiplies its cap bypItem->GetCount()once, against acurrentPricethat is a stack total.How to Test the Changes:
avgPrice * 2.AuctionHouseBot.TRACE_BUYER = 1logs the resultingBid Maxper auction.