Original author: CaptainZ
When we describe the revolutionary impact of a product, technology or innovation in a particular industry, we like to say that this is the "iPhone moment" of the industry. This is based on the profound impact that the iPhone had on the entire mobile phone and mobile computing industry after Apple released it in 2007.
In the DeFi industry, we call it the "AMM moment". Because the AMM model plays a key role in the DeFi field, especially in improving market liquidity, it directly contributed to the arrival of the bull market in 2021. So, what is the "AMM moment" of the full-chain game? Let's find out in this article.
DeFi is a combination of blockchain technology and the financial field, that is, writing financial rules into smart contracts to achieve decentralization, privacy and automation. Since it is in the financial field, what is the most critical thing for various projects? Obviously, it is "liquidity". For example, the three major business models, lending, trading and payment (stable currency business), cannot be carried out continuously without liquidity.
1. Lending: Liquidity is the core of the lending business. Banks and other financial institutions rely on short-term deposits and other sources of funds to provide long-term loans. If financial institutions cannot ensure sufficient liquidity, they may not be able to meet customers' loan needs or may face difficulties when they need to repay short-term debts. Liquidity risk is a key factor in financial crises. When banks cannot obtain sufficient funds to meet their loan commitments, they may collapse.
2. Trading: In the capital market, liquidity is the key to trading. High liquidity means that assets can be bought and sold quickly without losing value. If a market or asset lacks liquidity, investors may face larger bid-ask spreads or have difficulty finding buyers when they want to sell assets. This can lead to sharp price fluctuations and market instability.
3. Payment (stable currency): The liquidity of the payment system (stable currency) is crucial. When people or businesses need to transfer funds, they rely on efficient and reliable payment systems. If the payment system (stablecoin) lacks liquidity, it may cause payment delays or failures, which will affect the operation of the entire economy.
In Web3, transactions are the core of financial business, because lending and payments exist to serve transactions (leverage and act as a medium of exchange). So why is there an "AMM moment"? This is due to the performance limitations of the blockchain itself.
We know that the financial rules of centralized financial institutions are placed on their own high-performance servers, so the matching efficiency is extremely high. DeFi puts financial rules in smart contracts, sacrificing matching efficiency and bringing the advantages of decentralization and privacy.
As a simulation of the "world computer" layer, the performance of smart contracts is relatively low. In the initial DeFi projects, whether it is lending or exchanges, the matching method is based on the order book model of traditional finance. In this model, DeFi has no power to fight back in front of CeFi until the emergence of AMM.
How to use the ultra-low-performance "world computer" to greatly improve the matching efficiency of liquidity? The solution of the AMM model is to use a capital pool and an algorithm for automatic matching. There are many articles that introduce the specific gameplay, so I will not discuss it here. In terms of advantages, we now know:
1. No need for traditional market makers: In traditional financial markets, market makers usually need to provide quotes for buy and sell orders to ensure market liquidity. The AMM model allows liquidity providers to deposit funds into a smart contract that automatically adjusts prices and executes trades based on a predetermined algorithm, eliminating the need for traditional market makers to intervene.
2. Liquidity Pools: Liquidity pools in the AMM model provide traders with an always-available counterparty. Liquidity providers can deposit funds into these pools and receive transaction fees in return, thereby incentivizing more people to participate and improving market liquidity.
3. Reduced Transaction Friction: Due to the automated nature of AMM, traders can trade at any time without waiting for traditional buy and sell orders to match, thereby reducing transaction friction.
4. Promoting DeFi Innovation: The AMM model has brought many new innovations to the DeFi field, such as liquidity mining, dual-currency liquidity pools, etc. These innovations have further promoted the development and popularity of DeFi.
The innovation of AMM mechanism actually made DeFi's liquidity matching efficiency comparable to CeFi, and finally brought DeFi Summer.
Now the full-chain game has come to the same moment as DeFi: How to run a game on a "world computer" with extremely low performance? This requires an in-depth analysis of the essential contradiction between games and blockchain.
I once wrote an article "What is the difference between ARC and ECS in the full-chain game engine architecture?, in which the concept of game loop is introduced, and it is pointed out that traditional games are loop-based.
Traditional games are loop-based because their core operating mechanism is the game loop. The game loop is a repetitive process that usually includes the steps of processing user input, updating the game state, and rendering the game world. This loop continues during the game, usually running dozens to hundreds of times per second to keep the game world smooth. In this architecture, game systems (such as physics engines, AI systems, etc.) check and process the game entities and components they care about in each loop.
However, the architecture of blockchain is push-based. Blockchain is a distributed database that shares and stores information through nodes in the network. When a node generates a new transaction (such as transfer, contract call, etc.), the transaction will be pushed to the network, and other nodes will verify it and add it to the blockchain after receiving it. This is a passive process. The node will not actively look for new transactions, but wait for other nodes in the network to send new transactions. Therefore, the architecture of blockchain is called push-based.
In fact, this paragraph has answered the above question. The game architecture is generally loop-based, while the blockchain architecture is push-based. This is the essential contradiction between games and blockchains. So how to resolve this contradiction? It can be said that as long as this contradiction is resolved, the "AMM moment" of the full-chain game will come.
To further this discussion, let's look at how games implement a game loop.
Every game consists of a sequence of getting user input, updating the game state, handling AI, playing music and sound effects, and displaying the game. This sequence is handled by the game loop. We won't discuss any of these tasks in detail for now, but instead focus on the game loop itself, so we can simplify the task to just two functions: updating and displaying the game. Below is the sample code for the simplest form of a game loop:
bool game_is_running = true;
while( game_is_running ) {
update_game();
display_game();
}
First, let's introduce three terms:
Tick
Tick is a synonym (onomatopoeia) for game loop, 1 tick = 1 game loop
FPS
FPS is the abbreviation for Frames Per Second. In the context of the above implementation, it is the number of times display_game() is called per second.
Game Speed
Game speed is the number of times the game state is updated per second, or in other words, the number of times update_game() is called per second.
To summarize, Tick/Game Loop is the basic cycle of the game, which determines how the game logic is updated. FPS is the number of frames rendered per second, which determines the visual smoothness of the game. Game speed is how the game logic progresses, which is usually equal to the tick rate. In an ideal situation, the tick rate, FPS, and game speed should all be equal, which means that there will be a corresponding rendering after each logic update. But in reality, these three may be different, especially in performance-constrained or other technical limitations.
With the above understanding, we can now discuss the core challenges in full-chain games.
1. Mismatch between game loop and blockchain: Traditional games are based on game loops, which means that the state of the game is updated in every tick or frame. However, blockchain is event-driven, and the update of the state is triggered only when there is a new transaction or operation. This basic mismatch does make it complicated to implement traditional game loops in full-chain games.
2. Delay and real-time: The transaction confirmation time of the blockchain may cause a delay in the response of the game, which is a problem for games that require fast response (such as action games or competitive games). An effective ticking mechanism needs to take this delay into account and minimize its impact on the game experience.
3. Resource constraints and computing costs: Each update of the state of the blockchain consumes computing resources and may incur fees. In full-chain games, frequent state updates may result in high fees. Therefore, an efficient ticking mechanism is needed to balance the smoothness and cost of the game.
If a new ticking mechanism or game loop model that adapts to the characteristics of the blockchain can be developed, this will indeed be an "AMM moment". This may require combining traditional game development techniques with the characteristics of the blockchain to create a completely new game framework.
So are all game types loop-based? Although most game types are indeed loop-based, there are also some "push-based" games that do not require continuous, real-time state updates. For example, turn-based strategy games, chess games, or certain card games. In these games, the state is only updated when the player takes an action, which is more similar to the event-driven model of the blockchain. Therefore, for full-chain games, it is indeed possible to consider first developing those games that are more in line with the "push-based" model, which can more naturally adapt to the characteristics of the blockchain.
Scott, the founder of Argus, also expressed the same view:
The game operates in a loop-driven runtime. Even without user input, state transitions will continue to occur. The fire continues to burn, the water continues to flow, the crops continue to grow, and the cycle of day and night continues.
So how can we design a ticking mechanism suitable for blockchain? @therealbytes gave the answer. I have translated his classic article "Let's run on-chain decentralized exchanges the way we run prediction markets", in which the famous constant product formula "A * B = k" was introduced for the first time.
(An interesting point: at that time, there was no such thing as DeFi, but it was just called On-chain decentralized exchange, just like we call full-chain games On-chain games now)
In this article, therealbytes should be the first to propose using the pre-compilation of the chain itself to implement ticking: Ticking-Optimism modifies the rollup node and creates a "tick transaction", which works in the same way as a "deposit transaction", but instead of setting the L1 attribute, it calls the tick() function in a contract pre-deployed to the address 0x420000000000000000000000000000000000000000A0. This contract can call another contract by setting its target variable.
Built-in the Ticking function into the chain's node, it is a huge improvement in loop efficiency. This can be completely compared to the huge improvement in matching efficiency of the AMM model compared to the Orderbook model in the DeFi industry. How huge is it? For data, please refer to another article I translated:
The above table compares the applications of blockchain in the financial and gaming fields. It can be seen that the two are indeed very similar. The Orderbook model used by DeFi at the beginning is an active matching system. After changing to AMM, it becomes a passive automatic matching system. Similarly, the full-chain game initially used conventional "lazy update" and "manual ticking" to perform active game loops. After changing to the precompiled tick chain, it became a passive automatic game loop. AMM improves financial liquidity, and tick chain improves the smoothness of the game.
Original link
Welcome to join the official BlockBeats community:
Telegram Subscription Group: https://t.me/theblockbeats
Telegram Discussion Group: https://t.me/BlockBeats_App
Official Twitter Account: https://twitter.com/BlockBeatsAsia