Sub topic 15
Player-to-Player Trading Economies
This chapter assumes you know what sources, sinks, currencies, and inflation mean from earlier chapters. You should also be comfortable reading short Python snippets and percentage arithmetic.
Trading moves value but does not create it
A trade between two players changes who holds currency and items. It does not change how much currency exists. If Ana pays Ben 500 gold for a sword, the total gold in the world is the same before and after.
That fact shapes how you design a trading economy:
- Trading is neither a source nor a sink. Only the rules around it can be one, such as fees, taxes, and item creation.
- Trading changes the velocity of currency, meaning how often a unit changes hands. Higher velocity lets the same supply support more activity, and it makes price shocks spread faster.
- Trading lets players redistribute wealth. A designer who sets prices in a fixed-price shop loses that control once players set prices.
Trading also makes items part of the economy in a new way. In a game without trading, an item dropped to one player stays with that player. With trading, every drop becomes a source of tradable value. Loot tables are therefore part of your currency inflow, even if no gold is paid out.
Price discovery replaces price setting
In a designer-priced shop you choose the price. In a player market, prices come from supply and demand, which is called price discovery. Your job changes from picking numbers to shaping the conditions that produce them.
You influence prices through:
- Drop rates and crafting costs. These set how much supply enters the market.
- Demand drivers. Item power, collection goals, and upgrade requirements decide how many players want the item.
- Fixed-price anchors. A shop that sells a basic item at a known price puts a ceiling on its market price. A shop that buys it back sets a floor.
- Friction. Listing fees, taxes, and trade limits slow speculation.
Anchors matter most. Without a shop ceiling, a scarce crafting material can climb until new players cannot afford it. Without a floor, a common item can fall to near zero and become worthless.
Trading channels and their trade-offs
| Channel | How it works | Strength | Main risk |
|---|---|---|---|
| Direct trade | Two players agree and swap | Social, flexible | Scams, hard to price items |
| Auction house | Players list items, others bid or buy | Strong price discovery, easy to tax | Bots, price manipulation |
| Fixed-price market board | Sellers set a price, buyers browse | Simple, searchable | Underpricing wars |
| Gifting only | One-way transfers | Easy to restrict | Hidden sales outside the game |
Most games offer several channels. Each one needs its own safeguards, because a restriction on one channel often pushes players to another.
Transaction fees as sinks
A trade tax is the standard way to remove currency from a trading economy. The market takes a percentage of each sale, and that amount is destroyed. This turns trading into a proportional sink, which is the same mechanism as the repair-cost example from the balance chapter.
Fees have a second job beyond draining currency. A per-listing fee, charged even if the item never sells, discourages players from flooding the market with absurd prices or testing the market constantly. A tax charged only on sale rewards players who price realistically.
The code below shows a trade with a tax, and checks that no currency disappears except the tax.
class Account:
def __init__(self, name, balance=0):
self.name = name
self.balance = balance
def trade(buyer, seller, price, tax_bp, sink_log):
"""Move `price` from buyer to seller. The tax (in basis points,
where 500 means 5%) is destroyed and recorded as a sink."""
if price <= 0:
raise ValueError("price must be positive")
if buyer is seller:
raise ValueError("cannot trade with yourself")
if price > buyer.balance:
raise ValueError("insufficient funds")
# Integer math with rounding up, and at least 1 unit of tax,
# so tiny trades cannot dodge the fee.
tax = max(1, -(-price * tax_bp // 10_000))
buyer.balance -= price
seller.balance += price - tax
sink_log["trade_tax"] = sink_log.get("trade_tax", 0) + tax
return tax
ana = Account("Ana", 1000)
ben = Account("Ben", 0)
sinks = {}
before = ana.balance + ben.balance
tax = trade(ana, ben, 1000, 500, sinks)
after = ana.balance + ben.balance
print(ana.balance, ben.balance, sinks) # 0 950 {'trade_tax': 50}
assert before - after == tax == sinks["trade_tax"]The assertion is the key idea. Total supply drops by exactly the tax. If a trading function ever lets the supply change by a different amount, it contains a bug or an exploit.
Using integers and a minimum fee avoids two common faults. Floating-point rounding can leak or create fractions of currency. A percentage fee that rounds down to zero on cheap items lets players move value tax-free by splitting a large sale into many small ones.
How trade flows look
The diagram shows two separate things. Currency passes through the market and loses the tax on the way. New items enter at the seller's side from loot and crafting, and they are the part of the economy that trading does not tax.
Inflation inside a trading economy
Player markets inflate in ways a fixed-price economy does not.
- Currency inflation. Sources keep adding gold faster than sinks remove it, and every market price rises. Trading makes this visible quickly because prices are set by players who see their own wealth grow.
- Item inflation. Too many copies of an item enter the world, and its market price falls. Duplicated gear, mass-farmed drops, and obsolete items all show this pattern.
- Wealth concentration. Early players hold large balances and can outbid everyone, or corner a scarce material. Averages can look healthy while new players cannot afford anything.
Because each of these has a different cause, you need separate measurements: total currency supply, median wealth next to mean wealth, and price indices for a basket of common items. A rising mean with a flat median means wealth is concentrating at the top.
Exploits specific to trading
Trading adds attack surface that single-player economies lack.
- Duplication bugs. A race condition lets a player trade an item and keep it. Fix these with atomic transactions, so both sides of a trade commit together or not at all, and with a ledger that records every transfer.
- Real-money trading (RMT). Players sell currency or accounts for real money. Gold sellers use bots, and the resulting farmed currency inflates the economy. Trade limits for new accounts, rate caps, and anomaly detection on large one-way transfers help.
- Wash trading and laundering. One person trades between their own accounts to fake demand or to move value around a restriction. Look for repeated trades at unrealistic prices between the same accounts.
- Market cornering. One player buys most of the supply of an item and resells at a high price. Purchase caps and supply expansion (for instance, a shop that sells the item at a high price) limit this.
- Scams in direct trades. Swapping an item at the last moment is common. Show a confirmation screen with both offers, and lock offers after both sides accept.
Restricting trade deliberately
Sometimes the right design is to limit trading. Common tools are:
- Bind on pickup. The item is tied to the player who received it. This protects progression, since a player cannot buy the best gear, and it removes item-duplication risk for those items.
- Trade cooldowns. An item cannot be traded for a set period, which slows resale flipping.
- Daily caps. A player can send or receive only so much per day.
- Account age or level gates. New accounts cannot trade, which makes bot farms more expensive.
Every restriction has a cost. Strict limits reduce the social value of trading and push players toward outside markets, where you cannot protect them. Pick restrictions based on which problem you have observed, and measure the effect.
Common mistakes
- Treating loot as free. Drops that are tradable are a source of value, so count them when you estimate inflow.
- Forgetting item sinks. Currency sinks do nothing for item oversupply. Add item sinks such as crafting consumption, upgrade fodder, or item decay.
- Taxing only one side. If sellers pay all fees, they raise prices to compensate. The effect is similar either way, but the choice changes who feels the cost.
- No ledger. Without a record of every trade, you cannot find duplication, investigate scams, or roll back damage.
Summary
Trading redistributes currency and does not change the supply. The designer's influence comes from the sources and sinks around it: loot tables, shop anchors, fees, and trade restrictions. Track supply, median wealth, and item prices, validate every trade on the server, and record each one in a ledger.
Exercise
A game charges a 5% sale tax on its auction house, rounded down, with no minimum. Players discover that selling a stack of 100 potions priced at 1 gold each as 100 separate listings costs no tax. Explain why, and give two fixes.
Show answer
Each sale is for 1 gold, and 5% of 1 is 0.05, which rounds down to 0. So every listing pays zero tax and the sink removes nothing. Two fixes: charge a minimum tax of 1 unit per sale (rounding up, as the trade function above does), or add a flat per-listing fee so splitting a stack costs more. A third option is to apply the tax to the total of a stack sold in one transaction.