A listing tool has a price rule for used items: "match the featured used offer". For each item, it asks the marketplace's offers API for the current offers. The API flags one used offer as the winner. The tool takes that offer's price and lists the seller's copy at it.
The rule had a guard. It checked one direction only, and the hole was in the other.
Key facts
- The tool copied the flagged winner's price without comparing the winner's condition grade with the grade of the seller's own copy.
- A guard set the reference aside when it was more than 25% above the tool's own estimate. Nothing checked too low.
- One example: a Good copy listed at $23.99, the price of an Acceptable copy, $14.92 under the Good copy the product page featured.
- One seller, 7 days: 6 items priced under the cheapest Good-or-better offer. All accounts, 30 days: 297 items of 37 sellers.
- The fix was written the same night and hand-checked on 13 of 13 cases. It was in review when this was written.
What happened
A seller listed a used copy graded Good. The tool asked the offers API, and the flagged winner was an Acceptable copy at $23.99 delivered: $20.00 plus $3.99 shipping. The tool took that price.
A buyer on the product page saw something else. The page featured a Good copy at $38.91. The seller's Good copy went up at $23.99, $14.92 under the offer it actually competed with.
The seller noticed, not us. Nothing in the tool caught it.
Two different winners
The rule assumed that the API's winner and the product page's featured offer are the same thing. They are not.
The API flags a winner among all used offers, whatever their grade. The product page features an offer in a grade comparable to the copy a buyer is looking at.
The tool never compared the winner's grade with the grade of the seller's own copy. A value came back with the right label and was copied.
The guard only looked up
There was a guard, and it gave false comfort. If the used reference price was more than 25% above the tool's own estimate, the tool set it aside and used the estimate. Nothing checked the reference for being too low.
We counted one seller's last 7 days:
| What | Items |
|---|---|
| Priced with the rule | 71 |
| Had a flagged used winner | 57 |
| Winner graded Acceptable | 10 |
| Set aside by the too-high guard | 2 |
| Acceptable price kept | 8 |
| Under the cheapest Good-or-better offer | 6 |
| Above the comparable offers | 2 |
The guard fired twice, on Acceptable copies far above the rest. On the other 8, the rule kept the Acceptable price: 6 landed under the cheapest Good-or-better offer, by $0.85 to $31.47 per item, and 2 more were priced too high instead. One cause, both directions.
How we could count it
Each priced row stores the offers it saw at the moment it was priced. So the count is a read-only replay of saved inputs through the rule, with no guessing from today's market.
Across all accounts, over 30 days, the replay found 297 items of 37 sellers priced under the cheapest comparable offer this way.
The fix
The fix is one shared rule, used by every path that prices with it. When the flagged winner is graded below the seller's copy and its price is under the tool's own estimate, the tool uses the estimate. The estimate is the cheapest delivered offer graded Good or better.
Same grade still matches: an Acceptable copy against an Acceptable winner takes the winner's price. The too-high guard stays. A hand check came out right on 13 of 13 cases. The fix was written the same night and was in review when this was written, so there is no production result to report yet.
A sketch, with made-up names:
// Before: copy the flagged winner, guard only the high side.
const winner = offers.find(o => o.flagged);
// Too high: set aside. Too low: nothing checks.
if (winner.price > estimate * 1.25) use(estimate);
else use(winner.price);
// After: compare grades, leave your own offer out of the estimate.
const RANK = { acceptable: 1, good: 2, very_good: 3, like_new: 4 };
const rank = (g) => RANK[g];
function priceUsed(copy, offers) {
const winner = offers.find(o => o.flagged);
const others = offers.filter(o => !o.mine && rank(o.grade) >= rank('good'));
const estimate = Math.min(...others.map(o => o.price + o.shipping));
// The too-high guard stays.
if (winner.price > estimate * 1.25) return estimate;
// Lower grade and cheaper: use the estimate.
if (rank(winner.grade) < rank(copy.grade) && winner.price < estimate)
return estimate;
// Same grade still matches.
return winner.price;
}
// Every entry path calls priceUsed(copy, offers).
// A path that cannot supply copy.grade is a named exception, not a default.
Review found two more holes
Review of the fix found two more, and both are general.
- One old entry path never passed the grade. It called the rule without the copy's grade, so for its items the new check had nothing to compare, and the bug stayed.
- The estimate included the seller's own offer. 142 live items were not repaired by the fix. The seller's own offer already sat at the low price, so "the cheapest comparable offer" was the seller's own wrong price. The rule compared the wrong price with itself and saw nothing to correct.
The estimate has to leave out your own offer. It is the same family of trap as a tool reading its own change back as the market, met through a different door.
What anyone can apply tomorrow
A guard that checks one direction documents the failure its author imagined. A reference value is only a reference if it is the same kind of thing as what you are pricing, and if it is not your own earlier output.
- Write the opposite bound. For every bound check on an input, put the opposite bound next to it, or write down why it cannot happen.
- Compare like with like. Before you copy a value, check what it carries: grade, unit, currency, fulfilment type. Do not assume the API's "winner" matches the page.
- Leave yourself out of the market. Your own record does not belong in any "market" you compare against.
- One rule, one place. Every entry path calls the same function with the same arguments. A path that cannot supply an argument is a named exception, not a silent default.
- Store the inputs next to the decision. Then a later "how often did this happen?" is a replay, not an estimate.
Common questions
Why not drop the featured offer and always use the estimate?
The featured offer is still the right reference when it is the same grade as your copy: an Acceptable copy against an Acceptable winner still matches. The estimate only steps in when the winner is a lower grade and cheaper.
Why did the guard look like enough?
It caught the case its author pictured, a high outlier, and it did fire. In one seller's week, 2 of 10 Acceptable winners sat far above the rest and were set aside. The other 8 were not, and nothing looked at them.
Melta is free; get it on the App Store or Google Play.