Tokenomia Blog DeFi Onchain Economics Validation
17 minutes read

Table of contents

DeFi Onchain Economics Validation

Who will benefit from this case?

This use case may interest people near the final stages of releasing their token for the DeFi Project. They want to do an economic audit of the project to ensure its security from the economic side. This could be valuable for those interested in the elements analyzed in economic audits. It could also help those starting a project in the DeFi space. Understanding that nearly ready projects sometimes still need a thorough economic evaluation could be crucial for ensuring success post-launch. Also, for those interested in other simulation methods and who already have smart contracts, this process could offer insights and cut costs for future changes.

Who was our client, and what were his goals?

Our client is a digital asset management platform. It is made to empower global institutions, corporations, and private investors. It does this by offering easy and compliant access to both crypto and real-world assets. This platform is a link between traditional finance and the crypto realm. It empowers investors to easily move, trade, and protect their stablecoins on-chain.

This decentralized finance platform specializes in safeguarding stablecoins, making it the main point of the project. It ensures the security of stablecoins. This applies not only within other stablecoins but also in traditional market tools.

Their product, $token, safeguards stablecoins from depegging. Instead of managing many assets one by one, $token provides access to a diverse portfolio. It holds the top stablecoins by market relevance. This hedges risk. They offer a chance to diversify capital. This happens by exposure to various stablecoins and tools in the traditional market (T-Bills), instead of holding everything in a single stablecoin. $token is built on the Ethereum blockchain. It represents a new approach to investing in blockchain-based assets, by use of a rule-based portfolio strategy to reduce risk for investors. $token is an “Indicator Token.” It includes a portfolio of stablecoins like DAI, USDC, and USDT. It is rebalancing in response to changes in market conditions or if an underlying asset depegs.

Also, $token staking lets users generate passive income. They do this through diversified reinvestment strategies.

At the time of engagement with Tokenomia.pro, our client had smart contracts, with pre-programmed business logic and had already passed security audits.

DeFi Problems and Solutions:

Problem I: Lack of certainty about the correctness of economic mechanisms.

Tokenomia.pro Solution: An economic audit was done through on-chain simulations. It was done in hundreds of scenarios to check all the mechanisms.

Effect: Our investigation identified mechanisms like token burning and system balance depegging as significant factors that could jeopardize system functionality. Moreover, strategic recommendations have been formulated to address and mitigate these challenges effectively.

Problem II: Assessment of Financial Stability and Liquidity risks.

Tokenomia.pro Solution:We thoroughly analyzed smart contracts. We studied their dynamics and the relationships between their individual parts. We looked at various scenarios, including extreme cases. This was to ensure complete understanding and assessment.

Effect: In assessing the financial health of the project, we discovered that a critical insight emerges when the Adjusted Total Value Locked (aTVL) and staker rewards surpass actual returns from Treasury Bills. This discrepancy signals a potential risk to $token coverage, indicating an imbalance that could dilute liquidity and erode the foundation of the project’s asset stability.

Problem III: Lack of certainty about effectiveness of designed mechanisms under different scenarios. 

Tokenomia.pro Solution: Our approach involved creating a digital twin of our system to conduct simulations, allowing us to test and optimize strategies for more effective utilization of $token during depegging events.

Effect: Our analysis reveals a significant insight regarding the mechanism of token burning as a strategy to prevent depegging; its effectiveness is notably limited, particularly under scenarios when the system approaches its Lower Bound. This challenge is compounded by the observation that, although there exists a sufficient quantity of $tokens within one segment of the system, their utilization is suboptimal during significant depegging occurrences.

Client needs

This DeFi platform had existing smart contracts. They had built-in business logic and had already passed security audits. The audits included thorough technological analysis and code security checks. They chose to partner with Tokenomia.pro for an economic audit. They wanted to assess economic and financial security.

We used the TokenSPICE Python framework for on-chain validation. It let us test all mechanisms based on preexisting smart contracts. We tested them under various assumptions and scenarios to confirm the economic stability in the smart contract. We wanted to ensure the system could handle outside pressure without breaking. Our main goal was to see if there are times when things could go wrong in the system. We also wanted to see how well the mechanisms can handle depeg effects for a long time. 

The client required us to perform the following actions:

  1. Conduct on-chain system simulations using TokenSPICE to perform an economic audit and verify the smart contracts’ integrity.
  2. Assess how the system behaves under the influence of various external forces.
  3. Identify the most sensitive and resilient aspects of the system.
  4. Propose changes and recommendations based on simulation results.

Process flow

The work on the project took place mostly in our usual third phase.
We conducted on-chain validation of smartcontracs in the TokenSPICE environment.

DeFi System validation

We validate the project’s initial assumptions. We do this through comprehensive system analysis. This analysis includes simulations of user numbers, resource dynamics, and cryptocurrency price fluctuations. It also covers external environmental factors impacting the price. This phase includes thorough testing across hundreds of scenarios. It will assess the system’s reactions to diverse internal and external pressures. The goal is to find the needed adjustments. These changes will ensure the project can adapt to present and future demands. This encompasses secondary market behaviors and external factors such as stablecoin price movements.

Assets:

We based the simulations on the client’s vision and their ideas for the system’s function. We used them to examine how assets are linked and what dynamics and interactions they have. We made sure that no interactions disrupt the project.

$token $token is a stablecoin engineered to maintain a backing of at least $0.98 in collateral assets consistently. Its current price is the total dollar value of collateral assets divided by the quantity of $token in circulation at any moment.
Stablecoins A stablecoin is a type of cryptocurrency. It is designed to keep a steady value by pegging it to a stable asset. This asset could be fiat currency or commodities like gold. Common examples include USDC, USDT, and DAI. They are tied to the US dollar and used for transactions. They are also a safeguard against cryptocurrency market fluctuations.

Important terms:

Total Value Locked (TVL) shows how much money is invested in decentralized finance (DeFi). It helps us understand how big DeFi is and how fast it’s growing. 

Yield tells us how much profit we can make from staking tokens every year. It helps investors know what to expect from their investments. 

Sometimes stablecoins don’t stay stable. They can become worth more or less than they should be. This is called depegging

Mechanisms:

In particular, a set of tokenomic mechanisms has been determined, including:

Minting Users can mint $token by providing collateral assets. 
RebalanceThe $token system rebalances assets, by comparing their prices to set thresholds. Then it assigns weight values to adjust assets for balance based on specified conditions. It aims to keep a perfect balance. It does this by changing asset allocations based on market conditions.
BurningIn the case of depegging, $token is burned within set bounds. It draws from either the accumulated Total Value Locked (aTVL) or stake pool tokens. Burning aTVL assists in maintaining a collateralization ratio within specified limits, ensuring system stability.
StakingIn the $token system, users stake $token to receive LP tokens, entitling them to yield with a time-lock feature in place. This process lets users earn LP tokens by locking their $token. It offers exclusive arbitrage opportunities and a share of the system’s yield.
Unstaking Users can unstake by burning LP tokens. They will get $token based on the current price. Special cases and fees are determined by Arbitrage Threshold values. The unstake function in the $token system lets you redeem LP tokens (LPT) for $token. It uses a precise calculation to determine the amount of LPT burned for $token. The calculation uses the current LPT price and the unstaking fee. This approach balances user rewards and system sustainability.
Yield distributionYield is paid to stakers in the $token system. It aims for a higher return than holding collateral assets directly. The yield comes from transaction fees and other mechanisms. The distribution mechanism allocates yield based on total yield, tbill APR, count of tbills held as collateral, and fees. It benefits aTVL, team, and stakers under specific conditions.
RedemptionRedemption is a feature that allows users to withdraw stablecoins at any given moment by burning a token. In return, they receive three different stablecoins. This mechanism increases the system liquidity and usefulness. It gives users more flexibility to manage their assets and to reduce market risks.

Our Token Engineers thoroughly researched and analyzed each mechanism. They did so from an economic, math, and functional view to ensure it fits the system and is profitable.

When listing proposed tokenomic mechanisms, it is important to emphasize that our analysis goes beyond simple identification. We also ensure that even seemingly simple mechanisms get assessed for their role in the token ecosystem. 

Agents

In this case, we simulated many types of agents. And simulated their most expected behaviors. Also, we introduced various differences in the occurrence of these agents. This ranged from scenarios where agents participate in many different combinations. 

We differentiate between various types of stakers:

  1. Classic Staker: We assume that a portion of all staked tokens is consistently staked. Even in a depeg, agents do not withdraw them.
  2. Early Unstaking Staker: We assume that some staked tokens are randomly withdrawn early. Then, they are re-staked. This agent is intended to introduce dynamic behavior in staking.
  3. Depeg Withdrawal Staker: If a depeg happens, this agent will withdraw some of all staked funds.
  4. Depeg Entry Staker: When a depeg occurs, this agent will move some $token from circulation to staking.

This comprehensive approach allowed us to explore a myriad of potential combinations, as illustrated in the charts above.

 Deposit Agent 

This agent is only responsible for depositing assets into the system. The value of these assets is a percentage of the current Total Value Locked (TVL).  

Redemption Agent

This agent is only responsible for redeeming assets in the system. The value of the deposited assets is a percentage of the current TVL value. 

Scenarios for DeFi

The client provided the overall system concept. We got it after a series of meetings where we learned about the client’s ideas and solutions. Our task was to ensure it worked well and to assess how market forces would affect it. 


To achieve this, simulations of hundreds of scenarios were conducted. These scenarios included many variables. These were diverse stablecoin price movements and the actions of agents entering and exiting the system. Also, they included different behaviors of agents staking $token. We crafted each scenario carefully. They test the system’s response under different conditions. This ensures a full understanding of its resilience and functionality.

These simulations provided a wealth of data in the form of multi-level charts.


Charts

We ran hundreds of simulation scenarios. Based on that we generated graphs to make the results easier to analyze. These simulations encompassed various components.


Price of USDT, USDC, and DAI, as well as the price of $token calculated in various scenarios (right chart):

Different depeg scenarios:

Deposit and redemption assets scenarios:

Staking mechanism:

Burned $token:

Fees:

Conclusions and recommendations

In these DeFi simulations, we found important connections and possible problems. They gave us hints for more analysis and improvement. It’s crucial to note that we use many analytical tools to fully examine and correctly interpret the data.

In our comprehensive analysis and simulation of the system under varying staking conditions, we identified several key issues and provided targeted recommendations to address them. Firstly, a calculation error in the multiplication process of $token was discovered, leading to incorrect token generation. To rectify this, an immediate correction in the token creation algorithm is essential. Secondly, the excess of tokens in Adjusted Total Value Locked (aTVL) and Staker rewards over actual T-Bills profits threatens the coverage of $tokens and the liquidity of the system, potentially leading to solvency issues. We recommend aligning the minting of $tokens with T-Bills yields to mitigate this risk.

Furthermore, the phenomenon of depegging disrupts system operations, hindering stablecoin deposits and staker rewards, and unbalancing stablecoin ratios. To counteract this, we suggest either converting USDC into depegged stablecoins post-depegging or reallocating excess USDC to Maple as temporary measures. Lastly, token burning was found ineffective in preventing depegging, especially when the system reaches its LowerBound. An improved strategy involves deploying $tokens more flexibly across the system to enhance stability during critical depegging events. These findings and recommendations aim to bolster the system’s functionality and resilience against identified vulnerabilities.

Without doing a full simulation, it would be hard to propose these system corrections. Failure to diagnose these errors could have serious long-term consequences on the system’s effectiveness. 

The team has addressed the issues identified through various findings and has successfully implemented the corresponding recommendations.

Final conclusion

The entire process involved specialized advisory from our side. We guided our client  through a comprehensive process, regularly communicating and finalizing details. We utilized their ideas, concepts, and smart contracts provided by them for on-chain validation. Leveraging the TokenSPICE environment in Python enabled us to conduct an economic analysis of the entire DeFi system. We considered many agent behaviors and demand-supply layouts. We also looked at many internal and external forces at different intensities. From this, we simulated hundreds of DeFi scenarios. This let us find threats to the system. We presented the dynamics of price and demand changes. We gave a series of recommendations on actions that could help the DeFi system work well to meet the project’s goals.

Annotation: The token name was anonymized at the client’s request.

Let’s talk about DeFi

The best first step is to talk to our consultant. During a free consultation, you can check the consultant’s competences and look for initial solutions to the challenge that is currently most important for your project.

SCHEDULE A FREE CONSULTATION

Let's Collaborate

Whether you have questions, collaboration ideas, or just want to say hello, we're here and ready to connect. Your inquiries are important to us, and we look forward to engaging in meaningful conversations.

direct contact
CONTACT

    Tokenomia.pro sp. z o.o. ul. Cytrynowa 5 62069 Dabrowa, Poland VATID: PL7773382326