Index

A crypto Index provides a way for investors to gain diversified exposure to a specific basket of digital assets through a single tokenized product. These indices often track specific sectors, such as DeFi, DePIN, or RWA, and are automatically rebalanced via smart contracts. In 2026, AI-managed thematic indices have become the gold standard for passive investing, allowing users to track the "blue chips" of the Web3 economy without manual portfolio management. This tag covers index methodology, rebalancing frequency, and the benefits of diversified crypto baskets.

25654 Articles
Created: 2026/02/02 18:52
Updated: 2026/02/02 18:52
Crypto Fear & Greed Index: Crucial Shift Unveils Neutral Market Sentiment

Crypto Fear & Greed Index: Crucial Shift Unveils Neutral Market Sentiment

BitcoinWorld Crypto Fear & Greed Index: Crucial Shift Unveils Neutral Market Sentiment Ever wonder how investors truly feel about the rollercoaster world of cryptocurrencies? The latest data from the Crypto Fear & Greed Index offers a fascinating glimpse, revealing a significant shift. This crucial barometer of market sentiment has just fallen four points, moving from “Greed” to a more balanced “Neutral” territory. This shift, reported by data provider Alternative, signals a noticeable cooling in investor enthusiasm and a potential period of re-evaluation for the market. What Does a Neutral Crypto Fear & Greed Index Signal? The Crypto Fear & Greed Index operates on a straightforward scale, where 0 indicates ‘Extreme Fear’ and 100 signifies ‘Extreme Greed.’ A reading of 51, as we’ve seen, places it precisely in the middle: ‘Neutral.’ This means the market is currently experiencing a balance between the two extremes. Historically, extreme fear often presents buying opportunities when assets are undervalued due to panic selling. Conversely, extreme greed can signal an overheated market, potentially preceding a correction as assets become overvalued. The current neutral stance suggests neither overwhelming optimism nor widespread panic. Instead, investors appear to be taking a more cautious, wait-and-see approach. This phase can be characterized by reduced volatility and a focus on fundamentals rather than speculative fervor. Understanding this shift is vital for making informed decisions. How is the Crypto Fear & Greed Index Calculated? To truly appreciate the insights offered by the Crypto Fear & Greed Index, it’s important to understand its sophisticated methodology. This index isn’t based on a single metric but aggregates data from six key factors, each contributing a specific weight to the final score. This comprehensive approach ensures a holistic view of market sentiment. Here’s a breakdown of the components that contribute to the index’s daily calculation: Volatility (25%): This measures current Bitcoin price fluctuations and maximum drawdowns, comparing them to average values over 30 and 90 days. High volatility often signals fear and uncertainty. Trading Volume (25%): Analyzes current market momentum and liquidity. High buying volume in a rising market might indicate greed, while low volume can suggest fear. Social Media Mentions (15%): Scans specific crypto-related hashtags and sentiment on platforms like Twitter. Increased positive sentiment often suggests greed, while negative sentiment points to fear. Surveys (15%): Although currently paused, these polls previously gauged investor sentiment directly, providing a snapshot of public opinion. Bitcoin Dominance (10%): An increase in Bitcoin’s market cap share often signals fear, as investors might be moving from altcoins to the perceived safety of Bitcoin. A decrease suggests more speculative altcoin interest (greed). Google Search Volume (10%): Tracks search queries related to Bitcoin and other cryptocurrencies. Sudden spikes in searches for terms like “Bitcoin price manipulation” could indicate fear, while “how to buy crypto” might suggest rising interest (greed). Navigating the Neutral Zone: Strategic Insights for Investors The current neutral reading of the Crypto Fear & Greed Index provides a unique environment for investors. It’s a time when emotional extremes are less dominant, potentially leading to more rational market behavior. This period offers distinct opportunities for those willing to adapt their strategies. Consider these strategic insights: Reduced Emotional Trading: Neutral sentiment often correlates with less impulsive decision-making, encouraging more rational analysis of market conditions. Consolidation Periods: Markets in a neutral state frequently undergo periods of price consolidation, where assets trade within a defined range. This can be an opportune time for dollar-cost averaging or re-evaluating portfolio allocations. Opportunity for Due Diligence: Without the overwhelming pressure of extreme fear or greed, investors have a clearer headspace to research projects thoroughly, assess their underlying fundamentals, and refine long-term strategies. Vigilance is Key: While neutral, the market can quickly swing. Staying informed about broader macroeconomic factors, regulatory news, and project-specific developments remains crucial for anticipating future shifts. Why This Crucial Index Matters for Your Crypto Journey The Crypto Fear & Greed Index serves as more than just a daily snapshot; it’s a powerful tool for understanding the underlying psychology driving market movements. By offering a quantitative measure of sentiment, it helps investors gain invaluable perspective and avoid common pitfalls. It highlights the cyclical nature of crypto markets, which often oscillate between periods of intense optimism and profound pessimism. Recognizing these shifts can empower individuals to make more informed, less emotionally driven decisions, potentially avoiding the classic mistake of buying high and selling low. Ultimately, this index encourages a disciplined approach, reminding us that even in a volatile asset class like cryptocurrency, understanding human behavior is paramount to long-term success. The recent shift of the Crypto Fear & Greed Index to ‘Neutral’ territory marks a significant moment for crypto investors. It signals a temporary reprieve from the extremes of market emotion, offering a period of relative calm and reflection. While this neutrality doesn’t predict future price movements with certainty, it provides a valuable lens through which to view market psychology and refine investment strategies. Staying informed, rational, and disciplined remains the best approach in this dynamic and ever-evolving landscape. Frequently Asked Questions (FAQs) Q1: What is the Crypto Fear & Greed Index? A: It’s a tool that measures the current sentiment of the cryptocurrency market, ranging from 0 (Extreme Fear) to 100 (Extreme Greed), based on various market factors. Q2: How does a “Neutral” reading impact my crypto investments? A: A neutral reading suggests a balanced market without extreme emotional bias. It encourages rational decision-making, due diligence, and can be a period of market consolidation rather than sharp price swings. Q3: Is the Crypto Fear & Greed Index a reliable predictor of price? A: While it reflects market sentiment, it’s not a direct price predictor. It’s a valuable indicator to understand investor psychology, which can influence market trends, but it should be used in conjunction with other analyses. Q4: What factors contribute to the index’s calculation? A: It’s calculated using volatility, trading volume, social media mentions, surveys (historically), Bitcoin dominance, and Google search volume, each with a specific weighting. Q5: Where can I find the current Crypto Fear & Greed Index value? A: The index is publicly available from data providers like Alternative, which regularly updates its value based on real-time market data. Did you find this analysis of the Crypto Fear & Greed Index helpful? Share this article with your friends and fellow crypto enthusiasts on social media to help them navigate market sentiment and make more informed decisions! To learn more about the latest crypto market trends, explore our article on key developments shaping Bitcoin price action. This post Crypto Fear & Greed Index: Crucial Shift Unveils Neutral Market Sentiment first appeared on BitcoinWorld and is written by Editorial Team

Author: Coinstats
CoinDesk 20 Performance Update: Avalanche (AVAX) Gains 5.2% as Nearly All Assets Rise

CoinDesk 20 Performance Update: Avalanche (AVAX) Gains 5.2% as Nearly All Assets Rise

The post CoinDesk 20 Performance Update: Avalanche (AVAX) Gains 5.2% as Nearly All Assets Rise appeared on BitcoinEthereumNews.com. CoinDesk Indices presents its daily market update, highlighting the performance of leaders and laggards in the CoinDesk 20 Index. The CoinDesk 20 is currently trading at 4055.49, up 1.6% (+65.75) since 4 p.m. ET on Tuesday. All 20 assets are trading higher. Leaders: AVAX (+5.2%) and BCH (+3.4%). Laggards: POL (+0.0%) and APT (+0.6%). The CoinDesk 20 is a broad-based index traded on multiple platforms in several regions globally. Source: https://www.coindesk.com/coindesk-indices/2025/09/03/coindesk-20-performance-update-avalanche-avax-gains-5-2-as-all-assets-rise

Author: BitcoinEthereumNews
Ukraine Parliament Approves First Reading of Crypto Legalization Bill

Ukraine Parliament Approves First Reading of Crypto Legalization Bill

TLDR Ukraine’s parliament passed a bill to legalize and tax cryptocurrencies, including 18% income tax. The new crypto taxation bill proposes a 5% military tax on digital asset profits. Ukraine ranks 8th globally in crypto adoption, making the bill a key economic move. The bill also introduces a temporary 5% tax rate on fiat conversions [...] The post Ukraine Parliament Approves First Reading of Crypto Legalization Bill appeared first on CoinCentral.

Author: Coincentral
Reverse-takeover DATs are a grab bag of risks for investors

Reverse-takeover DATs are a grab bag of risks for investors

The post Reverse-takeover DATs are a grab bag of risks for investors appeared on BitcoinEthereumNews.com. This is a segment from The Breakdown newsletter. To read more editions, subscribe  “It’s unwise to pay too much, but it’s worse to pay too little.” — John Ruskin The half-life of a market opportunity is a function of the frictions involved in exploiting it. A business opportunity like selling GPUs might last forever because GPUs and the proprietary software needed to run them are hard to make. A financial opportunity like arbitraging a stock across exchanges might last just a fraction of a second because trading on stock exchanges is easy. Digital asset treasury companies (DATs) are somewhere in between. There’s currently a mad rush of new DATs seeking to arbitrage the premium that investors are willing to pay for crypto tokens held by an exchange-listed company. But it takes months for a company to get listed on exchanges, so despite all the new entrants, the window of opportunity has not yet been closed. Everyone expects it will be soon though, so only those fastest to market are likely to profit. Getting there via an IPO is out of the question — wrangling all the lawyers and bankers, getting approved by the SEC, and marketing a deal to investors can take a year or more. A SPAC listing is faster — it might compress the listing process down to six months or so, as several DATs are currently attempting. They still might not make it in time. The premium for exchange-listed crypto (as measured by mNAV) is already shrinking — before any of the proposed SPAC deals have even been finalized.  So to get a new company listed on the stock exchange before the DAT opportunity is arbitraged away, the only option may be to acquire a company that’s already on the stock exchange. This is creating some strange exposures…

Author: BitcoinEthereumNews
Ripple (XRP) Launches New Project with Ambitious Entry into the Gaming Industry! Here Are the Details

Ripple (XRP) Launches New Project with Ambitious Entry into the Gaming Industry! Here Are the Details

The post Ripple (XRP) Launches New Project with Ambitious Entry into the Gaming Industry! Here Are the Details appeared on BitcoinEthereumNews.com. Ripple (XRP), the fourth-largest cryptocurrency in the global market, has taken an ambitious step into the gaming industry by launching its own private L3 chain on B3’s open consumer ecosystem. Along with this initiative, XRP announced its own dedicated gaming chain and platform, dubbed Xcade. XRP Launches New Gaming-Focused Chain Xcade The project’s most striking feature is its aim to build a gaming ecosystem that directly appeals to users. With this move, XRP aims to become a major player not only in financial transfers but also in blockchain-based games. B3 announced that revenue generated within the ecosystem will be used to repurchase B3 tokens. This aims to create a cyclical model that supports value growth within the token economy. Its previous collaboration with SuperGaming attracted attention. B3 successfully launched on GameChain, demonstrating its infrastructure strength and integration potential with Web2 gaming companies. This experience demonstrated B3’s ability to expand its consumer application ecosystem. B3’s current market capitalization stands at $71.4 million. XRP’s new chain move signals that gaming and blockchain integration will gain momentum in the crypto market. Experts believe that XRP, along with Xcade, will be able to attract not only crypto users but also traditional gaming communities to the ecosystem, which will contribute to the growth of both XRP and the B3 ecosystem in the long run. *This is not investment advice. Follow our Telegram and Twitter account now for exclusive news, analytics and on-chain data! Source: https://en.bitcoinsistemi.com/ripple-xrp-launches-new-project-with-ambitious-entry-into-the-gaming-industry-here-are-the-details/

Author: BitcoinEthereumNews
GBP/USD rises to 1.3440 as strong UK data offsets US weakness

GBP/USD rises to 1.3440 as strong UK data offsets US weakness

The post GBP/USD rises to 1.3440 as strong UK data offsets US weakness appeared on BitcoinEthereumNews.com. GBP/USD rebounds from 1.3332 lows 1.3442 as US Dollar slips after Tuesday’s sharp rally above DXY 98.50. US JOLTS report shows July job openings fell sharply, highlighting tariffs’ drag on hiring and manufacturing weakness. UK Services PMI jumps to 54.2, easing fiscal worries, while BoE officials stress inflation risks and policy caution. The GBP/USD advances during the North American session up by 0.39% following the release of economic data from the United States (US). Also, fears of the UK’s government being unable to meet its fiscal requirements eased on signs that the economy continued to fare well. The pair trades at 1.3442 after bouncing off daily lows of 1.3332. Sterling gains 0.39% after upbeat UK Services PMI tempers fiscal fears, while weak US jobs data pressures Dollar The Greenback is weakening on Wednesday following Tuesday’s rally, which sent the US Dollar higher, past the 98.50 figure during the session, according to the US Dollar Index (DXY). US data revealed that job openings in July fell to 7.181 million down from 7.437 million in June, revealed the Bureau of Labor Statistics (BLS). The data revealed that hiring increased by 41K and layoffs increased to 12K. Economists blame the ongoing slowdown in the jobs market on US President Donald Trump’s tariffs. Other data showed that Factory Orders in Jully fell -1.3% MoM better than the expected -1.4% contraction. Today’s report, coupled with Tuesday’s ISM Manufacturing PMI contracting for the sixth consecutive month, suggests that manufacturing activity continues to deteriorate. Eyes will be on the release of Nonfarm Payroll figures on Friday. Estimates suggest that the US economy created 75K jobs in August, and an uptick in Unemployment Rate. Across the pond, strong Services PMI in the UK, tempered fears of the government’s ability to show fiscal constraint ahead of the Autumn budget.…

Author: BitcoinEthereumNews
NASDAQ rallies on Alphabet surge, Dow Jones struggles with weak data

NASDAQ rallies on Alphabet surge, Dow Jones struggles with weak data

The post NASDAQ rallies on Alphabet surge, Dow Jones struggles with weak data appeared on BitcoinEthereumNews.com. NASDAQ Composite rallies as Alphabet surges over 8% to new all-time high. Most Dow Jones stocks are in decline as Factory Orders fell 1.3% in July. JOLTS Job Openings for July also showed a notable downtrend. Markets look ahead with worries over Friday’s Nonfarm Payrolls for August. The NASDAQ Composite (IXIC) holds onto a 0.76% gain on Wednesday morning following Alphabet (GOOGL) winning an antitrust court case that will allow it to keep paying Apple (AAPL) for prominence on the iPhone, driving up the latter’s share price as well. Meanwhile, despite Apple’s 2.75% advance, most Dow Jones Industrial Average (DJIA) stocks are trading starkly lower, especially following a bout of poor economic indicators. Factory Orders in July slumped -1.3%, which was slightly better than the consensus and better than June’s -4.8% reading. JOLTS Job Openings for July also underwhelmed, with 7.181 million openings, below a consensus figure of 7.4 million. The June JOLTS figure was also revised lower by 80K. This sent investors streaming into US Treasuries, which has pushed 10-Year and 30-Year yields down over 1% following Tuesday’s spike. The mid-week market is mixed as economy dims For now, the market has opted to forget about tariff uncertainty that initially sent equities lower on Tuesday. A federal appeals court called the Trump administration’s unilateral institution of import tariffs unconstitutional, arguing the mainstream perception that only the US Congress has the power to set tariffs. For now, the tariffs remain in place, but further courts will take up the case in October and later in the year, which could end up forcing the Trump administration to raise hundreds of billions of dollars to pay back previously collected tariffs to importers. This possibility could end up pushing Treasury yields much higher, coming on the back of existing large deficits. This reticence…

Author: BitcoinEthereumNews
Ethereum Spot ETFs Recorded Large Outflows While No Inflows! Here’s All the Data

Ethereum Spot ETFs Recorded Large Outflows While No Inflows! Here’s All the Data

The post Ethereum Spot ETFs Recorded Large Outflows While No Inflows! Here’s All the Data appeared on BitcoinEthereumNews.com. As volatility continues in crypto markets, Ethereum spot ETFs recorded a total net outflow of $135 million on September 2. According to SoSoValue data, none of the nine Ethereum spot ETFs saw inflows, while investors largely turned to selling. Ethereum Spot ETFs Experience $135 Million Outflow The largest outflow occurred through Fidelity’s FETH ETF. The fund saw $99.23 million in outflows in just one day, yet its historical net inflow stands at $2.66 billion. This suggests continued long-term interest, but increased short-term profit-taking. Bitwise’s ETHW ETF came in second. The fund lost $24.22 million in a single day. ETHW’s cumulative net inflow to date is $411 million. In total, Ethereum spot ETFs have a net asset value of $27.98 billion, representing 5.38% of Ethereum’s total market capitalization. Furthermore, the ETFs have historically seen cumulative net inflows of $13.37 billion. Analysts attribute the recent surge to a market correction and investor aversion to risk. However, with institutional demand remaining strong, Ethereum ETFs are expected to continue to play a significant role in the market in the long term. *This is not investment advice. Follow our Telegram and Twitter account now for exclusive news, analytics and on-chain data! Source: https://en.bitcoinsistemi.com/ethereum-spot-etfs-recorded-large-outflows-while-no-inflows-heres-all-the-data/

Author: BitcoinEthereumNews
JOLTS Job Openings decline to 7.18 million in July vs. 7.4 million anticipated

JOLTS Job Openings decline to 7.18 million in July vs. 7.4 million anticipated

The post JOLTS Job Openings decline to 7.18 million in July vs. 7.4 million anticipated appeared on BitcoinEthereumNews.com. The number of job openings on the last business day of July stood at 7.18 million, the US Bureau of Labor Statistics (BLS) reported in the Job Openings and Labor Turnover Survey (JOLTS) on Wednesday. This reading followed the 7.35 million (revised from 7.43 million) openings recorded in June and came in below the market expectation of 7.4 million. “Over the month, both hires and total separations were unchanged at 5.3 million. Within separations, both quits (3.2 million) and layoffs and discharges (1.8 million) were unchanged,” the BLS noted in its press release and continued: “The number of job openings decreased in health care and social assistance (-181,000); arts, entertainment, and recreation (-62,000); and mining and logging (-13,000).” Market reaction to JOLTS Job Openings data The US Dollar (USD) came under renewed selling pressure following this report. At the time of press, the USD Index was down 0.2% on the day at 98.10. US Dollar Price Today The table below shows the percentage change of US Dollar (USD) against listed major currencies today. US Dollar was the weakest against the Australian Dollar. USD EUR GBP JPY CAD AUD NZD CHF USD -0.26% -0.34% -0.09% 0.07% -0.39% -0.17% -0.13% EUR 0.26% -0.07% 0.17% 0.33% -0.26% 0.08% 0.12% GBP 0.34% 0.07% 0.24% 0.41% -0.18% 0.16% 0.20% JPY 0.09% -0.17% -0.24% 0.16% -0.38% -0.16% -0.02% CAD -0.07% -0.33% -0.41% -0.16% -0.54% -0.25% -0.21% AUD 0.39% 0.26% 0.18% 0.38% 0.54% 0.17% 0.38% NZD 0.17% -0.08% -0.16% 0.16% 0.25% -0.17% 0.04% CHF 0.13% -0.12% -0.20% 0.02% 0.21% -0.38% -0.04% The heat map shows percentage changes of major currencies against each other. The base currency is picked from the left column, while the quote currency is picked from the top row. For example, if you pick the US Dollar from the left column and move along…

Author: BitcoinEthereumNews
Optimizing the Ever-Growing Balance in an 11-Year-Old Game

Optimizing the Ever-Growing Balance in an 11-Year-Old Game

Hello! My name is Sergey Kachan, and I’m a client developer on the War Robots project. War Robots has been around for many years, and during this time the game has accumulated a huge variety of content: robots, weapons, drones, titans, pilots, and so on. And for all of this to work, we need to store a large amount of different types of information. This information is stored in “balances.” Today I’m going to talk about how balances are structured in our project, what’s happened to them over the past 11 years, and how we’ve dealt with it. Balances in the Project Like any other project, War Robots can be divided into two parts: meta and core gameplay. Meta gameplay (metagaming) is any activity that goes beyond the core game loop but still affects the gameplay. This includes purchasing and upgrading game content, participating in social or event activities. Core gameplay (core gameplay loop) is the main repeating cycle of actions that the player performs in the game to achieve their goals. In our case, it’s robot battles on specific maps. Each part of the project needs its own balance, so we also split balances into two categories — meta and core. War Robots also has so-called Skirmish modes, which require their own separate balances. A Skirmish mode is a modification of existing modes or maps with different characteristics or rules. Skirmish modes are often event-based, available to players during various holidays, mainly for fun. For example, players might be able to kill each other with a single shot or move around in zero gravity. So in total, we have 4 balances: 2 for the default mode and 2 for the Skirmish mode. \ \ Over 11 years, War Robots has accumulated a ton of awesome content: 95 robots 21 titans 175 different weapons 40 drones 16 motherships a huge number of skins, remodels, modules, pilots, turrets, ultimate versions of content, and maps And as you can imagine, to make all of this work we need to store information about behavior, stats, availability, prices, and much, much more. As a result, our balances have grown to an indecent size: | \ | Default mode | Skirmish mode | |----|----|----| | Meta balance | 9.2 MB | 9.2 MB | | Core balance | 13.1 MB | 13.1 MB | After some quick calculations, we found that a player would need to download 44.6 MB. That’s quite a lot! We really didn’t want to force players to download such large amounts of data every time a balance changed. And distributing that much data via CDN isn’t exactly cheap either. Just to remind you: War Robots has reached 300 million registered users. In 2024, our monthly active audience was 4.7 million people, and 690 thousand players logged in every day. Now imagine the amount of data. A lot, right? We thought so too. So, we decided to do everything we could to cut down the size of our balances! Hunting Down the Problem The first step was to analyze the balances and try to figure out: “What’s taking up so much space?” Manually going through everything was the last thing we wanted to do — it would’ve taken ages. So, we wrote a set of tools that collected and aggregated all the information we needed about the balances. The tool would take a balance file as input and, using reflection, iterate through all the structures, gathering data on what types of information we stored and how much space each one occupied. The results were discouraging: Meta Balance | \ | % in balance | Usage count | |----|----|----| | String | 28.478 % | 164 553 | | Int32 | 27.917 % | 161 312 | | Boolean | 6.329 % | 36 568 | | Double | 5.845 % | 33 772 | | Int64 | 4.682 % | 27 054 | | Custom structures | 26.749 % | — |
Core Balance | \ | % in balance | Usage count | |----|----|----| | String | 34.259 % | 232 229 | | Double | 23.370 % | 158 418 | | Int32 | 20.955 % | 142 050 | | Boolean | 5.306 % | 34 323 | | Custom structures | 16.11 % | — | \ After analyzing the situation, we realized that strings were taking up far too much space, and something had to be done about it. So, we built another tool. This one scanned the balance file and generated a map of all the strings along with the number of times each one was duplicated. The results weren’t encouraging either. Some strings were repeated tens of thousands of times! We had found the problem. Now the question was: how do we fix it? Optimizing the Balances For obvious reasons, we couldn’t just get rid of strings altogether. Strings are used for things like localization keys and various IDs. But what we could do was eliminate the duplication of strings. The idea was as simple as it gets: Create a list of unique strings for each balance (essentially, a dedicated storage). Send this list along with the data.
public class BalanceMessage {   public BalanceMessageData Data;   public StringStorage Storage;   public string Version; } \ StringStorage is essentially a wrapper around a list of strings. When we build the string storage, each balance structure remembers the index of the string it needs. Later, when retrieving data, we just pass the index and quickly get the value.
public class StringStorage { &nbsp;&nbsp;&nbsp;public List<string> Values; &nbsp;&nbsp;&nbsp;public string GetValue(StringIdx id) => Values[id]; } \ Instead of passing the strings themselves inside the balance structures, we began passing the index of where the string is stored in the string storage. Before:
public class SomeBalanceMessage { &nbsp;&nbsp;public string Id; &nbsp;&nbsp;public string Name; &nbsp;&nbsp;public int Amount; } \ After:
public class SomeBalanceMessageV2 { &nbsp;&nbsp;public StringIdx Id; &nbsp;&nbsp;public StringIdx Name; &nbsp;&nbsp;public int Amount; } \ StringIdx is basically just a wrapper around an int. This way, we completely eliminated direct string transfers inside the balance structures.
public readonly struct StringIdx : IEquatable<StringIdx> { &nbsp;&nbsp;private readonly int _id; &nbsp;&nbsp;internal StringIdx(int value) {_id = value; } &nbsp;&nbsp;public static implicit operator int(StringIdx value) => value._id; &nbsp;public bool Equals(StringIdx other) => _id == other._id; } \ This approach reduced the number of strings by tens of times.
| \ | String usage count | String usage count | |----|----|----| | | Before | After | | Meta balance | 164 553 | 10 082 | | Core balance | 232 229 | 14 228 | Not bad, right? But that was just the beginning — we didn’t stop there. Reworking the Data Protocol For transmitting and processing balance structures, we had been using MessagePack. MessagePack is a binary data serialization format designed as a more compact and faster alternative to JSON. It’s meant for efficient data exchange between applications or services, allowing a significant reduction in data size — especially useful where performance and bandwidth matter. Initially, MessagePack came in a JSON-like format, where the data used string keys. That’s certainly convenient, but also quite space-consuming. So we decided to sacrifice some flexibility and switch to a binary byte array. Before:
public class SomeBalanceMessage { &nbsp;&nbsp;[Key("id")] &nbsp;&nbsp;public string Id; &nbsp;&nbsp; &nbsp;&nbsp;[Key("name")] &nbsp;&nbsp;public string Name; &nbsp;&nbsp; &nbsp;&nbsp;[Key("amount")] &nbsp;&nbsp;public int Amount; } \ After:
public class SomeBalanceMessageV2 { &nbsp;&nbsp;[Key(0)] &nbsp;&nbsp;public StringIdx Id; &nbsp;&nbsp; &nbsp;&nbsp;[Key(1)] &nbsp;&nbsp;public StringIdx Name; &nbsp;&nbsp; &nbsp;&nbsp;[Key(2)] &nbsp;&nbsp;public int Amount; } \ We also removed all empty collections — instead of sending them, we now transmit null values. This reduced both the overall data size and the time required for serialization and deserialization. Testing the Changes A golden rule of good development (and one that will save you a lot of nerves) is to always implement new features in a way that lets you quickly roll them back if something goes wrong. For that reason, we add all new features behind “toggles.” To make this work, we had to support two versions of balances at the same time: the old one and the optimized one. During development, we needed to make sure that all data was transferred correctly. Old and new balances — regardless of format or structure — had to produce the exact same values. And remember, the optimized balances had changed their structure drastically, but that wasn’t supposed to affect anything except their size. To achieve this, we wrote a large number of unit tests for each balance. At first, we compared all fields “head-on” — checking every single one explicitly. This worked, but it was time-consuming, and even the smallest change in the balances would break the tests, forcing us to rewrite them constantly. This slowed us down and was quite distracting. Eventually, we had enough of that and came up with a more convenient testing approach for comparing balances. Reflection came to the rescue again. We took two versions of the balance structures, e.g. SomeBalanceMessage and SomeBalanceMessageV2, and iterated over them — comparing field counts, names, and values. If anything didn’t match, we tracked down the problem. This solution saved us a huge amount of time later on. Optimization Results Thanks to these optimizations, we managed to reduce both the size of the files transmitted over the network and the time it takes to deserialize them on the client. We also decreased the amount of memory required on the client side after balance deserialization. File Size | \ | Old balances | Optimized balances | Profit | |----|----|----|----| | Meta balance | 9.2 MB | 1.28 MB | - 86 % | | Core balance | 13.1 MB | 2.22 MB | - 83 % | Deserialization Time | \ | Old balances | Optimized balances | Profit | |----|----|----|----| | Meta balance | 967 ms | 199 ms | - 79 % | | Core balance | 1165 ms | 265 ms | - 77 % | Data in Memory | \ | Old balances | Optimized balances | Profit | |----|----|----|----| | Meta + Core | ~ 45.3 MB | ~ 33.5 MB | - 26 % | Conclusions The results of the optimization fully satisfied us. The balance files were reduced by more than 80%. Traffic went down, and the players were happy. To sum it up: be careful with the data you transmit, and don’t send anything unnecessary. Strings are best stored in unique storages to avoid creating duplicates. And if your custom data (prices, stats, etc.) also contains a lot of repetition, try packing those into unique storages as well. This will save you many megabytes — and a lot of money on maintaining CDN servers

Author: Hackernoon