Nico Rodriguez
August 9, 2023
January 16, 2024



The birth of CafeCosmos began with a simple question; "How could we create a restaurant simulation onchain?" This simple question has led us to create what we believe is the best play-to-earn system to date. For our players and holders, we wanted to bring what true Token Engineering should offer; a system built with ethics, sustainability and respect for its users.

I'd be lying if I said that the road was easy. This project has involved multiple spiritual awakenings, various notebooks and many current and past teammates. Finally, two years after our tireless mission began, we proudly present the first version of CafeCosmos.

With CafeCosmos, we aim to achieve a sustainable closed-loop token system where the players are the dominant force, and we are simply the stage setters. Above and beyond the rigour of our economic design or smart contract code, our most ambitious goal is to present a cultural revolution to the blockchain industry. We exist to deliver mind-blowing experiences, cutting the edge of reality with artistry, attention to detail, and, most of all, care for our users. With this, let's get right into how we built CafeCosmos: a cafe-building tycoon and, in doing so, fixed play-to-earn.


Solving Problems with Systems Thinking

CafeCosmos is a fully on-chain game; like everything in this world, it's a system.

What's a system? It's a combination of different elements (things) that come together (interconnect) and generate a behaviour (outcome) that is greater than the sum of its parts.

These elements, the things of the system, are actually systems themselves. Lo and behold, systems are made up of subsystems. The subsystems of a larger system are designed to help the whole achieve its mission. Systems are fractals. Zoom in and its systems all the way down until we get to some base layer like a quark.

Today we are going to look at a subsystem in CafeCosmos, how it goes wrong and how we fix it. In doing so, we offer a solution to the unsustainability of Play-to-Earn games.


We had a couple of reinforcing feedback loops that needed to be properly managed in the CafeCosmos System. What's a reinforcing feedback loop, you ask?

Reinforcing feedback loops keep going and going. They lead to exponential growth or decay by continuously reinforcing the current trend within a system. As you can imagine, reinforcing feedback loops need to be balanced. In the long run, left unchecked, they will drive most systems to ruin. Why? because every system has some eventual resource limit.

So we had a couple of systems in CafeCosmos that were reinforcing feedback loops without anything to balance it. The first system, which we will discuss today, is the reward system. This problem is not exclusive to CafeCosmos, and most play-to-earn games face the challenge of excessive value extraction. All games that allow for some sort of value to be extracted from the system (like selling a token that's been earned) need to balance the amount of value being extracted with the amount of value entering the system. If not, like a hot ponzi balloon, it will explode when you poke it with a sharp needle.

This is why it's important, in system/network design, to map the flow of value in the system and understand where it enters and where it exits. So we know for CafeCosmos that value is entering the game when players buy land. Value can be extracted from the game when players cook recipes and earn STKRP Tokens.

Most play-to-earn games have a Reinforcing Feedback Loop that looks like this:

The more players play the game → The more rewards are given to players

The more rewards are given to players → The more value they can extract from the system

The more value they can extract from the system → The more players play the game, and the cycle continues until it crashes.

"Don't hate the player, hate the game" This is not a player's problem; rather, it's an economic and incentive design problem… it's a SYSTEM STRUCTURE problem. Pro-Tip the structure of the system creates the behaviour of the system.

So while infinite rewards and more players sounds pretty cool… if this isn't balanced with some measure of the value coming into the system or limited on what can leave the system, CafeCosmos would soon be sucked dry of liquidity, the tokens will lose all value and the pool will be cold.

The Redistribution Mechanism.


To solve the problem created by the rewards system reinforcing feedback loop, we added limits, delays and buffers. We created a new subsystem that balances the rewards system. This subsystem is a Balancing Feedback Loop.

Balancing Feedback Loops work in tandem with Reinforcing Feedback Loops. They keep things in check within healthy boundaries so the system can remain in a sustainable range.

The Redistribution Mechanism's goal is to balance the amount of value that can be extracted from the system with the amount of value entering the system.

When developing this, our thought process was simple. Tokens in equals tokens out. Value CANNOT be created out of nowhere.

In play to earn, historically, the system has worked as a casino where the house always loses. Imagine a blackjack table where the player has a higher chance of winning than the casino. We wanted to exterminate the casino. The redistribution mechanism is a poker table rather than a slot machine. It redistributes rewards rather than subsidizing them with liquidity.

Here's the play-by-play before we jump into the math and modelling of the newborn mechanism.

In CafeCosmos, players can earn STKRP tokens through the Dividend Pools that reward players when they cook recipes. But where do these tokens come from

1. Tokens collected from Land Purchases fortify our Master Pool.

- Here, we add a limit on the source of rewards.

1. Over time, the Master Pool accumulates tokens, strengthening the system.

- Here, we created our buffer that accumulates a stock of tokens over time.

1. At set intervals, referred to as the 'X' period, a portion of the tokens are released from the Master Pool.

- Here, we leverage delays to give the system time for accumulation and dispersal.

1. These tokens are then gradually disbursed to the dividend pools over this 'X' period via a drip-rate.

- Here, we ensure there are always tokens vested to be rewarded by creating a drip rate over X period.

1. Best of all, we can adjust the allocation to each pool as required.

- Here, we add customization to our mechanism that allows us to add weight to our dividend pools that will be useful in the future.

There you have it. Welcome to the efficient world of CafeCosmos' Redistribution Mechanism!

Now up next is math. Why math? Well, once we've ideated on the features of a mechanism, we need to formally define it in a way that developers can implement in smart contracts… so math… but it's pretty easy. We've also provided a neat Machinations model.

Machinations ModelYou can watch a model of this beauty in action or play with it directly in Machinations :…

RDM MATHIn this four-part math series, we see how tokens flow from the Master Pool to the Dividend Pools to ultimately end up in the wallets of players who are winning.

Token Accumulation Equation


Our Master Pool is like a dam. It collects tokens from two rivers: Direct Contributions (DCON) and Land Purchases (LAND).

Key Variables:

TOTL: The reservoir of tokens in the Master Pool

DCON: The inflow of tokens from direct contributions

LAND: The stream of tokens from land purchases

Token Distribution Equation


Every so often (X period), the dam's gates open. A certain percentage (PERC) of the accumulated tokens (TOTL) gets released but not all the tokens. The delay between X, alongside the accumulation of tokens in the Master Pool over time, provides a buffer for the reward system to better weather droughts in activity.

Key Variables:

DIST: The tokens getting ready for a journey from the Master Pool

PERC: The percentage of tokens that get to start the journey each time. This value ranges from 0 to 1. For example, PERC = 0.1 means 10% of TOTL tokens get to leave the Master Pool each round.

X: The frequency at which the journey happens, i.e., the release of tokens from the Master Pool.

Drip Amount Equation


Once the tokens leave the dam, they go to different dividend pools (DRIPi). The share each pool gets depends on an adjustable factor (ADJi).

Key Variables:

DRIPi: Tokens going to dividend pool i during a time period X.

ADJi: An adjustable knob that dictates the share of tokens each pool gets.

DIST: The tokens that were just released from the Master Pool.

Important Rule: Sum(ADJi) = 1 for all pools i from 1 to n.

This ensures that all tokens set for distribution are indeed distributed across the various pools.

If the sum of ADJi was less than 1, not all tokens would be distributed.

If it was more than 1, we would be trying to distribute more tokens than we have released.

Drip Rate Equation

DripRATEi = DRIPi / xRate

Tokens take their time. They don't rush into the pools all at once. Instead, they drip at a certain rate (DripRATEi) based on the total tokens to distribute (DRIPi) and the duration (xRate).

Key Variables:

xRate: The total duration of the token dripping process (in seconds). This corresponds to X, the schedule at which tokens are released.

DripRATEi: The speed at which tokens flow into each dividend pool.


TLDR: The Redistribution Mechanism balances the amount of value that can be extracted from players in the game by balancing it with the value they actually bring to the game. It's simple and elegant. Now let's take a look at this in action with a simple example.


Token Accumulation

Assuming the following values:

- DCON = 200 tokens

- LAND = 500 tokens

The total tokens accumulated in the master pool can be calculated as follows:

TOTL = DCON + LAND = 200 + 500 = 700 tokens

Hence, the master pool currently holds a total of 700 tokens.

Token Distribution

Assuming the following values:

- TOTL = 700 tokens (from Example 1)

- PERC = 0.1 (indicating 10% of tokens to be distributed)

- X = 3600 seconds (1 hour)

The total tokens to be distributed (DIST) during this hour can be calculated as follows:

DIST = PERC * TOTL = 0.1 * 700 = 70 tokens

Therefore, 70 tokens will be distributed from the master pool during this hour.

Token Dripping to Dividend Pools

Assuming the following values:

- DIST = 70 tokens

- ADJi = {0.4, 0.3, 0.3} (representing three dividend pools with adjustable factors)

- X = 3600 seconds (1 hour)

The amount of tokens dripped to each dividend pool during the hour can be calculated as follows:

- DRIP1 (dividend pool 1) = ADJ1 * DIST = 0.4 * 70 = 28 tokens

- DRIP2 (dividend pool 2)= ADJ2 * DIST = 0.3 * 70 = 21 tokens

- DRIP3 (dividend pool 3) = ADJ3 * DIST = 0.3 * 70 = 21 tokens

Drip Rate Calculation

Assuming the following values:

- DRIP1 = 28 tokens

- DRIP2 = 21 tokens

- DRIP3 = 21 tokens

- xRate = 3600 seconds (1 hour)

The drip rate for each dividend pool can be calculated as follows:

- DRIP_RATE1 = DRIP1 / xRate = 28 / 3600 ≈ 0.0078 tokens/second

- DRIP_RATE2 = DRIP2 / xRate = 21 / 3600 ≈ 0.0058 tokens/second

- DRIP_RATE3 = DRIP3 / xRate = 21 / 3600 ≈ 0.0058 tokens/second


We solved play to earn's unsustainability paradigm.

The game itself is the Larger System with the big audacious goal.

In our case, CafeCosmos is the larger system discussed here today. It is made up of smaller sub-systems (like the rewards & redistribution mechanism) that are independent, interconnected and supportive of the larger system.

Making CafeCosmos has revolved around a common theme; Token Engineering. What sprung up as an idea from hanging around the Token Engineering Academy has now turned into an advanced economic structure that solves the play-to-earn equation.

Where do we go from here?

CafeCosmos has been a feat in token systems and graphic design. StarkPlay is a company that performs these two functions to their maximum optimization over onchain games. Design + Token Engineering.

If you dig into token engineering, it's about storytelling—the story of how multiple parties collaborate (or don't) over limited resources. The Economic Game is where we see the inevitable future of onchain games. As we head into this upcoming halving, we will see the economics of onchain games start to matter more and more. Of course, the same mistakes will be committed, and of course, ponzies will rise and explode. Yet, the mission has been clear from Day 1: At StarkPlay, we build economic systems that can last 100 years.

We predict that the Redistribution and Climate mechanisms will become standardized, paving the way for economic games to balance in sane and scalable ways. We look forward to seeing the innovation that springs up from these.

To learn more about the Climate Mechanism check out our recent article:…