Next Article in Journal
Advancing the Use of Deep Learning in Loss Reserving: A Generalized DeepTriangle Approach
Next Article in Special Issue
Features of the Association between Debt and Earnings Quality for Small and Medium-Sized Entities
Previous Article in Journal
Board Response to Transnational Regulation on Corporate Governance: A Case Study on EU Banking Regulation
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Simulation of Dynamic Performance of DeFi Protocol Based on Historical Crypto Market Behavior

by
Iveta Grigorova
*,
Aleksandar Karamfilov
,
Radostin Merakov
and
Aleksandar Efremov
Faculty of Automatics, Industrial Automation, Technical University, 1000 Sofia, Bulgaria
*
Author to whom correspondence should be addressed.
Submission received: 17 November 2023 / Revised: 15 December 2023 / Accepted: 19 December 2023 / Published: 25 December 2023
(This article belongs to the Special Issue Financial Analysis, Corporate Finance and Risk Management)

Abstract

:
In a rapidly evolving and often volatile crypto market, the ability to use historical data for simulations provides a more realistic assessment of how decentralized finance (DeFi) protocols might perform. This insight is crucial for participants, developers, and investors seeking to make informed decisions. This paper presents a comprehensive study evaluating the dynamic performance of a newly developed DeFi protocol—NOLUS. The main objective of this paper is to present and analyze the built realistic model of the platform. This model could be successfully used to analyze the stability of the platform under different environmental influences by performing various simulations and conducting experiments with different parameters that could not be realized with the real platform. In the article, the key components of the platform are presented in detail and the main dependencies between them are clarified, in addition to the ways of forming multiple variables, and the complex relations between them in the real protocol are explained. The main finding from the experimental part of the study is that the performance of the protocol representation accounts for the expected system behavior. Hence the system simulation could be successfully used to reveal essential protocol behaviors resulting from potential shifts in the crypto market environment and to optimize the protocol’s hyper parameters.

1. Introduction

Decentralized finance (DeFi) has emerged as a transformative paradigm within the financial landscape, harnessing the capabilities of blockchain technology to reshape traditional financial services. As the DeFi space continues to evolve rapidly, there is a growing need to comprehensively understand and assess the performance of these protocols in dynamic and unpredictable market conditions.
In a space where innovation and experimentation abound, the ability to simulate and analyze the behavior of DeFi protocols becomes paramount for both developers and participants. One of the key challenges lies in predicting how these protocols will perform under varying market scenarios, which are inherently influenced by the volatile nature of the cryptocurrency market.
Against the backdrop of dynamic cryptocurrency trading, a myriad of platforms has mushroomed globally, each contributing to the evolving narrative of DeFi. These platforms, while presenting distinct advantages and limitations, share a common thread: the direct connection of economic entities for mutual gains in cryptocurrency trading.
Prominent actors in the DeFi lending space include Uniswap, Sushiswap, Compound, and Aave. Despite their progress, challenges persist, ranging from scalability issues, to elevated transaction costs and barriers, and the seamless onboarding of new users. The current state of research in DeFi lending protocols reflects a robust exploration of facets such as smart contract architecture, token mechanics, governance models, and user behavior.
Uniswap, operating on the Ethereum blockchain, utilizes an Automated Market Maker (AMM) model, promoting trustless and permissionless token trading. Researchers (Adams et al. 2021; Angeris et al. 2019; Daian et al. 2019) have scrutinized its pricing mechanism, liquidity provision strategy, security vulnerabilities, and optimization strategies.
Sushiswap, born as a decentralized exchange (DEX) and AMM, distinguishes itself by amplifying liquidity and incentives for liquidity providers (LPs). Research (Fan et al. 2023) undertakings delve into the intricacies of liquidity mining incentives, the sway of economic factors on liquidity providers’ decision making, and strategies to alleviate impermanent loss.
Compound, a decentralized lending protocol, revolutionizes DeFi by enabling users to lend or borrow based on algorithmic interest rates. Researchers (Saengchote 2023; Kao et al. 2020) have evaluated its market risks, liquidation mechanism, and economic security through agent-based modeling and simulation.
Furthermore, a nuanced exploration branches into the broader financial ecosystem, with a focus on three prominent Peer-to-Liquid Funds (PLFs)—Aave, dYdX, and Compound, presented in (Gudgeon et al. 2020). Market liquidity, efficiency, and interdependence among these PLFs take center stage, unraveling operational patterns during periods of high utilization and the potential risks associated with liquidity concentration.
Aave, akin to Compound, stands as a decentralized lending and borrowing platform with a distinctive feature—flash loans. The founder’s whitepaper (Aave n.d.) provides a comprehensive elucidation of Aave’s innovative lending pool model, flash loans, and governance structure. The research (Sun et al. 2023) threads weave through topics such as risk management, interest rate models, and liquidity provision, offering valuable insights into the multifaceted dynamics of the Aave protocol.
The cryptocurrency market is renowned for its inherent volatility, characterized by rapid and sometimes unpredictable price fluctuations across various digital assets. This volatility is a key distinguishing feature of the crypto market and is influenced by a myriad of factors. In (Gupta and Chaudhary 2022), the authors empirically found that there is the presence of high volatility among the returns of four cryptocurrencies—Bitcoin, Ether, Litecoin, and XRP—which makes them very risky assets for investments.
One of the primary contributors to cryptocurrency market volatility is the market’s relative nascency. Compared to traditional financial markets, the crypto space is relatively young and less mature. As a result, it tends to be more susceptible to sudden market sentiment shifts, speculative trading, and external influences. In a period where positive sentiment regarding the adoption of cryptocurrencies becomes widespread, financial institutions and large corporations increasingly integrate cryptocurrencies into their operations and investment portfolios. Increased adoption by traditional financial players can significantly boost the credibility and acceptance of DeFi platforms. Positive market sentiment often correlates with increased demand and can positively influence the valuation of cryptocurrencies.
Other factors affecting the volatility of cryptocurrencies are the regulatory developments. A global push among major economies for clearer and more favorable cryptocurrency regulations may introduce regulatory frameworks that legitimize and provide clear guidelines for the operation of decentralized finance (DeFi) platforms. This regulatory clarity could positively impact investor confidence, potentially leading to increased participation in platforms such as NOLUS. Conversely, adverse regulatory developments could introduce uncertainty and hinder growth.
The decentralized nature of many cryptocurrencies also plays a role. Without a central governing authority, market movements can be more reactive to news, social media trends, or macroeconomic factors. In terms of a global economic downturn, traditional financial markets experience a recession, and central banks implement expansive monetary policies to counter economic challenges. Economic downturns might drive investors toward alternative assets, including cryptocurrencies, as a hedge against economic uncertainties. This shift could influence the demand for cryptocurrencies and impact their pricing dynamics.
Liquidity, or the ease with which an asset can be bought or sold, is another factor amplifying crypto market volatility. Low liquidity in certain markets can result in larger price swings, as a relatively small volume of trades can have a significant impact.
Moreover, significant technological advancements in blockchain and decentralized technologies also affect the volatility of crypto markets. This could include the widespread adoption of more efficient consensus algorithms, scalability solutions, or interoperability protocols. Technological progress can enhance the efficiency and functionality of DeFi platforms. If these platforms integrate these advancements, they might gain a competitive edge, attracting more users and positively affecting their valuation.
In recent years, the crypto market has witnessed efforts to mitigate volatility. The introduction of stablecoins pegged to traditional fiat currencies, algorithmic stablecoins, and decentralized finance (DeFi) protocols seeking to stabilize token values are examples of such endeavors. However, volatility remains a characteristic element of the crypto landscape, offering both opportunities and challenges for investors and traders.
The novelty of our approach rests on the integration of historical crypto market data into the simulation of a newly developed protocol performance. By leveraging past market behaviors, we create a realistic environment that captures the complexities of real-world conditions, enabling us to evaluate the performance, risks, and potential outcomes of the real protocol with greater precision.
The subsequent sections of this paper focus on the details of our simulation methodology, the data sources and variables used, and the results of our analyses. Through researching the dynamic performance of the presented protocol using historical market simulations, we contribute to the ongoing discourse surrounding the evolution of DeFi, its potential challenges, and the opportunities it presents within the ever-evolving landscape of decentralized finance.
The Supplementary Materials section of the article provides an address that directs to the repository where the actual model of the real platform is published. This facilitates the ability of other researchers to replicate and build upon the presented results.

2. Mechanisms for Implementation of a DeFi Protocol Simulation

2.1. Event: Interest Generation

2.1.1. Lessees Interest (LS Interest)

The interest rate definition plays a crucial role in DeFi protocols as it directly impacts the functioning and effectiveness of these platforms. The accurate and well-defined determination of interest rates is essential for maintaining stability, attracting users, and ensuring efficient capital allocation within the DeFi ecosystem.
One of the key aspects of DeFi protocols is lending and borrowing activities, where users provide or borrow funds from the platform. The interest rate serves as a fundamental mechanism for incentivizing participation, balancing supply and demand, and managing risk.
A clear and transparent interest rate definition is important for several reasons. Firstly, it ensures fairness and equal treatment of all participants. By having a standardized and objective method of calculating interest rates, users can trust that their loans or deposits are subject to consistent and predictable terms.
Secondly, the interest rate definition helps to maintain stability and mitigate risks within the DeFi ecosystem. Through careful consideration of market conditions, collateralization ratios, and other factors, protocols can establish interest rates that align with the underlying assets’ risk profiles. This helps to protect the platform and its users from excessive volatility and potential defaults.
Moreover, the interest rate definition enables efficient capital allocation by incentivizing borrowing or lending activities when they are most needed. By dynamically adjusting interest rates based on supply and demand dynamics, protocols can influence user behavior and optimize resource allocation.
Furthermore, the interest rate definition in DeFi protocols is an area of active research and innovation. It involves considerations of economic theories, game theory, and algorithmic mechanisms. Researchers and developers are constantly exploring novel approaches to improve interest rate models, liquidity provision, and risk management to enhance the overall efficiency and sustainability of DeFi platforms. In (Gudgeon et al. 2020), the authors presented evidence of the inefficiency of DeFi tokens regarding their liquidity, market efficiency, and interest rates. They investigate the mechanisms used to set the interest rates in several DeFi protocols in order to find how to equilibrate the supply and demand for funds.
In (Piñeiro-Chousa et al. 2022), the authors investigate the impact of certain traditional assets on specific DeFi tokens, focusing on their volatility. The study suggests that there are connections between traditional assets, user-generated content, and DeFi tokens. These relationships indicate that DeFi tokens may serve as safe havens and provide a hedge against stock market volatility.
The value of LS Interest due on the smart contracts in the NOLUS platform is calculated daily and it consists of two components: a predefined Base Interest Rate and an additional part dependent on the Utilization Rate of the relevant pool.
The first component—the Base Interest Rate—is set for the platform and it serves as a minimum return that is guaranteed throughout the entire duration of the smart contract, except for the cases in which conditions for liquidation occur.
The second component—the Utilization Rate—is calculated daily from the ratio between the total amount of assets in stable currency already borrowed from the respective pool and the value of the deposited amounts in stable together with the accumulated interest in stable. It represents the part of the assets from each pool that are borrowed from the LSs.
For calculation of the Utilization Rate on a daily basis for every pool, the following formula is used:
U = B s t b t T V L t ,
where
-
U —Utilization Rate per pool;
-
B s t b t —the total amount borrowed from the pool’s native asset in stable for a specified timestamp;
-
T V L t —the Total Value Locked (TVL) amount of the pool’s native asset in stable for a specified time.
The TVL is further discussed in Section 2.3 of this article.
At the end of each day, when the smart contracts are closed, the Utilization Rate for each pool is calculated, and the following day, this Utilization Rate is taken for calculation of the LS interest rate for the current day.
In case at any day a 100% Utilization Rate is reached for a specific pool, no contracts are opened on that day and the day is restarted.
The interest rate for each individual pool, which represents the interest rate for the LS contracts, is calculated as per the formulas below, according to the level of utilization of the respective pool:
(1)
when the Utilization Rate for the pool is smaller than or equal to the Optimal Utilization Rate, i.e., U U o p t i m a l :
R v = R v o + U U o p t i m a l ·   R s l o p e 1 ,
(2)
when the Utilization Rate for the pool is higher than the Optimal Utilization Rate, i.e., U > U o p t i m a l :
R v = R v o + R s l o p e 1 + U U o p t i m a l 1 U o p t i m a l · R s l o p e 2 ,
where
-
R v —a variable interest rate per pool;
-
R v o —a predefined Base Interest Rate;
-
U —the Utilization Rate;
-
U o p t i m a l —a predefined Optimal Utilization Rate for the stable pool;
-
R s l o p e 1 —a predefined parameter, showing the increasing of the interest rate when U   U o p t i m a l ;
-
R s l o p e 2 —a predefined parameter, showing the increasing of the interest rate when U > U o p t i m a l .
This approach can be found also in the Aave protocol (Aave n.d.).

2.1.2. LP Interest

When a new liquidity provider (LP) deposit is opened, the amount of the deposit is stored both as an asset and is recalculated in stablecoins. The LP interest rate for a particular timestamp is calculated on a daily basis for each separate pool, according to the formula:
R L P t   % = R v t R t r 365 · 100 ,
where
-
R L P t —the LP interest rate for a particular timestamp;
-
R v t —a variable interest rate per pool for a particular timestamp;
-
R t r —a predefined Treasury Interest Rate.
At the time of withdrawal of the deposit from the LP, the cumulative amount of each LP’s interest is paid to them, together with the amount of their deposit and the additional profit in the form of NOLUS tokens (NLSs).
An important point to mention is a specific characteristic of the platform, regarding the number of LS contracts that will be opened daily, in reference to the change in the interest rate. The number of newly opened LS contracts depends on the interest rate and the Utilization Rate for the particular day.
The number of LS contracts that will be opened for the respective day decreases when the interest rate increases.
This functionality is achieved using the following formula:
d e m = e i n t i n t m i n   e i n t m a x i n t m i n 1 e i n t m a x i n t m i n · d e m i n t m i n d e m i n t m a x + d e m i n t m a x ,
where
-
d e m —percentage demand;
-
i n t m i n —minimal LS interest;
-
i n t m a x —maximal LS interest;
-
d e m i n t m a x —the maximum value of the variation in the parameter demand when forming the corresponding structure;
-
d e m i n t m i n —the minimum value of the variation in the parameter demand when forming the corresponding structure.
It is foreseen that there is a predefined maximum allowed LS interest rate. The parameter “dem” is calculated, which shows the percentage of the contracts for the corresponding day that will be opened depending on the interest rate calculated for the particular day. This functionality demonstrates that the interest of the LSs can decrease depending on the increase in the interest rates for the new contracts.
The maximum Pool Utilization, predefined in the config file, is used for LS demand reduction. If the maximum Pool Utilization is reached, the staked daily counts of new contracts are multiplied by weight for the purpose of reduction.

2.2. Event: Repayment of Loans by LSs

In the context of smart contracts, repayment refers to the process of returning borrowed assets to the lending platform after a borrower has completed their loan term.
In (Carapella et al. 2022), the authors provide an overview of blockchain basics and the major DeFi protocols and products they offer, together with the mechanisms for repayment of smart contracts, and finally they cover potential risks associated with these technologies and use cases. In (Gudgeon et al. 2020), the authors conduct an empirical analysis to observe the behavior of interest rate rules since their introduction, focusing on their responses to various levels of liquidity.
There are three types of liquidation transactions in NOLUS protocol, regarding the payment of loans by the LSs:
-
Regular payment or liquidation due to penalty;
-
Partial liquidation;
-
Total liquidation.
The first type of liquidation refers to the regular payments made by the LSs to repay their obligations under the smart contracts. These regular payments are executed without the need for manual intervention once the smart contract has been deployed on the blockchain. Regular payments in smart contracts provide several advantages, including reducing administrative overhead, enhancing trust and transparency, and ensuring timely and accurate payments.
The partial liquidation mechanism is crucial for maintaining the stability and safety of the protocol. It helps protect lenders and maintain the overall health of the system by preventing excessive losses in the event of volatile market conditions or borrower defaults. Partial liquidation refers to the reduction in a given asset of the LS as a result of one of the following two events: omitted payments or a shake-up in market conditions. When partial liquidation occurs, the smart contract will automatically sell or auction off a portion of the user’s collateral to cover their outstanding debt and ensure that the protocol remains solvent. By liquidating only a part of the collateral, users have the opportunity to restore their position and prevent the complete loss of their assets.
Full liquidation refers to the process of completely liquidating a user’s collateral in the smart contract when they are unable to meet their debt obligations or the value of their collateral falls below a critical threshold. Full liquidation is an essential risk management mechanism in the protocol, as it helps to mitigate the impact of defaulting borrowers and ensures the stability and security of the system. By fully liquidating a user’s collateral, the protocol can recover the debt owed and maintain the integrity of its reserve funds, which are critical for providing liquidity and maintaining the overall health of the platform.
There are some assumptions regarding the liquidation of contracts in the NOLUS platform that should be mentioned, as follows:
L A a t = 0 = B a t = 0 + C a t = 0 ,
where:
-
L A a t = 0 —the value of the LSs loan (loan amount) at the conclusion of the contract in asset;
-
C a t = 0 —the collateral (downpayment) in asset provided by LSs upon conclusion of the smart contract;
-
B a t = 0 —the borrowed amount of asset from the LSs.
L A s t b t =   L A a t · M P a t ,
where:
-
  L A s t b t —the value of the LSs loan at a given time in stable;
-
M P a t —the market price of the particular asset for the current timestamp.
All obligations due on the contract at a given time in stable, L L s t b t , can be calculated as follows:
L L s t b t = L S P s t b   t + L S I s t b t ,
where
-
L L s t b t —all obligations due on the contract at a given time in stable;
-
L S P s t b t —the principal due on the LS contract at a given time in stable;
-
L S I s t b t —the LS interest due on the contract at a given time in stable.
In turn, the following formula is used to determine the L S P s t b t :
L S P s t b t = B a t = 0 ·   M P a t = 0 P P s t b t ,
where
-
M P a t = 0 —the market price of the relevant asset at the time of opening the smart contract;
-
P P s t b t —the already paid part of the principal.
The value of L S I s t b t indicates the current interest standing at any given time. In the Monte Carlo simulation, the interest is used as the standing interest for the next month (example: when a contract is opened initially, L S I s t b t is set as the value of the interest for 1 month).
L L s t b t   % = B C · 100 ,
where:
-
L L s t b t —Lease Liability: ratio between borrowed to collateral at a given time.
There are three parameters, regarding the Lease Liability:
-
L L i n i t —Lease Initial Liability: a predefined initial Lease Liability in %;
-
L L h e a l t h —Lease Healthy Liability: a predefined healthy Lease Liability in %;
-
L L m a x —Lease Max Liability: a predefined maximum Lease Liability in %.
It is foreseen that the L L s t b t   for every opened contract is recalculated daily. The L L s t b t   of the contracts should be smaller than or equal to L L h e a l t h , and L L h e a l t h is smaller than L L m a x , to ensure that the protocol will work optimally and that no shortage of funds will occur in the pools.

2.2.1. Liquidation Type 1: Regular Payment/Liquidation Due to Penalty

It is expected that in the majority of cases, the contracts in the platform will be paid out in a timely manner; hence, there will be no penalty payments. In these cases, for the regular repayment of every smart contract, the following formula is used:
R A s t b = ( B s t b + B s t b · R v 12 × 100 · N p m n t ) / ( N p m n t + M p n l ) ) ,
where
-
R A s t b —the amount of the regular payment (repayment amount);
-
B s t b —the principal of the contract together with the newly achieved asset in stable;
-
N p m n t —the number of regular payments under the contract (payment);
-
M p n l —the number of omitted payments under the contract (penalty).
For calculation of the omitted payments the following formula is used:
P A s t b = B s t b · R v 12 × 100 · M p m n t / ( N p m n t + M p n l ) ,
where
-
P A s t b —the amount of the omitted (penalty) payment.
As mentioned, there are two conditions for a partial or a full liquidation to occur: missed contract payments or market shocks. When any of these events occurs and a set depreciation threshold is reached, part of the LS’s asset is sold in order to bring it to a sustainable state.
At the opening of the contracts for the current day, L L s t b t   for each contract is calculated and the following rule applies:
If L L s t b t L L m a x % 100 · L A s t b t , it indicates that L L s t b t L L m a x ; then, the liquidation amount in stable at the current moment ( L Q A s t b t ) is calculated and the amount is stored in a specific structure of the protocol.
The following formula is used to define L Q A s t b t and the smaller of the following two values is taken:
L Q A s t b t = m i n ( L A s t b t , L L s t b t L L h e a l t h %   100 · L A s t b t / ( 1 L L h e a l t h % 100 ) ) ,
where
-
L Q A s t b t —liquidation amount for a given time in stable: the amount in stable by which the L A s t b t should be reduced after the partial liquidation for the current time.

2.2.2. Liquidation Type 2: Full Liquidation

If L Q A s t b t =   L A s t b t , then a full liquidation is enforced.
After all liquidations past time for the totally liquidated contracts are removed, a liquidation record is created and a closing record for each fully liquidated contract is created.

2.2.3. Liquidation Type 3: Partial Liquidation

If L Q A s t b t <   L A s t b t , then a partial liquidation is enforced.
L A s t b t   after the partial liquidation is calculated as follows:
L A s t b t = L A s t b t 1   L Q A s t b t ,
After that, L S I s t b t , representing the current interest standing at any given time, is also reduced in compliance with the new parameters of the smart contract.

2.3. Event: Total Value Locked

Total Value Locked is a crucial metric in the decentralized finance (DeFi) ecosystem, representing the total amount of assets locked in a specific protocol or across multiple protocols. It provides valuable insights into the protocol’s performance and helps investors, users, and the wider community make informed decisions in the rapidly evolving DeFi landscape. According to the empirical evidence presented by (Maouchi et al. 2022), TVL can be used to evaluate DeFi tokens and monitor the market, and can be used as an indicator of the growth and success of that market (Şoiman et al. 2022).
In (Saengchote 2021), the author provides insights into the potential significance of TVL in DeFi and emphasizes the intricate nature of DeFi analysis and market monitoring. The author highlights that TVL is determined by the market value of tokens that are deposited or locked within the system, which inherently makes it sensitive to token prices. Consequently, there is an anticipated notable correlation between this variable and valuations. The study of (Metelski and Sobieraj 2022) aims to assess key DeFi performance metrics, particularly focusing on protocol valuations. Through a quantitative analysis of 30 selected protocols across decentralized exchanges, lending, and asset management classes, the research explores relationships between protocol valuations and variables such as Total Value Locked (TVL), protocol revenue, total revenue, gross merchandise volume, and the inflation factor. Utilizing Granger causality tests and fixed effects panel regression models, the study reveals that DeFi protocol valuations exhibit dependencies on various performance measures, with distinct magnitudes and directions for different variables.
The significance of TVL can be found in several directions:
  • Measure of protocol adoption: TVL provides a measure of the level of adoption and acceptance of a DeFi protocol. A higher TVL indicates that more users are trusting and utilize the protocol to lock their assets, which demonstrates confidence in its security, functionality, and potential returns.
  • Indicator of liquidity: TVL serves as an indicator of the liquidity available within a protocol. Higher TVL implies a deeper pool of assets, which enhances trading efficiency, reduces slippage, and attracts more participants to engage in transactions.
  • Market perception and reputation: TVL plays a role in shaping the market perception and reputation of the DeFi protocol. A protocol with a substantial TVL is often seen as more reputable, reliable, and trustworthy by users, investors, and the wider DeFi community. This can attract further adoption and partnerships, enhancing the protocol’s long-term sustainability.
  • Comparative analysis: TVL allows for comparative analysis among different DeFi protocols. By assessing TVL across various platforms, investors and users can evaluate the relative popularity and growth potential of protocols, aiding in investment decision making and identifying emerging trends in the DeFi space.
  • Protocol governance and influence: TVL often influences the governance power within a DeFi protocol. Some protocols allocate voting power based on the amount of assets locked, giving higher TVL participants a stronger voice in decision-making processes. This aligns the interests of token holders with the protocol’s development and ensures the protocol evolves in a way that benefits the majority of participants.
The definition of TVL in the protocol is the following:
T V L t = C D A s t b t   C W s t b t + C L S I s t b t ,
where
-
C D A s t b t —the cumulative deposited amount in the platform for the current time in stable;
-
C W s t b t —the total amount of withdrawals of LPs from the platform for the current time, together with the corresponding LP interest;
-
C L S I s t b t —the accumulated interest from LSs in the platform for the current time.

2.4. Event: NLS Price Definition

The price of the NLS tokens should be simulated as there is no historical information. It is formed of two components: the market price of the NLS and the impact of the protocol’s performance on the price. These two components are taken in a specified proportion and the final price of NLS is calculated.
The first component is a representation of the historical price of the currencies that participate in the platform, taken in a specific proportion.
The second component that participates in the formation of the final price of NLS tokens is the work of the protocol itself. To determine the influence of the platform on the level of the price of NLS tokens, the Total Value Locked is used.
This process is implemented in the following steps:
  • The ratio between the current value of all assets locked in the platform, calculated in stablecoins, and the total value of assets from the previous moment, is determined as follows:
T V L   % = T V L t 1 T V L t ,
where
-
T V L t —the TVL of the pool’s native asset, calculated in stable for a specific time;
-
T V L t 1 —the TVL of the pool’s native asset, calculated in stable for a previous time.
2.
The proportion in which the two components will participate in forming the final price of the currency is determined.
3.
The final price, taking into account both the market price and the impact of the platform over the price of the NOLUS tokens, is calculated according to the formula:
P n l s t = M P n l s   · w m + P n l s t 1 · 1 w m · T V L   % ,
where
-
P n l s t —the price of NLS tokens for the current timestamp;
-
M P n l s —the market price of NLS tokens;
-
w m —the weight of the market price;
-
(1 − w m )—the weight of the platform;
-
P n l s t 1 —the price of NLS tokens for the previous timestamp.

2.5. LP Rewards Distribution

The Treasury is a part of the protocol where the profit from the work of the protocol is stored. In the beginning it is provided that there is an initial investment in the Treasury in the form of NLS tokens, which will ensure the necessity of having some funds in case any LP withdraws their deposit earlier, when the profit of the Treasury is not enough.
There are three cash inflows into the Treasury:
  • Transaction fees, paid by both LSs and LPs, charged for each transaction
For the purposes of the simulation of the protocol, it is assumed that each LS and LP will pay a predefined number of transactions every month, so the total value of all transaction fees for the platform per month is calculated as follows:
T R N F = c l s ·   T R l s ·   P t r n + c l p ·   T R l p ·   P t r n ,
where
-
TRNF—total transaction fees;
-
T R l s —the number of transactions made by each LS per month, predefined in the config file;
-
T R l p —the number of transactions made by each LP per month, predefined in the config file;
-
c l s —the number of opened LS contracts per month;
-
c l p —the number of opened LP deposits per month;
-
P t r n —the transaction price for each transaction in stable, predefined in the config file.
2.
SWAP fees—a one-time fee paid by each LS upon conclusion of the smart contract, predefined in the config file as a percent from the LS loan amount in stable:
S W A P = L A s t b t = 0 · s w ,
where
-
L A s t b t = 0 —LS loan amount in stable at the opening of the contract;
-
s w —a predefined percent in the config.
3.
Treasury interest (TRI)—A predefined part of the interest paid by LSs
The cash outflow from the Treasury, which leads to a decrease in the accumulated funds in the Treasury, is the distribution of rewards to the LPs. These rewards are distributed among all LPs based on their percentage contribution to the pools on a daily basis.
The total amount of rewards per pool that are distributed among all LPs for a particular pool daily due to the initially deposited amount by each LP is calculated as follows:
T R R s t b t = T V L p o o l t   ·   t r w 365 ,
where
-
T R R s t b t —Treasury rewards: the total amount of rewards per pool distributed among all LPs on a daily basis;
-
trw—preliminary defined percentages of rewards per pool;
-
T V L p o o l t —TVL per pool at the current time of the spread.
trw represents preliminary defined percentages that determine the relationship between the amount of TVL for all pools and the percentage of rewards for LPs. This relationship indicates the percentage of the TVL that will be distributed among the LPs. This value is extracted from the available funds in the Treasury and used for buyback of NLS tokens that will be spread among the LPs through rewards.
The rewards that each LP will receive from the Treasury daily are calculated as a percentage of all rewards that will be distributed among all LPs from the respective pool for the current day. This percentage depends on the amount of the deposit with which the respective LP participates in the specific pool, relative to the total deposited amount of all contracts for the current time for the pool in stable. After the individual percent for each LP is calculated, the amount of the rewards for the current day for each LP is determined.
In this way, the total cash inflow and outflow from the work of the protocol is stored in the Treasury and can be represented as follows:
T R P s t b t = T R N F s t b t + S W A P s t b t + T R I s t b t T R R D s t b t ,
where
-
T R P s t b t —Treasury profit, being the amount entered in the Treasury on a daily basis in stable;
-
T R N F s t b t —total transaction fees on a daily basis in stable;
-
S W A P s t b t —SWAP fees on a daily basis in stable;
-
T R I s t b t —the Treasury interest on a daily basis in stable;
-
T R R D s t b t —Treasury rewards in stable that should be distributed among all LPs on a daily basis in stable.
The current state of the Treasury is recorded in stable in a specific structure, namely, NLS, which appears to be a cumulative table indicating the available funds in the Treasury at the current time, according to the following formula:
T R A s t b t = T R A s t b t 1 + T R P s t b t T R R D s t b t 1
An important feature of the platform, related to the distribution of rewards to the LPs from the protocol, is the established mechanism, which ensures that, if for a specific day there is not a sufficient number of tokens in the Treasury to be distributed among all LPs, then for the corresponding day no rewards are distributed.

3. Dynamic Performance Simulation Based on Historical Crypto Market Behavior

3.1. Research Methodology

Expanding the model detailed in the previous section, a comprehensive simulation of the NOLUS protocol is conducted, utilizing the actual protocol as a basis. This simulation spans a historical timeframe of three years, from 1 February 2020 to 31 January 2023, capturing a diverse range of market conditions. In this simulation, the pricing dynamics of the NOLUS protocol currency are intricately tied to various currencies, with differential weights assigned based on their influence in the broader crypto market. Notably, primary currencies, particularly wrapped bitcoin, wield substantial weight due to their pronounced impact on the overall market.
During the specified period, the prices of multiple currencies were considered, each contributing to the formation of the presumed value of the NOLUS protocol currency. The proportional representation of these currencies in the simulation, presented in Table 1, holds significance, reflecting their varying impacts on the NOLUS protocol’s valuation.
In order to simulate the expected behavior of the market for carrying out the present simulation, hypotheses are also set for a number of variables, including the number of participants in the platform, the duration and size of loan contracts, the duration and size of deposits, and the number and size of delays of contract payments. The F-distribution is used to generate these variables, as it best represents the expectations for the distribution of their values.
Each of these variables is set to be a hyper parameter of the simulation model, enabling researchers to fine tune their values. This also provides the opportunity to simulate various environmental effects that impact the work of the platform, on one hand, and to modify the parameters of the platform itself. This model makes it possible to simulate structural changes or regime shift type of behavior. Based on these assumptions, the anticipated performance of the protocol during the simulated period is presented in the following subsections of the article.

3.2. Simulation of Dynamic Operational Performance

This section provides an exposition of the simulation outcomes based on the initially defined parameters and presumed hypotheses. The visual representations in the form of graphs for each variable offer a clear demonstration that the anticipated interaction mechanisms among distinct variables accurately align with the preconceived expectations.

3.2.1. Interest Rates

The interest rate within the platform is dynamic, contingent upon the prevailing state of the platform and market conditions at each timestamp. With a surge in the number of LPs, a substantial reservoir of available funds emerges in the pools, consequently mitigating the expense for new LSs seeking to borrow assets from the platform. This results in a decreased interest rate for these newly introduced LSs, leading to a corresponding reduction in the interest rates earned by recently enrolled LPs.
From Figure 1, it can be seen that the expected relationship between LP and LS interest rates is satisfied and they are change correctly depending on the Pool Utilization Rate. As the Utilization Rate per pool increases, the interest rates for both LSs and LPs also increase.
In Figure 2, it can be seen that the established mechanism for changing the number of LP and LS contracts depending on the change in the interest rate functions properly. It is noticeable that over time and with a smooth and continuous increase in interest rates, the number of LPs exceeds the number of LSs. On the one hand, an increase in the interest rates leads to an increase in the number of LPs over time, as increased interest rates attract more and more LPs. At the same time, rising interest rates cause a slight decline in LS contracts, as the cost of borrowing becomes higher at higher interest rates.
In the current simulation, the maximum utilization of the funds from the pools is not reached and therefore there the opening of new contracts does not terminate. In subsequent articles, this functionality will be demonstrated by running various MC simulations.

3.2.2. Repayment of Loans

The repayment process in smart contracts is usually automated and executed based on the terms agreed upon at the time of borrowing. Once the borrower fulfills their repayment obligations, the smart contract releases the collateral held as security back to the borrower, and the loan is considered fully repaid.

Regular Payments

Figure 3 shows an example of a smart contract with only regular payments, demonstrating that the underlying mechanisms in the protocol are met. This particular contract has five regular payments. This can be seen on the bottom of Figure 3, represented by Liquidation Type: 1, and it indicates that the Lease Liability decreases in accordance with the repayments made. Since the ratio between the obligations under the contract and the value of the contract does not exceed the healthy levels, partial liquidation (in the sense of penalty payments) and full liquidation are therefore not required. Moreover, the market price of the asset is consistent, which indicates that in stable or favorable market conditions, penalty liquidations are not common or necessary. At the end of the period, the contract is fully repaid.

Partial and Full Liquidation

Figure 4 shows an example of a contract in which events occur that lead initially to a partial liquidation and subsequently to a full liquidation of the contract. It is noticed that on the 13 March 2020 there is a collapse in the market, due to which the loan amount loses its monetary value (lease amount), pushing the smart contract close to the preliminarily determined critical healthy levels. Therefore, a partial liquidation occurs, represented by Liquidation Type: 3, as part of the smart contract is liquidated, reducing the liability of the smart contract back to healthy levels. The liquidation amount is determined by Liquidation Amount (formula number 13). Subsequently, on 15 March 2020 the conditions for partial liquidation occur again and a second partial liquidation is fulfilled. As a result, the conditions for full liquidation also occur and on 16 March 2020 the contract is fully liquidated (represented by Liquidation Type: 2).

3.2.3. Total Value Locked

Within the NOLUS protocol, TVL serves as a determinant influencing both the NLS price and the platform’s interest rate. The anticipation is that a higher value of funds locked in the platform enhances the protocol’s appeal. Consequently, this is anticipated to result in elevated interest rates and a simultaneous increase in the value of NLS tokens.
Figure 5 shows the state of the platform in terms of funds locked in the protocol for the simulated period. It is noticed that in the beginning of the period there is an increase in TVL because of the expected enhanced interest in the protocol, and subsequently, the levels are established at a plateau, with a slight increase over time.
In subsequent articles, various Monte Carlo simulations will be carried out, through which it is expected to determine how TVL will change under various assumptions, both in terms of conditions external to the platform, such as economic conditions and the financial services market in particular, and those internal to the platform, such as the number of participants and interest rates.

3.2.4. NLS Price Definition

The components of the NOLUS price, described in Section 2.4. Event: NLS Price Definition, are the simulated market price of the NLS and the impact of the protocol’s performance.
Figure 6 presents the prices of cryptocurrencies that participate in the formation of the market component of NOLUS tokens for the selected period from 1 February 2020 to 31 January 2023, according to the proportions described in Section 3.2. Research Methodology.
Figure 7 presents the movement of the NLS price for the period of the simulation of the operation of the protocol.
It is observed that the NOLUS price movement closely aligns with the collective movement of all considered currencies, with a notable emphasis on the movement of wrapped bitcoin. This emphasis is justified by the prominent role of wrapped bitcoin in the broader crypto market, acting as a key indicator and influencing factor. Wrapped bitcoin, being a representative token pegged to the value of bitcoin, holds a pivotal position, affecting market sentiments and contributing to the overall price dynamics of the NOLUS protocol.

3.2.5. Rewards Distribution

From Figure 8, it can be seen how the funds available in the Treasury, presented both in assets and in stable, change over time. It is noticed that at the beginning of the protocol’s work until about the middle of the second year, as a result of the large number of accumulated funds in the platform, rewards are distributed every day. After the middle of the second year, the level of funds in the Treasury is depleted due to distributing large rewards at the beginning, as a result of which such rewards are spread inconsistently every other day when enough funds are accumulated in the Treasury to cover the amount of all necessary rewards.
Moreover, it is observed from Figure 9 that with the temporary increase in Treasury profit towards the middle of the third year, for a short period of time the funds in the Treasury are enough to cover all the required rewards; therefore, for a short period, the rewards are distributed daily.

4. Conclusions

In conclusion, the simulation of the NOLUS protocol presented in this paper marks a significant stride toward comprehending the intricate interplay between decentralized finance protocols and the broader crypto market landscape. By harnessing historical crypto market data, we have effectively simulated the dynamic behavior of the NOLUS protocol.
The article explores several prominent DeFi protocols within the broader cryptocurrency market, with a specific focus on comparing the NOLUS platform, introduced in the article, to these established protocols. It provides an elaborate description of the developed software model that mimics the real protocol, delving into the core dependencies among its components. The article thoroughly examines the fundamental interdependencies among the various elements constituting the NOLUS protocol. Through a series of carefully conducted experiments, the platform’s functionality is scrutinized, utilizing predetermined values for numerous simulation parameters. The outcomes of these experiments affirm that the constructed model effectively mirrors the intricacies of the actual platform, presenting a highly accurate representation.
This simulation methodology has the potential to uncover critical protocol behaviors caused by potential crypto market dynamics, identify optimization opportunities, and highlight best practices for adjustment of the key protocol hyper parameters. As the DeFi ecosystem continues to evolve, these insights will prove instrumental in fostering a robust and sustainable DeFi landscape.
The simulation presented in this article is a one-time implementation of the actual DeFi platform NOLUS. As it involves numerous random factors and is based on certain assumptions about their distribution, this singular simulation is constrained by the initial hypotheses. Concurrently, historical cryptocurrency price data spanning three years was employed to replicate the platform’s behavior, intending to illustrate its hypothetical performance over that period. Recognizing these constraints, it is important to note that a detailed simulation of every operational aspect of the real platform might not be feasible. However, utilizing the developed model, which encapsulates the platform’s embedded mechanisms, and conducting multiple simulations, could facilitate a more profound analysis of the protocol.
The implications of this research extend beyond the immediate scope of the study. Building upon the insights gained from this simulation, our intention is to employ a Monte Carlo simulation framework to explore a variety of different scenarios. This approach will allow us to systematically assess the protocol’s performance across a spectrum of potential market events, encompassing periods of stability as well as heightened volatility. The deployment of multiple Monte Carlo simulations aligns with our goal to provide a more comprehensive and holistic understanding of the NOLUS protocol’s behavior. Such simulations enable us to project its performance under conditions that mimic real-world market dynamics, serving as a valuable tool for risk assessment, strategic decision making, and scenario planning.
The subsequent stages of conducting multiple Monte Carlo simulations for diverse scenarios will be published in upcoming articles and hold the promise of enhancing our understanding of DeFi protocols’ dynamic performance and fortifying their resilience against the complexities of the crypto market. As we venture forward, we are poised to contribute to the ongoing discourse on the intricacies of DeFi, while equipping stakeholders with the knowledge needed to navigate this innovative financial frontier.

Supplementary Materials

The model of the platform is published in GitHub: https://github.com/nolus-protocol/mc-nolus (accessed on 20 December 2023).

Author Contributions

Conceptualization A.E.; data curation, A.K. and R.M.; methodology, A.E.; software, A.K. and R.M.; validation, A.K., I.G. and A.E.; funding acquisition, A.E.; formal analysis, A.K., I.G. and A.E.; investigation, A.K. and I.G.; writing—original draft preparation, I.G. and A.K.; writing—review and editing, A.E. and I.G.; visualization, A.K. and I.G.; supervision, A.E. All authors have read and agreed to the published version of the manuscript.

Funding

This study is financed by the European Union-NextGenerationEU, through the National Recovery and Resilience Plan of the Republic of Bulgaria, project No BG-RRP-2.004-0005.

Data Availability Statement

To generate the simulated price of NLS tokens, the real prices of the currencies mentioned in the article were used, gathered from the following web site: https://www.coingecko.com (accessed on 20 December 2023).

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Aave. n.d. Available online: https://aave.com/ (accessed on 20 December 2023).
  2. Adams, Hayden, Noah Zinsmeister, Moody Salem, River Keefer, and Dan Robinson. 2021. Uniswap v3 Core. Available online: https://uniswap.org/whitepaper-v3.pdf (accessed on 20 December 2023).
  3. Angeris, Guillermo, Hsien-Tang Kao, Rei Chiang, Charlie Noyes, and Tarun Chitra. 2019. An analysis of Uniswap markets. arXiv. [Google Scholar] [CrossRef]
  4. Carapella, Francesca, Edward Dumas, Jacob Gerszten, Nathan Swem, and Larry D. Wall. 2022. Decentralized Finance (DeFi): Transformative Potential and Associated Risks. No. 2022-14. Atlanta: Federal Reserve Bank of Atlanta Policy Hub. [Google Scholar]
  5. Daian, Philip, Steven Goldfeder, Tyler Kell, Yunqi Li, Xueyuan Zhao, Iddo Bentov, Lorenz Breidenbach, and Ari Juels. 2019. Flash Boys 2.0: Frontrunning, Transaction Reordering, and Consensus Instability in Decentralized Exchanges. arXiv. [Google Scholar] [CrossRef]
  6. Fan, Sizheng, Tian Min, Xiao Wu, and Cai Wei. 2023. Towards understanding governance tokens in liquidity mining: A case study of decentralized exchanges. World Wide Web 26: 1181–200. [Google Scholar] [CrossRef]
  7. Gudgeon, Lewis, Sam Werner, Daniel Perez, and William J. Knottenbelt. 2020. DeFi Protocols for Loanable Funds: Interest Rates, Liquidity and Market Efficiency. Paper presented at 2nd ACM Conference on Advances in Financial Technologies, New York, NY, USA, October 21–23; pp. 92–112. [Google Scholar] [CrossRef]
  8. Gupta, Hemendra, and Rashmi Chaudhary. 2022. An Empirical Study of Volatility in Cryptocurrency Market. Journal of Risk and Financial Management 15: 513. [Google Scholar] [CrossRef]
  9. Kao, Hsien-Tang, Tarun Chitra, Rei Chiang, and John Morrow. 2020. An Analysis of the Market Risk to Participants in the Compound Protocol. Available online: https://api.semanticscholar.org/CorpusID:231619656 (accessed on 20 December 2023).
  10. Maouchi, Youcef, Lanouar Charfeddine, and Ghassen El Montasser. 2022. Understanding digital bubbles amidst the COVID-19 pandemic: Evidence from DeFi and NFTs. Finance Research Letters 47: 102584. [Google Scholar] [CrossRef]
  11. Metelski, Dominik, and Janusz Sobieraj. 2022. Decentralized Finance (DeFi) Projects: A Study of Key Performance Indicators in Terms of DeFi Protocols’ Valuations. International Journal of Financial Studies 10: 108. [Google Scholar] [CrossRef]
  12. Piñeiro-Chousa, Juan, M. Ángeles López-Cabarcos, Aleksandar Sevic, and Isaac González-López. 2022. A preliminary assessment of the performance of DeFi cryptocurrencies in relation to other financial assets, volatility, and user-generated content. Technological Forecasting and Social Change 181: 121740. [Google Scholar] [CrossRef]
  13. Saengchote, Kanis. 2021. Where do DeFi stablecoins go? A closer look at what DeFi composability really means. SSRN Electronic Journal 2021: 3893487. Available online: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3893487 (accessed on 20 December 2023). [CrossRef]
  14. Saengchote, Kanis. 2023. Decentralized lending and its users: Insights from Compound. arXiv arXiv:2212.05734. Available online: http://arxiv.org/abs/2212.05734 (accessed on 31 October 2023). [CrossRef]
  15. Şoiman, Florentina, Guillaume Dumas, and Sonia Jimenez-Garces. 2022. The return of (I)DeFiX. arXiv arXiv:2204.00251. Available online: http://arxiv.org/abs/2204.00251 (accessed on 8 November 2023).
  16. Sun, Xiaotong, Charalampos Stasinakis, and Georgios Sermpinis. 2023. Liquidity Risks in Lending Protocols: Evidence from Aave Protocol. arXiv arXiv:2206.11973. Available online: http://arxiv.org/abs/2206.11973 (accessed on 31 October 2023).
Figure 1. Interest rate depending on Pool Utilization.
Figure 1. Interest rate depending on Pool Utilization.
Risks 12 00003 g001
Figure 2. Count of LS and LP contracts depending on interest rate.
Figure 2. Count of LS and LP contracts depending on interest rate.
Risks 12 00003 g002
Figure 3. Repayment of loans. An example of regular payments.
Figure 3. Repayment of loans. An example of regular payments.
Risks 12 00003 g003
Figure 4. Repayment of loans. An example of partial and full liquidation.
Figure 4. Repayment of loans. An example of partial and full liquidation.
Risks 12 00003 g004
Figure 5. Status of funds in the platform.
Figure 5. Status of funds in the platform.
Risks 12 00003 g005
Figure 6. Cryptocurrencies that participate in the formation of the NOLUS price.
Figure 6. Cryptocurrencies that participate in the formation of the NOLUS price.
Risks 12 00003 g006
Figure 7. NLS price by timestamp.
Figure 7. NLS price by timestamp.
Risks 12 00003 g007
Figure 8. Treasury amount and Treasury rewards by timestamp.
Figure 8. Treasury amount and Treasury rewards by timestamp.
Risks 12 00003 g008
Figure 9. Treasury profit by timestamp.
Figure 9. Treasury profit by timestamp.
Risks 12 00003 g009
Table 1. Participation of different cryptocurrencies in forming the market price of NOLUS tokens.
Table 1. Participation of different cryptocurrencies in forming the market price of NOLUS tokens.
CurrencyProportion in the Final Price
wrapped-bitcoin0.250
weth0.150
binancecoin0.100
avalanche-20.060
cosmos0.050
injective-protocol0.050
band-protocol0.050
kava0.040
juno-network0.040
osmosis0.040
secret0.040
akash-network0.040
crypto-com-chain0.030
stargaze0.030
sentinel0.030
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Grigorova, I.; Karamfilov, A.; Merakov, R.; Efremov, A. Simulation of Dynamic Performance of DeFi Protocol Based on Historical Crypto Market Behavior. Risks 2024, 12, 3. https://doi.org/10.3390/risks12010003

AMA Style

Grigorova I, Karamfilov A, Merakov R, Efremov A. Simulation of Dynamic Performance of DeFi Protocol Based on Historical Crypto Market Behavior. Risks. 2024; 12(1):3. https://doi.org/10.3390/risks12010003

Chicago/Turabian Style

Grigorova, Iveta, Aleksandar Karamfilov, Radostin Merakov, and Aleksandar Efremov. 2024. "Simulation of Dynamic Performance of DeFi Protocol Based on Historical Crypto Market Behavior" Risks 12, no. 1: 3. https://doi.org/10.3390/risks12010003

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop