Method for improving stability of decentralized bottom pool based on block chain
By constructing on-chain and off-chain parameter sets and introducing globally effective liquidity parameters, combined with an improved LS-LMSR algorithm and entropy risk measurement, the liquidation price and inventory structure are optimized, solving the instability problem of decentralized liquidity pools and achieving higher market adaptability and risk control capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-03-27
AI Technical Summary
Existing decentralized liquidity pools struggle to maintain price stability and inventory balance when faced with factors such as fluctuating trading volumes, cross-chain fund flows, and the instability of price oracles. Furthermore, existing risk control measures are inadequate, leading to increased systemic risk.
By constructing on-chain and off-chain parameter sets, a two-layer liquidity parameter framework is established, introducing globally effective liquidity parameters, combining an improved LS-LMSR algorithm and entropy risk measurement, optimizing liquidation prices and inventory structure, and designing a dynamic transaction fee mechanism to improve the stability of the pool.
It enhances the robustness of the pool in complex environments, alleviates inventory deviation issues, improves the fairness of clearing prices and the stability of settlement results, enhances the precision of risk identification and control, and ensures the stable operation of the pool under extreme market conditions.
Smart Images

Figure CN121745940A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of decentralized finance, and more particularly to a method for improving the stability of decentralized pools based on blockchain. Background Technology
[0002] In recent years, blockchain technology has driven the development of decentralized finance (DeFi), with liquidity pools serving as a core infrastructure and widely used in automated market makers (AMMs) and transaction settlement. However, existing liquidity pool mechanisms often struggle to maintain price stability and inventory balance within the pool when faced with factors such as fluctuating trading volumes, cross-chain fund flows, and the instability of price oracles. This instability leads to increased slippage, higher impermanent loss for liquidity providers, and consequently, increased systemic risk.
[0003] In existing technologies, some studies have introduced dynamic adjustment mechanisms based on single-market price signals, but they lack unified modeling of on-chain transactions and off-chain market environments, making it impossible to effectively coordinate the liquidity level of the pool under different market conditions. In addition, existing clearing mechanisms mostly rely on continuous matching, which makes it difficult to avoid price manipulation and inventory shifts under high volatility conditions, and lacks effective optimization designs for periodic settlements.
[0004] On the other hand, existing risk measurement methods mainly rely on traditional financial indicators such as variance and volatility, which are difficult to fully depict the systemic impact of new risk sources such as oracle volatility, cross-chain fund shocks, and miner extractable value. This results in imperfect risk control measures and the pool is prone to imbalance under extreme market conditions.
[0005] Therefore, how to provide a method for improving the stability of decentralized pools based on blockchain is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose a method for improving the stability of decentralized pools based on blockchain. This invention establishes a two-layer liquidity parameter framework by constructing an on-chain parameter set and an off-chain parameter set, and introduces a globally effective liquidity parameter into the batch clearing mechanism to optimize the unified clearing price and inventory structure. At the same time, it designs an improved LS-LMSR algorithm cost function to realize the dynamic linkage between marginal price and transaction fee rate, and combines entropy risk measurement to generate a risk control parameter set, which has the advantages of strong stability, controllable risk and high market adaptability.
[0007] A method for improving the stability of a decentralized pool based on blockchain according to an embodiment of the present invention includes the following steps: During the operation of the blockchain network, set the settlement cycle parameters, collect on-chain operation data and cross-chain environment data, and construct on-chain parameter set and off-chain parameter set; Based on the set of in-chain parameters, calculate the in-chain layer liquidity parameters; based on the set of out-of-chain parameters, calculate the out-of-chain layer liquidity parameters; and use a parameter synthesis function to obtain the global effective liquidity parameters. A batch clearing mechanism is implemented to generate a unified clearing price, and a globally effective liquidity parameter is introduced during the clearing optimization process to solve for the target inventory vector; The global effective liquidity parameter and the target inventory vector are introduced into the LS-LMSR algorithm. An improved cost function is designed to calculate the marginal price result set and the transaction fee rate result set, and the inventory status is corrected to generate the inventory correction result. Based on the unified clearing price, marginal price result set, transaction fee rate result set, and inventory correction result, the entropy risk measurement function is called to calculate the entropy risk value and generate a set of risk control parameters. In blockchain smart contracts, the pool's operating parameter system is modulated using entropy risk value and risk control parameter set. Transaction settlement and inventory status updates are completed based on marginal price result set and transaction fee rate result set. The updated on-chain parameter set and off-chain parameter set are then written back to enter the next settlement cycle.
[0008] Optionally, the construction of the on-chain parameter set, the off-chain parameter set, and the liquidation cycle parameter includes: During the operation of the blockchain network, a settlement cycle parameter is set, which includes the start and end dates of the settlement cycle, the length of the settlement cycle, and the triggering rules for the settlement cycle. Using the liquidation cycle as the operating time window, it collects on-chain operating data, including transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information, and also collects cross-chain environment data, including fund flow data, oracle price volatility indicators and MEV risk index. Perform time alignment, unit consistency, and outlier removal on in-chain and cross-chain operational data, and maintain high consistency between data and blocks; Based on the on-chain operation data, an on-chain parameter set is constructed, which includes transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information. Based on cross-chain environment data, an off-chain parameter set is constructed, which includes fund flow data, oracle price volatility indicators, and MEV risk index. This forms a continuously accumulating and updated set of on-chain parameters and off-chain parameters during the liquidation cycle.
[0009] Optionally, the generation of the global effective liquidity parameter includes: During the liquidation cycle, the on-chain parameter set and the off-chain parameter set are used as inputs. The time window is divided according to the liquidation cycle parameters. The on-chain parameter set and the off-chain parameter set are normalized to generate the standardized results of the on-chain parameter set and the standardized results of the off-chain parameter set. Based on the standardized results of the in-chain parameter set, the in-chain layer liquidity parameters are calculated using a weighted normalization method. Based on the standardized results of the off-chain parameter set, the off-chain liquidity parameters are calculated using a weighted normalization method. By inputting the intra-chain liquidity parameters and the extra-chain liquidity parameters into a parameter synthesis function, the global effective liquidity parameters are obtained through a non-linear combination method.
[0010] Optionally, the generation of the unified liquidation price and target inventory vector includes: At the end of the liquidation cycle, a batch liquidation mechanism is executed; Specifically, freeze the on-chain transaction volume data and construct a cumulative buy volume function and a cumulative sell volume function based on the on-chain transaction volume data; A unified settlement price is determined at the intersection of the cumulative buy volume function and the cumulative sell volume function; Under a unified clearing price, transaction batches are matched and settled. Combining the asset inventory status at the end of the period with the net transaction volume under the unified clearing price, a temporary inventory vector after clearing is calculated. During the liquidation optimization process, a global effective liquidity parameter is introduced to perform optimization calculations on the temporary inventory vector after liquidation. Simultaneously, the minimization of inventory deviation and liquidity constraints are considered to generate the target inventory vector. Minimizing the inventory deviation means controlling the difference between the target inventory vector and the temporary inventory vector after liquidation to the lowest possible range during the liquidation optimization process. The liquidity constraint means that during the liquidation optimization process, the global effective liquidity parameter is introduced as a constraint condition to limit the adjustment range of the target inventory vector.
[0011] Optionally, the generation of the marginal price result set, the transaction fee rate result set, and the inventory correction result includes: In the blockchain smart contract, the LS-LMSR algorithm is invoked, an improved cost function is designed, and the global effective liquidity parameter, target inventory vector and asset inventory status are input; Using the target inventory vector as the anchor benchmark, calculate the marginal price result set, and establish a parameter linkage relationship between the marginal price result set and the global effective liquidity parameter; Using the marginal price result set and the global effective liquidity parameter as input, calculate the transaction fee result set, and maintain a one-to-one correspondence between the transaction fee result set and the marginal price result set; Based on the marginal price result set and the transaction fee rate result set, the asset inventory status is updated to generate inventory correction results.
[0012] Optionally, the generation of the entropy risk value and the risk control parameter set includes: At the end of the settlement period, the risk input is calculated using the unified settlement price, marginal price result set, transaction fee rate result set, inventory correction result, oracle price volatility indicator and MEV risk index; Based on the risk input, the entropy risk measurement function is called to calculate the entropy risk value; Based on the entropy risk value, a risk control parameter set is generated through a risk mapping function. The risk control parameter set includes parameters for modulating the global effective liquidity parameter, parameters for modulating the batch clearing correction strength parameter, parameters for modulating the clearing cycle interval parameter, and parameters for modulating the transaction fee parameter set.
[0013] Optionally, the process of modulating the pool operating parameter system and updating transaction settlement includes: In a blockchain smart contract, the entropy risk value and the set of risk control parameters are loaded, and the parameter modulation process is initiated. Based on the entropy risk value and risk control parameter set, the pool operation parameter system is modulated, and the global effective liquidity parameter, batch liquidation correction strength parameter, liquidation cycle interval parameter and transaction fee parameter set are updated. The update results are written into the blockchain smart contract parameter storage area. Execute transaction settlement based on the marginal price result set and transaction fee rate result set, complete price and fee calculations, and update asset inventory status; After the transaction settlement is completed, the transaction data during the clearing period is recorded and the on-chain transaction volume data is updated. The asset inventory status is refreshed simultaneously. Based on oracle input and cross-chain monitoring, the cross-chain fund flow data, oracle price volatility index and MEV risk index are refreshed. The updated on-chain transaction volume data, asset inventory status, cross-chain fund flow data, oracle price volatility index and MEV risk index will be written back to the on-chain parameter set and the off-chain parameter set. Based on the clearing cycle interval parameters, set the start and end dates of the next clearing cycle and proceed to the next clearing cycle.
[0014] The beneficial effects of this invention are: Firstly, it can achieve unified modeling of multi-dimensional market information such as trading volume fluctuations, cross-chain fund flows, and price oracle instability, thereby enhancing the robustness of the pool in complex environments.
[0015] Secondly, introducing a global effective liquidity parameter into the batch clearing mechanism and generating a target inventory vector in conjunction with the inventory optimization process can effectively alleviate the inventory deviation problem, improve the fairness of clearing prices and the stability of settlement results, and avoid the shortcomings of the existing continuous matching method that is susceptible to price manipulation and inventory imbalance.
[0016] Furthermore, by designing an improved LS-LMSR algorithm cost function and establishing a dynamic linkage between marginal price and transaction fee rate, adaptive optimization of price adjustment and fee rate control can be achieved, enabling the pool to maintain a higher resilience to market fluctuations.
[0017] Finally, by combining entropy risk measurement to generate a set of risk control parameters, the level of precision in risk identification and control is further improved, which provides a guarantee for the stable operation of the pool under extreme market conditions and achieves an overall improvement in the stability of decentralized pools. Attached Figure Description
[0018] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings:
[0019] Figure 1 This is an overall flowchart of a blockchain-based decentralized pool stability improvement method proposed in this invention; Figure 2 This is a schematic diagram of the two-layer liquidity parameter framework and parameter synthesis function proposed in this invention for generating globally effective liquidity parameters; Figure 3 This is a schematic diagram illustrating the structure of the improved LS-LMSR algorithm proposed in this invention, which dynamically links marginal price and transaction fee rate through its cost function. Detailed Implementation
[0020] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0021] refer to Figure 1-3 A method for improving the stability of decentralized pools based on blockchain includes the following steps: During the operation of the blockchain network, a settlement cycle parameter is set. During the settlement cycle, on-chain operation data is collected, including transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information. Cross-chain environment data is also collected, including fund flow data, oracle price volatility index and MEV risk index. On-chain parameter set and off-chain parameter set are constructed. During the liquidation cycle, based on the on-chain parameter set, the on-chain layer liquidity parameters are calculated, and based on the off-chain parameter set, the off-chain layer liquidity parameters are calculated. The global effective liquidity parameters are obtained by using a parameter synthesis function and output for subsequent batch liquidation and pricing correction. At the end of the settlement cycle, a batch settlement mechanism is executed to generate a unified settlement price. During the settlement optimization process, a global effective liquidity parameter is introduced to solve for the target inventory vector. The unified settlement price and the target inventory vector are output for subsequent cost function correction. The global effective liquidity parameter and the target inventory vector are introduced into the cost function of the improved LS-LMSR algorithm to calculate the marginal price result set and the transaction fee rate result set. The inventory status is corrected based on the marginal price result set and the transaction fee rate result set, and the inventory correction result is output for risk measurement. Based on the unified clearing price, marginal price result set, transaction fee rate result set, inventory correction result, oracle price volatility indicator and MEV risk index, the entropy risk measurement function is called to calculate the entropy risk value and generate a risk control parameter set. The risk control parameter set includes parameters for modulating the global effective liquidity parameter, parameters for modulating the batch clearing correction strength parameter, parameters for modulating the clearing cycle interval parameter, and parameters for modulating the transaction fee rate parameter set. In blockchain smart contracts, the pool's operating parameter system is modulated using entropy risk value and a set of risk control parameters. This includes global effective liquidity parameters, batch liquidation correction strength parameters, liquidation cycle interval parameters, and transaction fee rate parameters. Based on the marginal price result set and transaction fee rate result set, transaction settlement and inventory status updates are completed. The updated on-chain and off-chain parameter sets, including on-chain transaction volume data, asset inventory status, cross-chain fund flow data, oracle price volatility indicators, and MEV risk index, are then written back to the on-chain and off-chain parameter sets for the next liquidation cycle.
[0022] In this embodiment, the construction of the on-chain parameter set, the off-chain parameter set, and the liquidation cycle parameter includes: During the operation of the blockchain network, a settlement cycle parameter is set, which includes the start and end dates of the settlement cycle, the length of the settlement cycle, and the triggering rules for the settlement cycle. Using the liquidation cycle as the operating time window, it collects on-chain operating data, including transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information, and also collects cross-chain environment data, including fund flow data, oracle price volatility indicators and MEV risk index. Perform time alignment, unit consistency, and outlier removal on in-chain and cross-chain operational data, and maintain high consistency between data and blocks; Based on the on-chain operation data, an on-chain parameter set is constructed, which includes transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information. Based on cross-chain environment data, an off-chain parameter set is constructed, which includes fund flow data, oracle price volatility indicators, and MEV risk index. This forms a continuously accumulating and updated set of on-chain parameters and off-chain parameters during the liquidation cycle; The oracle price volatility index measures the short-term uncertainty of off-chain asset price inputs, and the MEV risk index measures the systemic transaction manipulation risk caused by block packaging behavior. Both serve as external inputs for measuring the stability risk of the pool. Submit the on-chain parameter set, off-chain parameter set, and liquidation cycle parameter to the blockchain smart contract for subsequent steps to call.
[0023] In this embodiment, the generation of the global effective liquidity parameter includes: During the liquidation cycle, the on-chain parameter set and the off-chain parameter set are used as inputs. The time window is divided according to the liquidation cycle parameters. The on-chain parameter set and the off-chain parameter set are normalized to generate the standardized results of the on-chain parameter set and the standardized results of the off-chain parameter set. Based on the standardized results of the on-chain parameter set, and by integrating transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information, the on-chain liquidity parameters are calculated using a weighted normalization calculation method. Based on the standardized results of the off-chain parameter set, the off-chain liquidity parameters are calculated by combining capital flow data, oracle price volatility indicators and MEV risk index through a weighted normalization calculation method. The in-chain liquidity parameters and the out-of-chain liquidity parameters are input into a parameter synthesis function, and the globally effective liquidity parameters are obtained through a non-linear combination method. The parameter synthesis function is specifically as follows: ; in, This represents the global effective liquidity parameter, with a value range of [0,1]. This represents the in-chain liquidity parameter, derived from the standardized result of the in-chain parameter set, and its value ranges from [0,1]. This represents the off-chain liquidity parameter, derived from the standardized result of the off-chain parameter set, and its value ranges from [0,1]. , These represent weight parameters, corresponding to the inner and outer layers of the chain, respectively, with values ranging from [0,1], and simultaneously satisfying the constraints. , The time window correlation coefficient, with a value range of [-1, 1], is used to characterize the synchronicity between the inner and outer layers of the chain within the time window determined by the liquidation cycle parameter. The Calculate using the following formula: ; in, This represents the set of time window indices that determine the liquidation cycle parameters. Indicates time index The scalar summary value of the standardized results of the parameter set within the lower chain. Indicates time index The scalar summary value of the standardized results of the lower chain extrinsic parameter set. and They represent and The arithmetic mean; Output the global effective liquidity parameters and store them in the blockchain smart contract parameter storage area for use by the batch liquidation mechanism and the cost function of the improved LS-LMSR algorithm.
[0024] In this embodiment, the generation of the unified liquidation price and the target inventory vector includes: At the end of the liquidation cycle, a batch liquidation mechanism is executed; Specifically, the on-chain transaction volume data is frozen, and a cumulative buy volume function and a cumulative sell volume function are constructed based on the on-chain transaction volume data to represent the supply and demand relationship of transactions at different prices. The cumulative purchase volume function represents the change in purchase quantity as the price changes, which is gradually accumulated from the lowest price at different price levels. It is used to reflect the cumulative change in buying demand during the price increase process. The cumulative selling volume function represents the number of shares sold gradually increasing from the highest price at different price levels, reflecting the cumulative change in selling supply during a price decline. A unified settlement price is determined at the intersection of the cumulative buy volume function and the cumulative sell volume function, and a dynamic balance between price and trading volume is achieved by minimizing the difference between buy and sell volumes. Under a unified clearing price, transaction batches are matched and settled. Combining the asset inventory status at the end of the period with the net transaction volume under the unified clearing price, a temporary inventory vector after clearing is calculated to describe the inventory distribution after the settlement of the current batch. The specific calculation process of the post-clearing temporary inventory vector is as follows: under a unified clearing price, all transactions within the clearing period are matched, and the difference between the buyer's transaction volume and the seller's transaction volume is calculated to obtain the net transaction volume vector; the net transaction volume vector is summed with the asset inventory status vector at the end of the clearing period to form the post-clearing temporary inventory vector, which is used to characterize the inventory distribution after settlement at the unified clearing price. During the liquidation optimization process, a global effective liquidity parameter is introduced to perform optimization calculations on the temporary inventory vector after liquidation. Simultaneously, considering the minimization of inventory deviation and liquidity constraints, a target inventory vector is generated to correct the inventory structure and enhance the stability of the bottom pool under different market conditions. Minimizing inventory deviation means controlling the difference between the target inventory vector and the temporary inventory vector after liquidation to the lowest possible range during the liquidation optimization process, so as to reduce sudden changes in inventory status and ensure the smoothness and continuity of the inventory update process. The liquidity constraint means that during the liquidation optimization process, the global effective liquidity parameter is introduced as a constraint condition to limit the adjustment range of the target inventory vector, so that the inventory adjustment amount matches the actual market liquidity level, thereby avoiding excessive adjustment when liquidity is insufficient and maintaining the stability and robustness of the bottom pool operation. Output a unified liquidation price and target inventory vector, and input both into the improved LS-LMSR algorithm cost function for subsequent dynamic correction of marginal price and transaction rate.
[0025] In this embodiment, the generation of the marginal price result set, the transaction fee rate result set, and the inventory correction result includes: In the blockchain smart contract, the LS-LMSR algorithm is invoked, an improved cost function is designed, and the global effective liquidity parameter, target inventory vector and asset inventory status are input; The improved cost function is specifically as follows: ; in, This represents the improved cost function. Represents the asset inventory state vector. , This represents the global effective liquidity parameter. This represents the i-th component in the asset inventory state vector. Represents the target inventory vector. For inventory adjustment weighting constants, This represents the deviation constraint term between the inventory status and the target inventory vector; The LS-LMSR algorithm stands for Liquidity-Sensitive Logarithmic Market Scoring Rule. Its inputs are the asset's inventory vector and liquidity parameters, and its outputs are the asset's marginal price and transaction cost function value. By introducing a liquidity parameter into the traditional logarithmic market scoring rule, this algorithm allows transaction prices to dynamically adjust based on inventory quantity and market liquidity. This maintains price stability under low trading volume and reflects the true market supply and demand relationship under high trading volume. The LS-LMSR algorithm provides a continuous and differentiable pricing mechanism, enabling the market to quickly complete price discovery while ensuring minimal arbitrage opportunities and remaining sensitive to changes in inventory structure, thereby improving the stability of the liquidity pool under different transaction sizes. Using the target inventory vector as the anchor benchmark, calculate the marginal price result set, and establish a parameter linkage relationship between the marginal price result set and the global effective liquidity parameter; The set of marginal price results is obtained by calculating the gradient of the cost function, specifically using the following formula: ; in, Let the numerator represent the marginal price of the i-th asset. Indicates inventory In liquidity parameters The exponential weighted value, denominator term This represents the index-weighted sum of all assets. This represents the correction and compensation term based on the target inventory vector; Using the marginal price result set and the global effective liquidity parameter as input, the transaction fee result set is calculated through (), while maintaining a one-to-one correspondence between the transaction fee result set and the marginal price result set; The transaction fee rate result set is based on the marginal price result set, combined with the global effective liquidity parameter. The definition and specific calculation formula are as follows: ; in, This represents the transaction fee rate for the i-th asset. Let represent the marginal price of the i-th asset. This represents the rate modulation factor, used to control the price's sensitivity to rates. This represents the inventory deviation penalty coefficient, used to increase the rate when there is an inventory imbalance. This represents the difference between the current inventory status and the target inventory vector. Based on the marginal price result set and the transaction fee rate result set, the asset inventory status is updated in quantity to generate inventory correction results; The quantity update specifically involves: using the marginal price result set as the pricing benchmark for inventory status adjustment, using the transaction fee rate result set as the adjustment factor for inventory status adjustment, performing gradual correction according to the direction of marginal price based on the difference between the target inventory vector and the existing asset inventory status, and dynamically scaling the correction range in conjunction with the transaction fee rate to obtain the adjusted asset inventory status, forming the inventory correction result, which is used to enter the risk measurement process. The output sets of marginal price results and transaction fee rate results are used in the transaction settlement process, and the output set of inventory correction results are used as input for the entropy risk measurement function.
[0026] In this embodiment, the generation of the entropy risk value and the risk control parameter set includes: At the end of the settlement period, the risk input is calculated using the unified settlement price, marginal price result set, transaction fee rate result set, inventory correction result, oracle price volatility indicator and MEV risk index; The risk input quantity is denoted as The data used in the calculations were all normalized, and the calculation method was as follows: ; in, Indicates a unified settlement price. This represents the mean of the set of marginal price outcomes. Let the variance of the marginal price outcome set be... This indicates an indicator of oracle price volatility. Indicates the MEV risk index, This represents the inventory deviation vector corresponding to the inventory correction result. Represent non-negative weights and satisfy ; Based on the risk input, the entropy risk measurement function is called to calculate the entropy risk value; Entropy risk value is denoted as The calculation method is as follows: ; in, This represents the risk aversion coefficient. , The larger the value, the more sensitive the system is to risk fluctuations, and the higher the calculated risk value. The smaller the value, the more tolerant the system is to risk, and the relatively lower the risk value. This represents the expectation operator on the sample during the liquidation period; Based on the entropy risk value, a risk control parameter set is generated through a risk mapping function. The risk control parameter set includes parameters for modulating the global effective liquidity parameter, parameters for modulating the batch clearing correction strength parameter, parameters for modulating the clearing cycle interval parameter, and parameters for modulating the transaction fee parameter set. The risk mapping function is specifically as follows: ; in, These are calibration coefficients; The parameter used to modulate the global effective liquidity parameter. The parameter used to modulate the batch clearing correction strength parameter. The parameter used to modulate the clearing cycle interval is... This represents the parameters used to modulate the transaction fee rate set; The entropy risk value and risk control parameter set are written into the blockchain smart contract parameter storage area, which can be called when modulating the global effective liquidity parameter, batch liquidation correction strength parameter, liquidation cycle interval parameter and transaction fee rate parameter set.
[0027] In this embodiment, the process of modulating the pool operating parameter system and updating transaction settlement includes: In a blockchain smart contract, the entropy risk value and the set of risk control parameters are loaded, and the parameter modulation process is initiated. Based on the entropy risk value and risk control parameter set, the pool operation parameter system is modulated, and the global effective liquidity parameter, batch liquidation correction strength parameter, liquidation cycle interval parameter and transaction fee parameter set are updated. The update results are written into the blockchain smart contract parameter storage area. Execute transaction settlement based on the marginal price result set and transaction fee rate result set, complete price and fee calculations, and update asset inventory status; After the transaction settlement is completed, the transaction data during the clearing period is recorded and the on-chain transaction volume data is updated. The asset inventory status is refreshed simultaneously. Based on oracle input and cross-chain monitoring, the cross-chain fund flow data, oracle price volatility index and MEV risk index are refreshed. Specifically, when refreshing cross-chain fund flow data based on oracle input, a decentralized oracle network is accessed in the smart contract to obtain fund transfer transaction records between different chains in the cross-chain bridge contract in real time, and the amount, direction, and corresponding timestamp of fund transfer are written into the cross-chain fund flow data set; when refreshing the oracle price volatility index, the multi-exchange price sequence provided by the decentralized oracle is called, and the instantaneous variance of the price is calculated using a sliding window using the time-weighted volatility calculation method and the price volatility index is updated; when refreshing the MEV risk index, the on-chain block packaged transaction sequence input by the oracle is combined to identify visible front-running, pincer attack, and arbitrage behaviors, and a new MEV risk index is calculated based on the frequency of event occurrence, transaction slippage offset, and potential arbitrage profit and updated to the off-chain parameter set; The updated on-chain transaction volume data, asset inventory status, cross-chain fund flow data, oracle price volatility index and MEV risk index will be written back to the on-chain parameter set and the off-chain parameter set. Based on the clearing cycle interval parameters, set the start and end dates of the next clearing cycle and proceed to the next clearing cycle.
[0028] Example 1: To verify the feasibility of this invention in practice, it was applied to the liquidity pool management of a decentralized trading platform. The stability performance of existing methods under different market conditions was compared, with a focus on examining the improvements made by this invention in price stability, inventory balance, and risk control. The experimental environment included on-chain transaction volume data, asset inventory status, cross-chain fund flow data, oracle price volatility indicators, and miner extractable value risk indices, covering high-frequency trading phases, large-scale cross-chain fund inflows, and periods of significant oracle price volatility.
[0029] In this scenario, existing liquidity pools generally rely on a single price signal and continuous matching, which can easily lead to liquidation price deviations and inventory structure imbalances. During the experiment, the test trading assets included three mainstream tokens: stablecoins, equity tokens, and governance tokens. The average daily trading volume for each token was set between $12 million and $15 million, with volatility between 12% and 18%, and single cross-chain fund flows ranging from $3 million to $5 million. Oracle data was sampled every 30 seconds, and the miner's extractable value risk index fluctuated between 10 and 15.
[0030] In application, this invention uses joint modeling of on-chain and off-chain parameter sets to execute a batch liquidation mechanism at the end of the liquidation cycle, generating a unified liquidation price and outputting a target inventory vector. Subsequently, the improved LS-LMSR algorithm cost function is called in the smart contract to dynamically calculate the marginal price and transaction fee rate, and a risk control parameter set is generated based on entropy risk measurement, thereby achieving stable operation of the pool under complex market conditions.
[0031] To evaluate the effectiveness, the performance of the traditional continuous matching AMM mechanism and the method of this invention was compared within the same running cycle. Experiments tested the deviation of the unified clearing price, inventory imbalance, price slippage, and risk event trigger rate. Deviation was measured by comparing the difference between the unified clearing price and the external market reference price; inventory imbalance was calculated by the deviation of the multi-asset ratio; price slippage was measured based on the price fluctuations before and after large transactions; and the risk event trigger rate was statistically analyzed by the frequency with which the entropy risk value exceeded a threshold.
[0032] The specific experimental data are shown in the table below: Table 1. Results of comparative experiments on the stability of decentralized pools
[0033] As shown in Table 1, the average level of liquidation price deviation using the method described in this invention was reduced to 1.92%, a decrease of 0.43 percentage points compared to the traditional method. This indicates that the combination of the batch liquidation mechanism and the liquidity parameter framework better suppressed liquidation price distortion caused by price fluctuations. Inventory imbalance decreased from 14.8% to 12.6%, demonstrating that target inventory vector optimization can effectively alleviate inventory deviation problems in multi-asset pools.
[0034] Regarding slippage, the method of this invention reduces slippage from 0.54% to 0.45%, demonstrating that the dynamic linkage mechanism between marginal price and transaction fee rate can maintain price stability under the impact of large transactions. The risk event trigger rate decreases from 7.1% to 5.9%, indicating that entropy risk measurement plays a significant role in identifying and controlling potential risks, reducing the probability of pool imbalance in extreme market environments.
[0035] Notably, the method of this invention also demonstrates significant advantages in capital utilization and settlement efficiency. Capital utilization is increased to 90.7%, 10.5 percentage points higher than the traditional method, indicating that the global effective liquidity parameter can maintain flexible liquidity allocation under broader market conditions. Settlement efficiency reaches 91.3%, 8.7 percentage points higher than the traditional method, showcasing the efficiency advantage of the batch clearing mechanism in periodic processing.
[0036] Under extreme volatility conditions, the capital loss rate of the method of this invention is 9.5%, which is 1.7 percentage points lower than that of the traditional method. This reflects the dual role of the improved LS-LMSR cost function and the risk control parameter set, effectively mitigating the capital loss caused by external shocks.
[0037] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for improving the stability of a decentralized pool based on blockchain, characterized in that, Includes the following steps: During the operation of the blockchain network, set the settlement cycle parameters, collect on-chain operation data and cross-chain environment data, and construct on-chain parameter set and off-chain parameter set; Based on the set of in-chain parameters, calculate the in-chain layer liquidity parameters; based on the set of out-of-chain parameters, calculate the out-of-chain layer liquidity parameters; and use a parameter synthesis function to obtain the global effective liquidity parameters. A batch clearing mechanism is implemented to generate a unified clearing price, and a globally effective liquidity parameter is introduced during the clearing optimization process to solve for the target inventory vector; The global effective liquidity parameter and the target inventory vector are introduced into the LS-LMSR algorithm. An improved cost function is designed to calculate the marginal price result set and the transaction fee rate result set, and the inventory status is corrected to generate the inventory correction result. Based on the unified clearing price, marginal price result set, transaction fee rate result set, and inventory correction result, the entropy risk measurement function is called to calculate the entropy risk value and generate a set of risk control parameters. In blockchain smart contracts, the pool's operating parameter system is modulated using entropy risk value and risk control parameter set. Transaction settlement and inventory status updates are completed based on marginal price result set and transaction fee rate result set. The updated on-chain parameter set and off-chain parameter set are then written back to enter the next settlement cycle.
2. The method for improving the stability of a decentralized pool based on blockchain according to claim 1, characterized in that, The construction of the on-chain parameter set, off-chain parameter set, and liquidation cycle parameters includes: During the operation of the blockchain network, a settlement cycle parameter is set, which includes the start and end dates of the settlement cycle, the length of the settlement cycle, and the triggering rules for the settlement cycle. Using the liquidation cycle as the operating time window, it collects on-chain operating data, including transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information, and also collects cross-chain environment data, including fund flow data, oracle price volatility indicators and MEV risk index. Perform time alignment, unit consistency, and outlier removal on in-chain and cross-chain operational data, and maintain high consistency between data and blocks; Based on the on-chain operation data, an on-chain parameter set is constructed, which includes transaction volume data, asset inventory status, inventory imbalance and yield fluctuation information. Based on cross-chain environment data, an off-chain parameter set is constructed, which includes fund flow data, oracle price volatility indicators, and MEV risk index. This forms a continuously accumulating and updated set of on-chain parameters and off-chain parameters during the liquidation cycle.
3. The method for improving the stability of a decentralized pool based on blockchain according to claim 1, characterized in that, The generation of the global effective liquidity parameters includes: During the liquidation cycle, the on-chain parameter set and the off-chain parameter set are used as inputs. The time window is divided according to the liquidation cycle parameters. The on-chain parameter set and the off-chain parameter set are normalized to generate the standardized results of the on-chain parameter set and the standardized results of the off-chain parameter set. Based on the standardized results of the in-chain parameter set, the in-chain layer liquidity parameters are calculated using a weighted normalization method. Based on the standardized results of the off-chain parameter set, the off-chain liquidity parameters are calculated using a weighted normalization method. By inputting the intra-chain liquidity parameters and the extra-chain liquidity parameters into a parameter synthesis function, the global effective liquidity parameters are obtained through a non-linear combination method.
4. The method for improving the stability of a decentralized pool based on blockchain according to claim 1, characterized in that, The generation of the unified liquidation price and target inventory vector includes: At the end of the liquidation cycle, a batch liquidation mechanism is executed; Specifically, freeze the on-chain transaction volume data and construct a cumulative buy volume function and a cumulative sell volume function based on the on-chain transaction volume data; A unified settlement price is determined at the intersection of the cumulative buy volume function and the cumulative sell volume function; Under a unified clearing price, transaction batches are matched and settled. Combining the asset inventory status at the end of the period with the net transaction volume under the unified clearing price, a temporary inventory vector after clearing is calculated. During the liquidation optimization process, a global effective liquidity parameter is introduced to perform optimization calculations on the temporary inventory vector after liquidation. Simultaneously, the minimization of inventory deviation and liquidity constraints are considered to generate the target inventory vector. Minimizing the inventory deviation means controlling the difference between the target inventory vector and the temporary inventory vector after liquidation to the lowest possible range during the liquidation optimization process. The liquidity constraint means that during the liquidation optimization process, the global effective liquidity parameter is introduced as a constraint condition to limit the adjustment range of the target inventory vector.
5. The method for improving the stability of a decentralized pool based on blockchain according to claim 1, characterized in that, The generation of the marginal price result set, transaction fee rate result set, and inventory adjustment result includes: In the blockchain smart contract, the LS-LMSR algorithm is invoked, an improved cost function is designed, and the global effective liquidity parameter, target inventory vector and asset inventory status are input; Using the target inventory vector as the anchor benchmark, calculate the marginal price result set, and establish a parameter linkage relationship between the marginal price result set and the global effective liquidity parameter; Using the marginal price result set and the global effective liquidity parameter as input, calculate the transaction fee result set, and maintain a one-to-one correspondence between the transaction fee result set and the marginal price result set; Based on the marginal price result set and the transaction fee rate result set, the asset inventory status is updated to generate inventory correction results.
6. The method for improving the stability of a decentralized pool based on blockchain according to claim 1, characterized in that, The generation of the entropy risk value and risk control parameter set includes: At the end of the settlement period, the risk input is calculated using the unified settlement price, marginal price result set, transaction fee rate result set, inventory correction result, oracle price volatility indicator and MEV risk index; Based on the risk input, the entropy risk measurement function is called to calculate the entropy risk value; Based on the entropy risk value, a risk control parameter set is generated through a risk mapping function. The risk control parameter set includes parameters for modulating the global effective liquidity parameter, parameters for modulating the batch clearing correction strength parameter, parameters for modulating the clearing cycle interval parameter, and parameters for modulating the transaction fee parameter set.
7. The method for improving the stability of a decentralized pool based on blockchain according to claim 1, characterized in that, The process of modulating the pool operating parameter system and updating transaction settlement includes: In a blockchain smart contract, the entropy risk value and the set of risk control parameters are loaded, and the parameter modulation process is initiated. Based on the entropy risk value and risk control parameter set, the pool operation parameter system is modulated, and the global effective liquidity parameter, batch liquidation correction strength parameter, liquidation cycle interval parameter and transaction fee parameter set are updated. The update results are written into the blockchain smart contract parameter storage area. Execute transaction settlement based on the marginal price result set and transaction fee rate result set, complete price and fee calculations, and update asset inventory status; After the transaction settlement is completed, the transaction data during the clearing period is recorded and the on-chain transaction volume data is updated. The asset inventory status is refreshed simultaneously. Based on oracle input and cross-chain monitoring, the cross-chain fund flow data, oracle price volatility index and MEV risk index are refreshed. The updated on-chain transaction volume data, asset inventory status, cross-chain fund flow data, oracle price volatility index and MEV risk index will be written back to the on-chain parameter set and the off-chain parameter set. Based on the clearing cycle interval parameters, set the start and end dates of the next clearing cycle and proceed to the next clearing cycle.