DEV Community

尚毅段
尚毅段

Posted on Originally published at pettradecalc.com

The score is fusing-neutral: building a trade calculator for 805 game items

A Mega Neon legendary and four Neon legendaries of the same pet are the same thing on the game's own ladder: four Neons fuse into one Mega. Players still turn that trade down all the time.

I built PetTradeCalc, a browser calculator for Adopt Me trades, because most tools answer "what is this worth" with a number someone else decided. Community value lists are useful; they also change weekly, disagree with each other, and you cannot check the arithmetic. So this one is built from public rarity data and prints the whole formula. The part that took the longest was not the extraction. It was making the score auditable and being explicit about what it cannot see.

The scale is a ladder, and fusing does not move you on it

The wiki sorts pets into five rarity tiers. They land on powers of two: Common 1, Uncommon 2, Rare 4, Ultra-Rare 8, Legendary 16. A Neon multiplies by 4, a Mega Neon by 16.

That choice is not cosmetic. It makes the index neutral under fusing. Four Neon legendaries score 4 × 64 = 256. One Mega Neon legendary scores 16 × 16 = 256. Same number. Fusion neither creates nor destroys score, so a trade does not become fair or unfair just because one side did more grinding.

The property has a less convenient consequence: the index cannot explain the trades people actually refuse. A Mega costs four Neons plus a long aging process, and the four Neons are separately tradeable. RI calls the two sides equal, and the holder of the Mega still says no, because the thing RI treats as equal is not equally liquid. That is demand and effort, and they are not in the formula.

So the score is a sanity check, not a price. That sentence sits above the calculator, not in a footnote.

Fairness has to be a ratio

The first version used a point tolerance: both sides within X points of each other is fair. It breaks at the small end, where most new players trade. 1 RI against 2 RI is a 100% difference. 100 against 110 is 10%. An absolute tolerance either lets tiny trades be wildly lopsided or rejects large trades that are genuinely close.

Relative tolerance, measured against the larger side, is the version that survives contact:

def verdict(a: float, b: float, tol: float = 0.10) -> str:
    if a <= 0 and b <= 0:
        return "empty"
    larger = max(a, b)
    if abs(a - b) <= tol * larger:
        return "fair"
    return "you win" if a > b else "you lose"
Enter fullscreen mode Exit fullscreen mode

Three things this does not do, all left alone on purpose.

It does not chain. A fair trade can still be 0.9 of the other side, and two of those in a row put you at 0.81. If you trade in sequence, add up the totals each time instead of trusting "the last one was fair".

It is not symmetric the way traders expect. 100 against 90 is fair. 100 against 111 is not, even though both pairs are 10 apart in raw points. The band is really "the smaller side may sit up to 10% below the larger".

And zero is a special case. An empty trade against an empty trade is not fair, it is empty, and the ratio is undefined. Guarding that case took one line and removed a class of nonsense output.

Store the revision, not the count

The data is 805 pets from the Adopt Me! wiki, revision 475127, retrieved 2026-10-26. The count is the least interesting part. The revision is what makes the numbers falsifiable: when the wiki re-tiers a pet, every score that touches it changes, and any cached verdict is wrong from that moment. The snapshot stores the revision id and the page prints it, so a dispute is a diff between two revisions rather than between two opinions.

The extraction itself is mechanical and the failure mode is quiet. Rarity categories live in hand-edited wiki tables. A pet listed in two tables, or a tier renamed halfway through, produces a plausible list with a wrong count. So each refresh compares totals against the wiki's own category counts and writes a changelog. One added pet is normal. A pet changing tiers is a version bump, and the page should say so.

The override box is a provenance problem

Fly and Ride potions are not in the index. Their effect on a trade is demand, not rarity, so any line can be given a manual value instead of its RI score. That was the right product decision, and it introduced the worst bug class in the build: a total is only as strong as its weakest input, and a mixed-provenance number must not be rendered as if it were all one thing.

Each line now carries its source, something like wiki-475127:legendary:normal or manual. The total is the sum of both, and it is marked when any line is manual. It makes the result panel busier. It is also the difference between a calculator and a number generator.

What it cannot see, written above the fold

Demand, availability, and resale speed are not in the formula. That belongs in the first sentence on the page rather than a limitations section, because the failure mode of a tool like this is a player reading "Fair" as "safe".

RI answers one question: are these two collections comparable on the game's own rarity ladder? Everything else is the player's call. 805 pets, five tiers, two fusion multipliers, one 10% band. That is the entire model, and you can check all of it by hand.

Top comments (0)