final price = ( treasure base + sum of gem values ) × combination bonus
The bonus depends only on the colours of the gems you inlay, never on which gem supplied the colour — Ruby and Red Beryl are both red, so they stack together into the same set. Round gems only fit round sockets, square gems only square sockets.
A set scores the best bonus it contains. Two reds plus a blue plus a green satisfies both Duo (×1.2) and Three Colors (×1.3), so it takes ×1.3. A treasure does not need every socket filled — the bonus is worked out from whatever is actually inlaid.
Every price this app produces can be verified against sale figures published in the community guides. Run the suite to confirm nothing has drifted.