Lesson 3 of 11
Economy design: sources, sinks and the spreadsheet
Balance a live Roblox economy before writing shop code: build a multi-archetype sources-and-sinks spreadsheet, compute Expected Value, control inflation and simulate 30 days in Luau.
By the end you can
- Model currency sources and sinks across casual, regular and grinder player types in a spreadsheet
- Estimate event impact with Expected Value (EV) and spot virtual inflation before shipping
- Separate soft earned currency, premium purchases and event currency without breaking the core shop
- Simulate 30 days of Beacon Yard's economy in Luau and tune its sinks until every player type is healthy
Before this: Prototype fast: paper, greybox, blockout, Monetization: products, passes, subscriptions, economy, Analytics: funnels, economy events, retention
Step 1 of 6
Mapping Beacon Yard's real faucets and drains
Roblox's virtual economy guide frames balance around four habits: data-driven content, resource planning, impact estimation, and resource sinks1. Before inventing prices, audit every place your server creates coins (sourcesCurrency source (faucet)Any mechanic that creates currency and adds it to a player's wallet.Think of it as a tap pouring water into the player's tub.) and destroys coins (sinksCurrency sinkAny mechanic that permanently removes currency from circulation.Think of it as the drain at the bottom of the tub.).
Look at Beacon Yard's main coin faucet in CoinService.luau at m14-ship:
-- The Scrap Rush event multiplies every pickup. It is 1 when off.
local amount = math.floor(base * FlagService.coinMultiplier() + 0.5)
local balance = DataService.addCoins(player, amount)
Analytics.coinSource(player, amount, balance, Enum.AnalyticsEconomyTransactionType.Gameplay.Name, "CoinPickup")
Analytics.onboarding(player, "FirstCoin")
And look at the only coin sinks in ShopService.luau:
Analytics.coinSink(player, Config.SPEED_PRICE, balance, Enum.AnalyticsEconomyTransactionType.Shop.Name, "Speed")
Analytics.onboarding(player, "FirstPurchase")
feedback(player, "buy", "Speed")
end
local function buyShield(player: Player)
if shieldCharges(player) >= 1 then
feedback(player, "deny", "Shield already up")
return
end
if not DataService.trySpend(player, Config.SHIELD_PRICE) then
feedback(player, "deny", "Not enough coins")
return
end
player:SetAttribute("ShieldCharges", 1)
local balance = DataService.get(player).coins
Analytics.coinSink(player, Config.SHIELD_PRICE, balance, Enum.AnalyticsEconomyTransactionType.Shop.Name, "Shield")
Analytics.onboarding(player, "FirstPurchase")
feedback(player, "buy", "Shield")
Count every tap and drain at m14-ship:
- Four sources: coin pads (
5 * FlagService.coinMultiplier()), drill survival (+10inRoundService), crawler bounty (+8inCrawlerService), and the Robux Coin Pack (+50inMonetizationService). - Two sinks: Speed (
25coins, once forever) and Shield (40coins, only whenShieldCharges == 0).
| In the picture | In Roblox |
|---|---|
| The taps | Currency sources: coin pads, survival bonuses, crawler bounties and Coin Packs |
| The water level | Coins sitting unspent in a player's saved profile |
| The drain | Currency sinks: upgrades, shields, wrench repairs and event shop items |
Think of a virtual economy as a bathtub with taps (sources) and a drain (sinks). When taps stay wide open and the drain closes after 65 coins, water spills over the rim: that surplus is virtual inflationVirtual inflationA runaway surplus of currency when sources outpace sinks across player wallets.Think of it as a tub filling faster than it drains until coins spill over the rim..
Think of it as A bathtub with taps and a drain
Which of these create new coins (call Analytics.coinSource) in Beacon Yard at m14-ship?
Press 1 to 4 to choose, Enter to check.
Step 2 of 6
The spreadsheet: model by player archetype
Stored dataRemember: Virtual economy sources and sinks is a bathtub with taps and a drain.
One mistake sinks beginner spreadsheets: computing a single "average player." Beacon Yard's economy.json (you add it in this lesson's BuildAlong) models three player types instead. A Casual player runs 3 drills a day and grabs 4 pads a drill, a Regular runs 8 drills with 6 pads, and a Grinder runs 20 drills with 8 pads. If you tune prices for the average, casual players hit a wall while grinders buy out the shop in two afternoons.
Download the spreadsheet template built from Beacon Yard's data files and open it in Google Sheets, Excel or LibreOffice Calc:
The sheet adds a Payer row (a Regular who buys one Coin Pack a week) and has five sections. Edit only column B of Section 1 and the player rows of Section 2; every other cell is a formula.
- Levers: coin rewards,
EVENT_MULTIPLIERandEVENT_DAYS,WRENCH_REPAIR_PER_DRILL, one pass of the upgrade tracks,REBUILDS_PER_30_DAYSand an event shop sink. - Daily sources per player type, on a normal day and an event day.
- Daily upkeep: the forced sinks, wrench repair and shields.
- 30-day projection: earned, spent, ending balance, Sink Ratio (
spent / earned), upkeep share and a Verdict. - Expected Value (EV) of a drop table, base and event versions.

Select a numbered pin, or a row below, to read what it marks.
The downloadable economy sheet tracks each player type separately so a healthy total never hides a starved casual player or an inflated grinder wallet.
What does healthy mean? Roblox's Economy dashboard guidance is that total sources minus total sinks "should be close to zero", and that a growing net total or a growing average wallet balance means you need more sinks2. So a Sink Ratio near 1.0 is the target: players spend roughly what they earn. Spending everything is not a problem when the spending is on things players want. The sheet's Verdict column checks the two ways an economy fails instead:
- Inflation: the Sink Ratio falls below a floor (
0.4for Casual and Regular,0.3for Grinder ineconomy.json), or the ending balance passes the type's cap. Coins pile up because there is nothing left worth buying. - Starved: forced upkeep (wrench repair and shields) takes more than half of a player's income (
maxUpkeepShare = 0.5ineconomy.json), so the money goes to staying afloat instead of to goals. There is no maximum Sink Ratio: a player who spends everything on things they chose is healthy.
Where does it break?โA bathtub with taps and a drainโ is a good picture of virtual economy sources and sinks. Where does it stop being true?
It breaks here. A bathtub holds one shared pool of water, whereas a game has thousands of separate player wallets; the server average can look healthy while newcomers are starved and veterans hoard ten thousand coins.
The true model. A live economy must be modeled per player archetype (casual, regular, hardcore, payer) over days and weeks. Healthy design matches sources with permanent and repeatable sinks for each cohort and isolates temporary events with their own sinks or event currency.
Creator Hub shows total sinks at 0.82 of total sources across all players, so the economy looks close to even. Yet veterans say coins are useless while Day-1 players say upgrades cost too much. Why did the total mislead you?
Press 1 to 4 to choose, Enter to check.
Step 3 of 6
Expected Value and separating event currency
Roblox's economy guide illustrates inflation with an event that adds a rare high-value drop without modeling its Expected ValueExpected value (EV)The probability-weighted average payout of a random reward over many trials.Think of it as what one pull pays on average if you play a thousand times. (EV)1. Even a tiny drop chance multiplies across thousands of drills:
EV = sum(probability_i * payout_i)
Suppose Beacon Yard adds a bonus scrap roll after every drill: 70% Scrap Bolt (5 coins), 20% Copper Coil (15 coins), 10% Beacon Core (30 coins). Its baseline EV is 0.70 * 5 + 0.20 * 15 + 0.10 * 30 = 9.5 coins per drill. If a weekend event adds a 2% chance at a 500-coin Golden Rotor (taking 2% from Scrap Bolt), that single 2% drop adds 0.02 * (500 - 5) = +9.9 coins per drill, which more than doubles what the drop table pays out.
When you run a temporary event like Scrap Rush (FlagService.coinMultiplier()), Roblox's guide gives the cleanest safeguard: give the event its own event currency and event shop, or pair the boosted faucet with an equally sized limited-time sink1. Otherwise the event's surplus stays in wallets after the event ends, the base shop feels cheap, and fewer players need a Coin Pack. The Economy dashboard has a matching check: if players stop sourcing coins from purchases, Roblox suggests lowering prices or offering new options2.
A drill bonus roll pays 5 coins at 70%, 15 coins at 20%, and 30 coins at 10%. What is the Expected Value (EV) of one roll?
local ev = 0.70 * 5 + 0.20 * 15 + 0.10 * 30
print(string.format('%.1f', ev))
Press 1 to 4 to choose, Enter to check.
A pity rule changes the EV again. Suppose the Golden Rotor is guaranteed on the 50th roll without one (hard pity). The average wait is then (1 - 0.98 ^ 50) / 0.02 rolls instead of 50, so the real drop rate is higher than the 2% on the label. Model pity with the guarantee included. In a game with player trading, a market fee that removes a share of every trade is a sink that grows with trade volume.
Before you run this cell, guess the average wait. Then change PITY to 20 and see how much the guarantee moves the real rate.
Step 4 of 6
Interactive 30-day economy simulator
A spreadsheet gives you totals; a short Luau simulator follows the order things happen in. Each day the player earns, pays forced upkeep, then buys the next thing they can afford, so you see the day the shop runs out.
Start with the simulator below. It runs Beacon Yard's real numbers with no rebuild loop, so once a player owns Speed and every upgrade tier, nothing is left to buy and all three player types end outside their health bands. Change the knobs until all three end inside their bands, and notice which type is fixed last. The Price hike scenario shows the other failure: upkeep that eats over half of a player's income.
The economy bathtub
Goal Change the knobs until Casual, Regular and Grinder all end the 30 days inside their health bands.

Now do it in code. This cell starts from the same data with the same sink missing. Press Run and every player type reads INFLATION. Then tune TUNING until all three read HEALTHY in a normal month and in a month with a 3-day x2 Scrap Rush. Two levers to try:
repairPerDrill: forced upkeep. Raise it to30and watch the light players starve before the grinder is fixed.rebuilds: how many times a player may reset both upgrade tracks and buy them again. That is the Rebuild prestige you build in the next lesson, and it is a sink players choose.
Level 2, Builder
Challenge
Tune TUNING in the economy-sim-30d cell above until every player type ends HEALTHY, with and without the Scrap Rush.
- Start from
- The game at milestone m14 (download)
- Check it here
- Run the code cell; the challenge completes when it passes. No Studio needed.
Done means
- Every player type ends HEALTHY in a normal month
- Every player type ends HEALTHY in a month with a 3-day x2 Scrap Rush
- Forced upkeep stays under half of every type's income
- All tests in economy-sim-30d pass
The shipped game answers this with the Rebuild: EconomyModel lets a player rebuild up to 80 times a month, and lune run scripts/lune/economy-report ends 30 days at a Sink Ratio of 0.94 for Casual, 0.99 for Regular and 1.00 for Grinder, all healthy. That is on purpose. Every player keeps finding something worth buying, upkeep stays under a fifth of income, and no wallet grows month over month, which is what "sources minus sinks close to zero" looks like per player.
Now write the simulator the game will use. Do this challenge before the BuildAlong below, because the BuildAlong copies your passing file into the game.
Level 3, Professional
Challenge
Implement the 30-day economy simulator and target-band validator in challenges/work/economy_sim.luau. The written solution is challenges/solutions/economy-design.md. In Play on the server, run game.ServerScriptService.RunGameTests:Invoke("economy-design", "economy-design-sim") and paste the pass code here.
- Start from
- The game at milestone m14 (download)
- Grade it
- In Studio, press Play, then run
game.ServerScriptService.RunGameTests:Invoke("economy-design", "economy-design-sim")in the server command bar. Copy the pass code from Output.
Done means
- expectedValue computes the probability-weighted sum of outcomes
- dailySource computes one day of pad, survival and crawler coin income using eventMultiplier on pads
- simulateDays advances day by day, pays upkeep up to available balance, buys affordable upgrades in order, and returns totalEarned, totalSpent, balance, upgradesBought, sinkRatio and upkeepSpent
- inTargetBands returns (ok, reason) in this order: inflation below minSinkRatio, balance-high over maxBalance, starved when upkeepSpent / totalEarned is above maxUpkeepShare, balance-low under minBalance, otherwise ok
- A 0.98 Sink Ratio with low upkeep passes, because there is no maximum Sink Ratio: spending what you earn is the target
- challenges/economy-design.luau prints TEST PASS for every check
Build along
src/shared/data/items.jsonsrc/shared/data/economy.jsonsrc/shared/Config.luausrc/shared/EconomySim.luau
Add the two new item kinds to
src/shared/data/items.json(the data-driven content layout from Module 13). InConfig.luau, setWRENCH_REPAIR_COST = Content.price("Repair")andWRENCH_REPAIR_EVERY = 5: after 5 drills the wrench is worn and its upgrade damage stops until the player pays the repair. The shop handles these rows in the next lesson, whenUpgradeServiceexists.You should see items.json has a Repair row (kind upkeep, 20 coins) and a Rebuild row (kind rebuild, price 0). Config.WRENCH_REPAIR_COST reads the Repair price and Config.WRENCH_REPAIR_EVERY is 5.
Create
src/shared/data/economy.jsonfrom your spreadsheet's player rows. There is no maximum Sink Ratio, because spending what you earn is the goal;maxUpkeepSharecatches the starved case instead. Upgrade prices do not go here: they come from the curves inupgrades.json, which the next lesson adds.You should see economy.json holds three rows: Casual (3 drills, 4 pads, 0.5 crawlers, 0 shields), Regular (8, 6, 1, 1) and Grinder (20, 8, 2, 2), each with minBalance 0, a maxBalance of 800, 1500 or 4000, a minSinkRatio of 0.4, 0.4 or 0.3, and maxUpkeepShare 0.5.
Copy your passing
challenges/work/economy_sim.luauintosrc/shared/EconomySim.luau. In the next lesson,EconomyModelfeeds it the real prices andlune run scripts/lune/economy-reportchecks everyeconomy.jsonrow before a balance change ships.You should see src/shared/EconomySim.luau matches your passing challenges/work/economy_sim.luau, with the Starts from comment replaced by a note that it is the finished version of the economy-design challenge.
In the simulator with rebuilds = 0, why can no repairPerDrill value make the Grinder healthy without starving Casual or Regular players?
Press 1 to 4 to choose, Enter to check.
Step 5 of 6
Currency splits and alternatives
Studios rarely rely on a single currency forever, because each currency answers a different design problem:
Other ways pros do this
| Option | What it is | When pros pick it | Trade-offs |
|---|---|---|---|
| Single soft currency (Beacon Yard m14-ship) | One Coin balance earned in drills and optionally topped up by a Robux Coin Pack. | Small games with simple shops and cooperative play where players never trade. | Every event boost or veteran hoard directly affects the same shop that paid Coin Packs buy from. |
| Soft currency + separate Event currency | Core drills pay Coins; Scrap Rush pays Event Tokens spent only in a temporary Event Shop. | Any live game running double-reward weekends or seasonal events (Roblox's recommended safeguard). | Needs a second balance field, HUD counter and end-of-event expiry rule. |
| Dual economy (Soft Coins + Premium Gems) | Gameplay earns Coins for core upgrades; Robux or rare milestones grant Gems for cosmetics and convenience. | Large games protecting cosmetic prestige and monetization from gameplay inflation. | Harder to explain to new players; can feel greedy if core power is locked behind Gems. |
Beacon Yard runs a 72-hour Scrap Rush weekend. According to Roblox's virtual economy guide, what is the safest way to keep the event exciting without inflating the permanent Quartermaster shop?
Press 1 to 4 to choose, Enter to check.
Step 6 of 6
Challenges and recap
Fix checkHealth in this cell. It takes one player type's 30-day totals and the type's bands, and must report the first problem it finds in the same order as EconomySim.inTargetBands: a Sink Ratio below the floor is inflation, an ending balance above the cap is balance-high, and forced upkeep above half of income is starved. A month that spends almost everything it earns on things the player wants is ok.
Level 1, Apprentice
Challenge
Fix checkHealth in the sink-balance-check cell above so all four assertions pass.
- Start from
- The game at milestone m14 (download)
- Check it here
- Run the code cell; the challenge completes when it passes. No Studio needed.
Done means
- Returns false and 'inflation' when the Sink Ratio is below minRatio
- Returns false and 'balance-high' when the ending balance is above maxBalance
- Returns false and 'starved' when upkeep is more than half of earned
- Returns true and 'ok' for the shipped Regular month at a 0.99 Sink Ratio
- All four assertions in sink-balance-check pass
Take the same question to the spreadsheet, where you can see every total at once. In the downloadable CSV:
- Turn on a 3-day Scrap Rush (
EVENT_MULTIPLIER2,EVENT_DAYS3) and read the drop-table EV before and after the 2% Golden Rotor from the two Section 5 totals. Both tables must sum to1.00. - With
REBUILDS_PER_30_DAYSat 0, tryWRENCH_REPAIR_PER_DRILLfrom 1 to 30. Low values leave INFLATION, and high values STARVE the lighter players first. - Use
REBUILDS_PER_30_DAYSandEVENT_SHOP_PER_EVENT_DAYto bring every row to HEALTHY with the event on. With no event shop, 34 rebuilds is the smallest count that works (the Grinder ends near 3505 coins at a 0.92 ratio); the shipped model allows 80. - Write your tuned rows as a short JSON table in the shape of
data/economy.json.
Why does a per-drill wrench repair (4 coins per drill) fit Beacon Yard better than raising Speed's one-time price from 25 to 500 coins?
Press 1 to 4 to choose, Enter to check.
Retiring the analogy
You no longer need โa bathtub with taps and a drainโ. A live economy must be modeled per player archetype (casual, regular, hardcore, payer) over days and weeks. Healthy design matches sources with permanent and repeatable sinks for each cohort and isolates temporary events with their own sinks or event currency.
Recap
- Audit every Analytics.coinSource (pads, survival, crawlers, Coin Packs) and Analytics.coinSink before setting prices.
- Model Casual, Regular, Grinder and Payer rows separately; a total across all players hides starved newcomers and hoarding veterans.
- Compute Expected Value (sum of chance * payout, pity included) before launching any random drop or event, and isolate temporary events with an event currency or a matching event shop.
- Healthy means sources and sinks roughly match: Beacon Yard ships at a 30-day Sink Ratio of 0.94 to 1.00. Inflation is a ratio below the floor or a balance over the cap; starved is forced upkeep above half of income.
- Finite upgrades only delay inflation. Keep forced upkeep small and give players a repeatable sink they choose, like the Rebuild, then check every player type in Luau before a balance change ships.
Virtual economy sources and sinks is a bathtub with taps and a drain, until a bathtub holds one shared pool of water, whereas a game has thousands of separate player wallets; the server average can look healthy while newcomers are starved and veterans hoard ten thousand coins.
Queued for review
- Which of these create new coins (call Analytics.coinSource) in Beacon Yard at m14-ship?
- Creator Hub shows total sinks at 0.82 of total sources across all players, so the economy looks close to even. Yet veterans say coins are useless while Day-1 players say upgrades cost too much. Why did the total mislead you?
- A drill bonus roll pays 5 coins at 70%, 15 coins at 20%, and 30 coins at 10%. What is the Expected Value (EV) of one roll?
- In the simulator with rebuilds = 0, why can no repairPerDrill value make the Grinder healthy without starving Casual or Regular players?
- Beacon Yard runs a 72-hour Scrap Rush weekend. According to Roblox's virtual economy guide, what is the safest way to keep the event exciting without inflating the permanent Quartermaster shop?