Sub topic 10
Exchange and conversion between currencies
This chapter assumes you know what sources, sinks, and soft and hard currencies are, and that you can read short Python snippets and work with rates and percentages. It covers the rule that lets players turn one currency into another, and the ways that rule goes wrong.
Why conversion exists
Once a game has two or more currencies, players will ask whether they can turn one into the other. Conversion is the mechanism that answers that question. It does three jobs:
- Pacing relief. A player short on soft currency can pay with hard currency and skip some grinding.
- Revenue. In free-to-play games, this path turns purchased hard currency into progress.
- Currency removal. A conversion fee is a sink. Currency removed on the way through never reaches the player.
A conversion rule also links two economies together. If you inflate one currency, the other becomes cheaper to buy with it. A conversion rate therefore needs the same care as a price.
Design decisions
Direction
A conversion can be one-way or two-way. Most games allow only hard to soft, such as gems to gold. The reverse direction, soft to hard, is rare because it lets players earn a premium currency by playing. That breaks the separation between the two currencies.
If you do allow it, the reverse rate must be much worse than the forward rate. Otherwise players can profit from the round trip, as the arbitrage check below shows.
Fixed or floating rate
| Property | Fixed rate | Floating rate |
|---|---|---|
| Set by | Designers | Player supply and demand |
| Predictability | High | Low |
| Needs | A config value | A market, enough players, anti-manipulation rules |
| Main risk | A rate that becomes wrong as the economy drifts | Speculation and price manipulation |
Most games use fixed rates because they can be tuned and communicated. A floating rate belongs to player-trading systems, which a later chapter covers.
Spread and fees
The spread is the gap between the rate at which you buy and the rate at which you sell. A fee is a percentage removed during conversion. Both make a round trip lose value. They also remove currency from the game, so they work as sinks.
Rounding and bundles
Conversion must give whole units. Rounding down in the game's favor is standard, but the loss must be small enough that players don't feel cheated. Selling in fixed bundles, such as 10 gems for 1,000 gold, avoids the problem of someone converting 1 gem into 97 gold.
A conversion function with a fee and a cap
This sketch uses integer math. Floating point can produce results like 284.99999, which then truncate to the wrong amount.
class Converter:
"""One-way conversion with a fee in basis points (1 bps = 0.01%) and a daily cap."""
def __init__(self, rate, fee_bps=500, daily_cap=1000):
self.rate = rate # output units per input unit
self.fee_bps = fee_bps # 500 bps = 5%
self.daily_cap = daily_cap # max input units per player per day
def convert(self, amount_in, converted_today=0):
if amount_in <= 0:
raise ValueError("amount must be positive")
if converted_today + amount_in > self.daily_cap:
raise ValueError("daily conversion cap exceeded")
gross = amount_in * self.rate
amount_out = gross * (10_000 - self.fee_bps) // 10_000 # floor
removed = gross - amount_out # leaves the economy: log it as a sink
return amount_out, removed
gems_to_gold = Converter(rate=100)
print(gems_to_gold.convert(3)) # (285, 15)Here 3 gems are worth 300 gold at the base rate. The 5% fee removes 15 gold, so the player receives 285. Log the removed amount under a reason label such as conversion_fee, using the ledger pattern from the safeguards chapter. Then telemetry can show how much this sink drains.
Setting the rate from time-to-earn
Do not pick a rate by feel. Derive it from the pacing you want, using the same approach as in the pricing chapter.
Suppose a typical player earns 450 gold per hour. You decide that one hour of play should be worth about 2 gems if the player chose to skip it. Then:
- 1 gem is worth 225 gold of play time.
- A rate of 100 gold per gem would be a bad deal for the game, because gems would be cheap relative to effort.
- A rate of 225 gold per gem matches the intended time value.
Different player segments earn at different rates, so the "typical" figure matters. If your fastest players earn three times the median, a rate tuned to the median makes conversion a poor deal for them, and they will not use it. A rate tuned to the fast players makes it too generous for everyone else. Pick the segment whose behavior you want to influence, and state that choice in your design notes.
The rate also has a consequence for hard-currency prices. If a premium item costs 50 gems and gems convert to 225 gold each, that item has an effective soft price of 11,250 gold. Check whether that is a sensible number against your soft-currency items.
Arbitrage: cycles that create money
Arbitrage is a sequence of conversions that ends with more than you started with. It only takes one such cycle for players to find and repeat it. When a cycle's rates multiply to more than 1, the economy is minting currency.
The check is mechanical. Multiply the rates around every cycle and flag any product above 1.
from itertools import permutations
def find_arbitrage(rates, max_len=3):
"""rates maps (from, to) -> units of 'to' per unit of 'from'.
Returns cycles whose rates multiply to more than 1."""
currencies = sorted({c for pair in rates for c in pair})
found = []
for n in range(2, max_len + 1):
for path in permutations(currencies, n):
cycle = path + (path[0],)
product = 1.0
valid = True
for a, b in zip(cycle, cycle[1:]):
if (a, b) not in rates:
valid = False
break
product *= rates[(a, b)]
if valid and product > 1.0:
found.append((cycle, round(product, 3)))
return found
rates = {
("gems", "gold"): 100,
("gold", "gems"): 1 / 90, # mistake: too generous in the reverse direction
("gold", "tokens"): 0.01,
("tokens", "gems"): 0.5,
}
print(find_arbitrage(rates))
# [(('gems', 'gold', 'gems'), 1.111), (('gold', 'gems', 'gold'), 1.111)]The output reports the same loop twice, because the search treats each starting point as a separate path. A player who converts 90 gold to 1 gem, then 1 gem to 100 gold, gains 10 gold per loop. Automating that loop is trivial.
Run this check whenever a rate changes, ideally as a test in your build. Remember that fees and rounding shrink the product, so a cycle just above 1 on paper may still be profitable once players batch large amounts. Don't rely on rounding to protect you.
Common problems
- Hidden cycles through three or more currencies. Games with event tokens or crafting materials add conversion paths over time. Each path needs a check against every existing one.
- Stale rates. A rate set at launch drifts out of line as income per hour grows with new content. Review rates whenever average earnings change.
- Conversion as an unlimited soft-currency source. If hard currency is cheap, for example through promotions, conversion turns into a faucet. Caps and cooldowns limit the damage.
- Rate shown to players is not the rate applied. Fees must be displayed before confirmation. Hidden fees feel like theft and cause support load.
- Rounding that accumulates. Many small conversions that each round down can cost players noticeably. Use bundles or a minimum amount.
- Time-limited rate changes. Sales on conversion rates create demand spikes and let players stockpile at the low price. Treat them as a deliberate event with a cap.
Exercise
A game offers 1 gem = 200 gold, with a 10% fee on gem-to-gold conversion. It also offers gold-to-gem conversion at 250 gold per gem with no fee. Is there an arbitrage cycle? If so, what is the product of the rates, and what single change would remove it?
Show answer
Gem to gold gives 200 × 0.9 = 180 gold per gem after the fee. Gold to gem gives 1/250 = 0.004 gems per gold. The round trip is 180 × 0.004 = 0.72, which is below 1, so there is no arbitrage. A player loses 28% per loop. If the fee were removed, the product would be 200 × 0.004 = 0.8, still below 1, so the fee is not what protects you here. The protection is the gap between 200 gold per gem going out and 250 gold per gem coming back. Arbitrage would appear if the reverse price fell below 200 gold per gem, for example at 150 gold per gem with no fee, which gives 200 / 150 = 1.33.
Exercise
Your median player earns 600 gold per hour, and you want 1 gem to be worth about 30 minutes of play. What base conversion rate should you set, and how many gold does a player get from 4 gems after a 5% fee?
Show answer
Thirty minutes of play at 600 gold per hour is 300 gold, so the base rate is 300 gold per gem. Four gems gross 1,200 gold. A 5% fee removes 60, so the player receives 1,140 gold.