← Overview

Sell Value Calculator — “required resources” → sell price

Exactly per InventoryUtility.GetCoinValue(...) (decompiled). Sell price & recycling return both come from the same requiredObjectsToCraft list.

Key insight

A material's contribution does not depend on its own sell value — only on its rarity, via GetRaritySellValue(r) = 1 + max(0, (int)r) * 5. The material's own sellValue is used only as a gate (must be != 0, i.e. sellable).

Rarity(int)Value per unitIn-game name color
Common01white/grey
Uncommon16green
Rare211blue
Epic316purple
Legendary421orange

Material rarity is not shipped in the SDK → read it in-game from the item's name color and set it per row below. (Legendary items themselves are unsellable → value 0; but they still count as an ingredient.)

Modded items

Fully supported — the same code path runs for any ObjectID, vanilla or modded:

You don't need the ObjectID. It's only used for the exact ±10% jitter, and modded items get their ObjectID assigned at runtime by PugMod. Leave it blank → the result is shown as a ±10% range that always contains the true value. Plan by name + rarity.

Your item

No ObjectID → only the ±10% range is shown. The jitter is fixed & deterministic per ObjectID.

Required resources (crafting ingredients)

Material (free name)AmountRaritySellableContribution

Result

Ingredient sum (Σ)0
Item's own part
num (before jitter)0
Jitter (ObjectID)
Sell price
0
Range (±10%):

Formula (from the code)

Quick table: one material type → contribution by amount

Pure Σ contribution (= how much it adds to num before the item's own part and jitter).
Source: InventoryUtility.cs:1088-1175 (GetCoinValue + GetRaritySellValue); jitter via Unity.Mathematics.Random.CreateFromIndex((uint)objectID).NextFloat(-0.1f,0.1f) (random.cs: WangHash+62, xorshift, NextFloat=(state>>9)/2^23). Rounding = System.Math.Round (banker's / to-even). Non-stackable sell = num; stackable = num × amount.