A liquidity pool fusion method, device, equipment and computer program product
By generating virtual liquidity pools and integrating feature information of different liquidity pools, the problems of high computing complexity and suboptimal solutions in traditional blockchain transactions are solved, and efficient digital resource replacement is achieved.
Patent Information
- Application Number
- CN202411692347.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-25
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2044-11-25
AI Technical Summary
Traditional blockchain transaction intelligent routing protocols have high computational complexity when processing large amounts of liquidity pools, making it difficult to find the global optimal solution, and static or simple dynamic routing strategies are difficult to adapt to the rapidly changing environment, resulting in suboptimal transaction execution.
By determining the sub-liquidity pool to be fused and its protocol type, a virtual liquidity pool is generated, and the characteristic information of different liquidity pools is fused to reduce the computational complexity and improve the permutation efficiency.
Fusion of adjacent sub-liquidity pools into virtual pools, reducing the number of nodes, reducing complexity from exponential to approximate linear levels, improving digital resource permutation efficiency, reducing dependence on external data, and dynamically adjusting edge weights to find the global optimal solution.
Smart Images

Figure CN119228542B_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present application belong to the technical field of blockchain, and particularly relate to a method, apparatus, device, and computer program product for fusing liquidity pools. Background Art
[0002] A liquidity pool is a digital resource pool managed by a smart contract and is used to support decentralized transactions. Each liquidity pool corresponds to a tradable resource group, and each tradable resource group consists of two different digital resources. The tradable resource group can perform resource replacement in the corresponding liquidity pool, and the replacement process is completed through a smart contract.
[0003] When traditional blockchain transaction intelligent routing protocols process a large number of liquidity pools, they need to perform iterative and sharding calculations on all liquidity pools, resulting in high computational complexity. Especially in high-frequency trading or large-scale networks, it may cause performance bottlenecks. Traditional methods may not be able to fully utilize the combined advantages of multiple liquidity pools, resulting in the found path not being the truly global optimal solution. For example, liquidity pools of different protocol versions such as UniSwap V2 and V3 or different DEXs (Decentralized Exchanges), due to different mechanisms, are difficult to be uniformly optimized under the same framework.
[0004] With the rapid change of the environment for digital resource replacement, static or simple dynamic routing strategies are difficult to adapt to these changes in a timely manner, which may lead to suboptimal transaction execution. Improving the accuracy of path calculation usually means more computational effort, while improving efficiency may sacrifice accuracy. Existing methods are difficult to achieve a good balance between the two. Summary of the Invention
[0005] In view of this, embodiments of the present application provide a method, apparatus, device, and computer program product for fusing liquidity pools to improve the replacement efficiency of digital resources between different liquidity pools.
[0006] The first aspect of the embodiments of the present application provides a method for fusing liquidity pools, including:
[0007] Determine a first sub-liquidity pool and a second sub-liquidity pool to be fused; the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource;
[0008] Determine a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool;
[0009] Determine the fusion feature information according to the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type;
[0010] Generate a virtual liquidity pool based on the fusion feature information; the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource.
[0011] In an implementation manner of the first aspect, the first protocol type is the first replacement protocol or the second replacement protocol; the second protocol type is the first replacement protocol or the second replacement protocol;
[0012] The first replacement protocol is a liquidity pool protocol with uniformly distributed liquidity characteristics, and the second replacement protocol is a liquidity pool protocol with concentrated liquidity characteristics.
[0013] In an implementation manner of the first aspect, if both the first protocol type and the second protocol type are the first replacement protocol; the determining the fusion feature information according to the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type includes:
[0014] Determine the first reserve of the first digital resource, the second reserve of the second digital resource, and the first replacement fee information in the first sub-liquidity pool;
[0015] Determine the third reserve of the second digital resource, the fourth reserve of the third digital resource, and the second replacement fee information in the second sub-liquidity pool;
[0016] Determine the fifth reserve of the first digital resource according to the first reserve, the second reserve, the third reserve, the first replacement fee information, and the second replacement fee information;
[0017] Determine the sixth reserve of the third digital resource according to the second reserve, the third reserve, the fourth reserve, the first replacement fee information, and the second replacement fee information;
[0018] Generate the fusion feature information according to the fifth reserve and the sixth reserve.
[0019] In an implementation manner of the first aspect, if both the first protocol type and the second protocol type are the second replacement protocol; the determining the fusion feature information according to the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type includes:
[0020] Determine the first price range of the second digital resource;
[0021] Determine a plurality of first price segmentation points based on the first price range;
[0022] Perform virtual replacement according to each first price segmentation point to obtain a first replacement result;
[0023] Determine a first feature result in the first replacement result in a preset manner; the first feature result includes a second price range of a price upper limit value, a price lower limit value, a first current price, and a liquidity value corresponding to the second price range;
[0024] Determine a fifth reserve quantity of the first digital resource based on the price upper limit value, the price lower limit value, and the first current price;
[0025] Determine a sixth reserve quantity of the third digital resource based on the price lower limit value, the first current price, and the liquidity value;
[0026] Generate fusion feature information based on the fifth reserve quantity and the sixth reserve quantity.
[0027] In an implementation manner of the first aspect, before determining the first feature result in the replacement result in a preset manner, determining the fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type further includes:
[0028] Determine first iteration information corresponding to the first replacement result;
[0029] When the first iteration information does not meet a preset first iteration condition, update the first price range to which it belongs according to the first feature result, and return to the step of determining a plurality of first price segmentation points based on the first price range.
[0030] In an implementation manner of the first aspect, if one of the first protocol type and the second protocol type is a first replacement protocol and the other is a second replacement protocol; determining the fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type includes:
[0031] Determine a second current price of a sub-liquidity pool corresponding to the first replacement protocol, and a second price range of sub-liquidity corresponding to the second replacement protocol;
[0032] Perform virtual replacement on the sub-liquidity pool corresponding to the first replacement protocol to obtain a second replacement result;
[0033] Determine a plurality of second price segmentation points based on the second price range, and perform virtual replacement according to each second price segmentation point to obtain a third replacement result;
[0034] Generate a second feature result based on the second replacement result and the third replacement result;
[0035] Generate fusion feature information based on the second feature result.
[0036] In an implementation manner of the first aspect, before generating the fusion feature information based on the second feature result, determining the fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type further includes:
[0037] Determine second iteration information corresponding to the third replacement result;
[0038] When the second iteration information does not meet a preset second iteration condition, update the second price range according to the third feature result, and return to the step of determining a plurality of second price segmentation points based on the second price range and performing virtual replacement according to each second price segmentation point to obtain a third replacement result.
[0039] In an implementation manner of the first aspect, the second feature result includes a seventh reserve corresponding to the second replacement result and corresponding to the third tradable resource group, an eighth reserve corresponding to the third replacement result and corresponding to the third tradable resource group, and third replacement cost information; the eighth reserve corresponds to the first tradable resource group; generating the fusion feature information based on the second feature result includes:
[0040] Determine a fifth reserve based on the seventh reserve, the eighth reserve, and the third replacement cost information;
[0041] Determine a sixth reserve based on the seventh reserve, the eighth reserve, and the third replacement cost information;
[0042] Generate fusion feature information based on the fifth reserve and the sixth reserve.
[0043] A second aspect of the embodiments of the present application provides a liquidity pool fusion device, including:
[0044] A to-be-fused pool determination module, configured to determine a first sub-liquidity pool and a second sub-liquidity pool to be fused; the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource;
[0045] An agreement type determination module, configured to determine a first agreement type of a first sub-liquidity pool and a second agreement type of a second sub-liquidity pool;
[0046] A fusion feature information determination module, configured to determine fusion feature information according to the first tradable resource group, the second tradable resource group, the first agreement type, and the second agreement type;
[0047] A virtual liquidity pool generation module, configured to generate a virtual liquidity pool based on the fusion feature information; the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource.
[0048] A third aspect of the embodiments of the present application provides an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the liquidity pool fusion method as described in the first aspect above.
[0049] A fourth aspect of the embodiments of the present application provides a computer program product, including a computer program. When the computer program is run, the liquidity pool fusion method as described in the first aspect above is executed.
[0050] A fifth aspect of the embodiments of the present application provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the liquidity pool fusion method as described in the first aspect above is implemented.
[0051] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0052] In an embodiment of the present application, by determining a first sub-liquidity pool and a second sub-liquidity pool to be fused; the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource; determining a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool; determining fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type; generating a virtual liquidity pool based on the fusion feature information; the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource, thereby realizing that by fusing adjacent sub-liquidity pools (where the tradable resource groups have the same digital resource) into a virtual pool, the number of nodes that need to be considered when performing digital resource replacement across sub-liquidity pools is greatly reduced, and the equivalent result that originally required replacement across sub-liquidity pools can be obtained through the fused virtual liquidity pool, reducing the complexity from exponential level to approximately linear level, and greatly improving the replacement efficiency of digital resources. Description of the Drawings
[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings in the following description are only some embodiments of the present application, and those of ordinary skill in the art can also obtain other drawings based on these drawings without creative efforts.
[0054] Figure 1 It is a schematic diagram of a method for fusing liquidity pools provided by an embodiment of the present application;
[0055] Figure 2 It is a schematic diagram of the fusion process between sub-liquidity pools provided by an embodiment of the present application;
[0056] Figure 3 It is a schematic diagram of the generation process of fusion feature information provided by an embodiment of the present application;
[0057] Figure 4 It is a schematic diagram of an iterative process provided by an embodiment of the present application;
[0058] Figure 5 It is a schematic diagram of a device for fusing liquidity pools provided by an embodiment of the present application;
[0059] Figure 6 It is a schematic diagram of an electronic device provided by an embodiment of the present application. Detailed Embodiments
[0060] In the following description, specific details such as specific system architectures, technologies, etc. are presented for the purpose of illustration rather than limitation, so as to thoroughly understand the embodiments of the present application. However, those skilled in the art should clearly understand that the present application can also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid unnecessary details from interfering with the description of the present application.
[0061] It should be understood that when used in the specification and appended claims of the present application, the term "comprising" indicates the presence of the described features, wholes, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components, and / or their combinations.
[0062] It should also be understood that the term "and / or" used in the specification and appended claims of the present application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0063] As used in the specification and appended claims of the present application, the term "if" can be interpreted as "when", "once", "in response to determining", or "in response to detecting" depending on the context. Similarly, the phrase "if determined" or "if detecting [the described condition or event]" can be interpreted as meaning "once determined", "in response to determining", "once detecting [the described condition or event]", or "in response to detecting [the described condition or event]" depending on the context.
[0064] In addition, in the description of the specification and appended claims of the present application, the terms "first", "second", "third", etc. are only used for distinguishing descriptions and cannot be understood as indicating or implying relative importance.
[0065] The reference to "one embodiment" or "some embodiments" etc. described in the specification of the present application means that a specific feature, structure, or characteristic described in connection with that embodiment is included in one or more embodiments of the present application. Thus, statements such as "in one embodiment", "in some embodiments", "in other some embodiments", "in still other embodiments", etc. that appear in different places in this specification do not necessarily all refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in another way. The terms "comprising", "including", "having", and their variants all mean "including but not limited to", unless otherwise specifically emphasized in another way.
[0066] The technical solutions of the present application will be described below through specific embodiments.
[0067] Refer to Figure 1, showing a schematic diagram of a liquidity pool fusion method provided by an embodiment of the present application, which may specifically include the following steps:
[0068] Step 101, determine a first sub-liquidity pool and a second sub-liquidity pool to be fused;
[0069] Among them, the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource; the first digital resource, the second digital resource, and the third digital resource are respectively different types of digital resources.
[0070] A liquidity pool is a resource pool where digital resources can be swapped. Each liquidity pool corresponds to a tradable resource group, and a tradable resource group is composed of two digital resources that can be exchanged. The embodiment of the present application does not limit the types of digital resources, as long as the two can be exchanged, and the types of digital resources do not affect the implementation process of the embodiment of the present application and the beneficial effects brought by it. For example: if the sub-liquidity pool P1 corresponds to the tradable resource group A-B, then under certain conditions (for example: the reserve quantity of the digital resources to be exchanged is not zero), digital resource A can be exchanged for digital resource B in liquidity pool P1 according to a certain ratio, or digital resource B can be exchanged for digital resource A.
[0071] As an example, the exchange quantity of digital resources in the liquidity pool can be identified by price information or exchange quantity. For example: digital resource A can be exchanged for digital resource B at a specified price, or a specified quantity of digital resource A can be exchanged for digital resource B.
[0072] A sub-liquidity pool is a liquidity pool that needs to be fused, and the first sub-liquidity pool and the second sub-liquidity pool contain the same type of digital resources. For example: if the sub-liquidity pool P1 with the first tradable resource group A-B is the first sub-liquidity pool, then the second tradable resource group corresponding to the second sub-liquidity pool is B-*, or A-#, where "*" is a digital resource other than digital resource A, and "#" is a digital resource other than digital resource B.
[0073] Step 102, determine the first protocol type of the first sub-liquidity pool and the second protocol type of the second sub-liquidity pool;
[0074] A smart contract is set in the liquidity pool to ensure the execution of the trading routing process. The smart contracts corresponding to different replacement protocols are not exactly the same, and the replacement features in different smart contracts are not exactly the same. That is, in the case of equal replacement of the same type of digital resources, the results of the liquidity pools of different replacement protocols are different after the replacement is executed. The first protocol type is the replacement protocol of the first sub-liquidity pool, and the second protocol type is the replacement protocol of the second sub-liquidity pool.
[0075] Step 103: Determine the fusion feature information according to the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type.
[0076] Since one of the purposes of sub-liquidity pool fusion is to achieve resource replacement across sub-liquidity pools, when performing sub-liquidity pool fusion, it is necessary to determine the protocol type of the sub-liquidity pool and determine the corresponding fusion feature information according to the protocol type of the liquidity pool to be fused.
[0077] Step 104: Generate a virtual liquidity pool based on the fusion feature information.
[0078] Among them, the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource.
[0079] The virtual liquidity pool can be generated based on the fusion feature information, that is, the replacement result after the replacement of the first digital resource and the third digital resource can be determined through the fusion feature information. The process that originally needed to perform replacement across sub-liquidity pools can complete the relevant calculations of resource replacement through the fusion feature information in a single virtual liquidity pool, improving the efficiency of digital resource replacement.
[0080] The virtual liquidity pool is essentially a compressed data structure, rather than a real constructed liquidity pool. Therefore, after generating the virtual liquidity pool, it is necessary to monitor the state of the real liquidity pool used to generate the virtual liquidity pool and update the virtual liquidity pool according to the monitored information.
[0081] In an embodiment of the present application, by determining a first sub-liquidity pool and a second sub-liquidity pool to be fused; the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource; determining a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool; determining fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type; generating a virtual liquidity pool based on the fusion feature information; the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource, thereby realizing that by fusing adjacent sub-liquidity pools (sub-liquidity pools having the same digital resource), the number of nodes that need to be considered when performing digital resource replacement across sub-liquidity pools is greatly reduced, and the equivalent result that originally required replacement across sub-liquidity pools can be obtained through the fused virtual liquidity pool, reducing the complexity from exponential level to approximately linear level, and greatly improving the replacement efficiency of digital resources.
[0082] In practical applications, pairwise fusion of sub-liquidity pools can be performed multiple times according to actual needs, and then the corresponding virtual liquidity pools can be obtained. Refer to Figure 2 , which shows a schematic diagram of the fusion process between sub-liquidity pools provided by an embodiment of the present application. The tradable resource group of sub-liquidity pool P3 is C-D, and the tradable resource group of sub-liquidity pool P4 is D-E. By fusing sub-liquidity pools P3 and P4, a virtual liquidity pool P5 can be obtained, and the tradable resource group of virtual liquidity pool P5 is C-E. The virtual liquidity pool P5 is used as a sub-liquidity pool to fuse with sub-liquidity pool P6 to obtain a virtual liquidity pool P7. The tradable resource group of P6 is E-F, then the tradable resource group of virtual liquidity pool P7 is C-F. Before fusion, when replacing digital resource C with digital resource F, it is necessary to perform replacement calculations across liquidity pools for liquidity pools P3, P4, and P6; after the liquidity pool fusion, the equivalent result of replacing digital resource C with digital resource F can be directly obtained through virtual liquidity pool P7, improving the replacement efficiency of digital resources.
[0083] As an example, two virtual liquidity pools can also be used as sub-liquidity pools for fusion to obtain another virtual liquidity pool.
[0084] Based on the fused virtual liquidity pool, the embodiment of the present application also has the following application effects:
[0085] The disadvantage of the prior art is that a large number of price oracles and historical data need to be maintained, increasing the infrastructure cost. The embodiments of the present application can reduce the dependence on external data: the parameters of the fusion pool are calculated based on on-chain real-time data, reducing the need for a large number of price oracles. By listening to on-chain events to update the liquidity pool status in real time, the storage requirement for a large amount of historical data is reduced.
[0086] When the prior art performs digital resource replacement, it usually adopts a greedy algorithm or a search with a limited depth, which may fall into a local optimal solution. The virtual liquidity pool generated by the embodiments of the present application provides a simplified search space, making it possible to perform a deeper search within a limited time. Considering the impact of the replacement volume on the price, the edge weights are dynamically adjusted, making it closer to the real replacement situation. In the scenario of split routing, it is possible to split a single large (or large-amount) replacement request and search for the optimal paths of multiple sub-replacements in parallel, increasing the probability of finding the global optimal solution. Based on the fusion liquidity pool provided by the embodiments of the present application, the calculation of the optimal path can be effectively reduced.
[0087] The prior art is difficult to effectively handle the liquidity scattered in different DEXs and liquidity pools. The embodiments of the present application can fuse the liquidity pools between different replacement protocols and effectively integrate the scattered liquidity. Dynamically adjust the fusion depth according to the network congestion degree, and can provide the best performance in different replacement environments. By calculating the comprehensive equivalent replacement result, the liquidity of different protocols is unified under a standard for comparison and optimization.
[0088] The prior art may cause delays in high-frequency replacement scenarios, affecting the user experience and replacement efficiency.
[0089] The embodiments of the present application can perform preprocessing through the virtual liquidity pool obtained by fusion, greatly reducing the complexity of real-time calculation and being able to respond to user requests faster. Intelligently split a single large (or large-amount) replacement, which can not only find a better path but also reduce the impact on the replacement environment. Even in a highly active replacement environment, the stable performance can be maintained by adjusting the fusion depth.
[0090] In an alternative embodiment of the present application, the first protocol type is the first replacement protocol or the second replacement protocol; the second protocol type is the first replacement protocol or the second replacement protocol; the first replacement protocol is a liquidity pool protocol with a uniformly distributed liquidity feature, and the second replacement protocol is a liquidity pool protocol with a concentrated liquidity feature.
[0091] The first protocol type is the protocol type of the first sub-liquidity pool, and the second protocol type is the protocol type of the second sub-liquidity pool. The protocol types include a first replacement protocol and a second replacement protocol. The first protocol type and the second protocol type can both be the first replacement protocol, or both be the second replacement protocol, or the first protocol type be one of the first replacement protocol and the second replacement protocol and the other be the second protocol type.
[0092] The uniform distribution liquidity feature means that digital resources at different prices in the liquidity pool share the same liquidity. The concentrated liquidity feature means that digital resources in the liquidity pool have different liquidity in different price ranges. The above-mentioned liquidity is the sum of the amounts of digital resources at different prices.
[0093] In an alternative embodiment of the present application, if both the first protocol type and the second protocol type are the first replacement protocol; step 103 includes:
[0094] Determine the first reserve amount of the first digital resource, the second reserve amount of the second digital resource, and the first replacement fee information in the first sub-liquidity pool;
[0095] Determine the third reserve amount of the second digital resource, the fourth reserve amount of the third digital resource, and the second replacement fee information in the second sub-liquidity pool;
[0096] Determine the fifth reserve amount of the first digital resource based on the first reserve amount, the second reserve amount, the third reserve amount, the first replacement fee information, and the second replacement fee information;
[0097] Determine the sixth reserve amount of the third digital resource based on the second reserve amount, the third reserve amount, the fourth reserve amount, the first replacement fee information, and the second replacement fee information;
[0098] Generate fusion feature information based on the fifth reserve amount and the sixth reserve amount.
[0099] For the case where both the first protocol type and the second protocol type are the first replacement protocol, the fusion feature information needs to meet three conditions: 1. Maintain a constant product relationship; 2. Liquidity is continuous; 3. Accumulation of replacement fee information. Among them, the constant product relationship can be expressed as A*B = k, where k is a constant, and A and B are the reserve amounts of two different digital resources in the tradable resource group. For a sub-liquidity pool with the protocol type of the first replacement protocol, or a virtual liquidity pool obtained from a sub-liquidity pool with the protocol type of the first replacement protocol, the above constant product relationship needs to be satisfied.
[0100] As an example, if both the first protocol type and the second protocol type are the first replacement protocol, the first tradable resource group is X-Y, and the second tradable resource group is Y-Z, the first reserve quantity reserveX1 can be determined, the second reserve quantity is reserveY1, the first replacement cost information is fee1, the third reserve quantity reserveY2 is determined, the fourth reserve quantity is reserveZ2, the second replacement cost information is fee2, and the fifth reserve quantity reserveX is calculated by the following formula (1) combined , and the sixth reserve quantity reserveZ by the following formula (2) combined .
[0101] (1)
[0102] (2)
[0103] Among them, combineFee is the combined cost information for generating the virtual liquidity pool, and combineFee = (1 - fee1)(1 - fee2). The denominator part in formula (1) and formula (2) ( ) represents the combined reserve quantity for normalizing the intermediate digital resources in combination with the replacement cost information. The numerator part in formula (1) represents the actual available liquidity when performing cross-liquidity pool replacement through the intermediate digital resources. The denominator part in formula (2) is the same as the denominator part in formula (1) to make and maintain the same ratio. The above-mentioned intermediate digital resources are the same digital resources in the first tradable resource group and the second tradable resource group.
[0104] In an alternative embodiment of the present application, if both the first protocol type and the second protocol type are the second replacement protocol, that is, when both the first sub-liquidity pool and the second sub-liquidity pool have the characteristics of concentrated liquidity, step 103 includes: determining the first price range of the second digital resource; determining a plurality of first price breakpoints based on the first price range; performing virtual replacement according to each first price breakpoint to obtain a first replacement result; determining a first characteristic result in the first replacement result in a preset manner; the first characteristic result includes a second price range composed of a price upper limit value and a price lower limit value, a first current price, and a liquidity value corresponding to the second price range; determining the fifth reserve quantity of the first digital resource based on the price upper limit value, the price lower limit value, and the first current price; determining the sixth reserve quantity of the third digital resource based on the price lower limit value, the first current price, and the liquidity value; generating fusion characteristic information based on the fifth reserve quantity and the sixth reserve quantity.
[0105] In the case where both the first sub-liquidity pool and the second sub-liquidity pool have concentrated liquidity characteristics, multiple price breakpoints can be determined within the price range of the sub-liquidity pool (the price breakpoints can be located within the price range or be the endpoints of the price range). Based on each price breakpoint, a virtual replacement result is calculated, and an optimal price range (minimum slippage or maximum output) is determined. Then, the fifth reserve quantity and the sixth reserve quantity are calculated according to the optimal price range. As an example, the following steps can be included: (1) Initialization: Determine the price ranges of the two sub-liquidity pools to be fused. (2) Dichotomy iteration: Divide the price range into three equal parts. For each price breakpoint, calculate the results of trading through the two sub-liquidity pools. Select the interval that produces the best result (minimum slippage or maximum output). (3) Calculate the equivalent reserve quantity: Use the finally determined optimal price range to calculate the equivalent digital resource reserve quantity.
[0106] Among them, when selecting the best result, the minimum slippage or the maximum output during the trading process is considered to ensure the efficiency and cost optimization of the transaction. The price range is the liquidity range.
[0107] As an example, if both the first protocol type and the second protocol type are the second replacement protocol, the first tradable resource group is X-Y, and the second tradable resource group is Y-Z, the fifth reserve quantity can be calculated through the following formulas (3) and (4) and the sixth reserve quantity .
[0108] (3)
[0109] ) (4)
[0110] P low and P high are the lower and upper limits of the optimal price range, P current is the current price, and L is the liquidity of this price range. If there are multiple liquidities corresponding to this price range, the various liquidities within this price range can be weighted and summed to obtain the liquidity value of this price range. By calculating according to formula (3), the fifth reserve quantity can be determined within the given price range. The numerator part of formula (3) describes the amplitude of this price range, and the denominator part combines the square root of the pull price to ensure that the calculation result is consistent with the actual liquidity distribution. By calculating according to formula (4), the sixth reserve quantity can be calculated at the current price, and the liquidity L of the price range is introduced to reflect the liquidity within the current price range.
[0111] In an alternative embodiment of the present application, before determining the first characteristic result in the replacement result according to a preset manner, step 103 further includes: determining first iteration information corresponding to the first replacement result; when the first iteration information does not meet a preset first iteration condition, updating the first price range according to the first characteristic result, and returning to the step of determining a plurality of first price segmentation points based on the first price range.
[0112] For the trisection iteration process of step (2) above, the precision or the number of iterations can be preset. When determining the first replacement result, determine the first iteration information (the current precision or the current number of iterations), and repeat the above step (2) until the preset precision or the number of iterations is reached.
[0113] In an alternative embodiment of the present application, if one of the first protocol type and the second protocol type is a first replacement protocol and the other is a second replacement protocol; step 103 includes: determining a second current price of a sub-liquidity pool corresponding to the first replacement protocol, and a second price range of the sub-liquidity corresponding to the second replacement protocol; performing a virtual replacement on the sub-liquidity pool corresponding to the first replacement protocol to obtain a second replacement result; determining a plurality of second price segmentation points based on the second price range, and performing a virtual replacement according to each second price segmentation point to obtain a third replacement result; generating a second characteristic result based on the second replacement result and the third replacement result; generating fusion characteristic information based on the second characteristic result.
[0114] Refer to Figure 3 , which shows a schematic diagram of a fusion characteristic information generation process provided by an embodiment of the present application; in the case where one of the first protocol type and the second protocol type is a first replacement protocol and the other is a second replacement protocol, the fusion characteristic information generation process is as Figure 3 shown.
[0115] For the case where the sub-liquidity pools to be fused correspond to different replacement protocols respectively, it can be executed in the manner as Figure 3 shown, including:
[0116] (1) Initialization: determining the price range of the liquidity pool with the protocol type of the second replacement protocol, and the current price of the liquidity pool with the protocol type of the first replacement protocol.
[0117] (2) Trisection iteration: Divide the price range into three equal parts to determine the price segmentation points. Perform the following steps for each price segmentation point: 1. Calculate the second replacement result using the formula matched by the first replacement protocol. (Refer to the case where both the first protocol type and the second protocol type are the first replacement protocol as described above.) 2. Calculate the third replacement result of the sub-liquidity pool transaction corresponding to the second replacement protocol. (Refer to the case where both the first protocol type and the second protocol type are the second replacement protocol as described above.) 3. Combine the two results and calculate the overall transaction result. 4. Select the interval that produces the best overall result.
[0118] (3) Calculate the comprehensive equivalent reserve: Based on the equivalent reserve comprehensively determined by the finally determined optimal trading path.
[0119] In the embodiment of the present application, by performing virtual replacements on two sub-liquidity pools according to different replacement protocols respectively, and based on the second replacement result and the third replacement result obtained from the virtual replacements, determine the equivalent reserve of the third tradable resource group corresponding to the virtual liquidity pool. The equivalent reserve can be used as the fusion feature information for generating the virtual liquidity pool, and then obtain the virtual liquidity pool determined by the liquidity pools with different liquidity characteristics. According to the virtual liquidity pool, the equivalent result of digital resource replacement with different replacement protocols across liquidity pools can be determined.
[0120] In an alternative embodiment of the present application, before generating the fusion feature information based on the second feature result, step 103 further includes: determining the second iteration information corresponding to the third replacement result; when the second iteration information does not meet the preset second iteration condition, update the second price range according to the third feature result, and return to the step of determining multiple second price segmentation points based on the second price range and performing virtual replacements according to each second price segmentation point to obtain the third replacement result.
[0121] For the trisection iteration process in step (2) above, the precision or the number of iterations can be preset. When determining the third replacement result, determine the second iteration information (current precision or current number of iterations), and repeat the above step (2) until the preset precision or number of iterations is reached.
[0122] For example, the minimum trading amount is one yuan (preset precision). If the previous inputs for the trisection iteration calculation are 36 yuan and 37 yuan respectively, and 36 is better than 37 because the difference between 36 and 37 is less than or equal to 1 yuan, that is, the preset precision is reached, then the interval of 36 - 36.5 will not be calculated anymore, and 36 yuan will be directly selected as the optimal result. If the previous inputs for the trisection iteration calculation are 50 yuan and 60 yuan respectively, and 50 yuan is better than 60 yuan, but the preset number of iterations has been performed, then the next iteration will not be carried out, and 50 yuan is considered the optimal result.
[0123] In the embodiments of the present application, by setting iterative conditions for the liquidity pool of the second replacement protocol, multiple iterative processes can be performed during virtual replacement to generate an optimal third replacement result, ensuring that when calculating the equivalent replacement result using the virtual liquidity pool after obtaining the virtual liquidity pool, the equivalent replacement result is the optimal result.
[0124] In an alternative embodiment of the present application, the second characteristic result includes a seventh reserve quantity corresponding to the second replacement result and corresponding to the third tradable resource group, an eighth reserve quantity corresponding to the third replacement result and corresponding to the third tradable resource group, and third replacement cost information; the eighth reserve quantity corresponds to the first tradable resource group; generating the fusion characteristic information based on the second characteristic result includes: determining a fifth reserve quantity based on the seventh reserve quantity, the eighth reserve quantity, and the third replacement cost information; determining a sixth reserve quantity based on the seventh reserve quantity, the eighth reserve quantity, and the third replacement cost information; generating the fusion characteristic information based on the fifth reserve quantity and the sixth reserve quantity.
[0125] As an example, if the first protocol type is the first replacement protocol, the first tradable resource group is X - Y, the second protocol type is the second replacement protocol, and the second tradable resource group is Y - Z, the fifth reserve quantity reserveX can be calculated by the following formula (5) combined and the sixth reserve quantity reserveZ can be calculated by the following formula (6) combined :
[0126] (5)
[0127] (6)
[0128] In formula (5), is the seventh reserve quantity, is the eighth reserve quantity, is the third cost information.
[0129] As another example, if the first protocol type is the second replacement protocol, the first tradable resource group is X - Y, the second protocol type is the first replacement protocol, and the second tradable resource group is Y - Z, the fifth reserve quantity reserveX can be calculated by the following method (7) combined and the sixth reserve quantity reserveZ can be calculated by the following formula (8) combined .
[0130] (7)
[0131] (8)
[0132] Among them, is the seventh reserve quantity, is the eighth reserve quantity, is the third cost information.
[0133] It should be noted that the magnitudes of the sequence numbers of the steps in the above embodiments do not mean the sequence of execution. The execution sequence of each process should be determined according to its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of this application.
[0134] Referring to Figure 5 , a schematic diagram of a liquidity pool fusion device provided by an embodiment of this application is shown, which may specifically include a to-be-fused pool determination module 501, a protocol type determination module 502, a fusion feature information determination module 503, and a virtual liquidity pool generation module 504, where:
[0135] The to-be-fused pool determination module 501 is configured to determine a first sub-liquidity pool and a second sub-liquidity pool to be fused; the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource;
[0136] The protocol type determination module 502 is configured to determine a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool;
[0137] The fusion feature information determination module 503 is configured to determine fusion feature information according to the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type;
[0138] The virtual liquidity pool generation module 504 is configured to generate a virtual liquidity pool based on the fusion feature information; the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource.
[0139] In an alternative embodiment of this application, the fusion rule information determination module 503 includes:
[0140] The first rule sub-module is configured to determine the preset first rule information as the fusion rule information if both the first protocol type and the second protocol type are the first replacement protocol;
[0141] The second rule sub-module is configured to determine the preset second rule information as the fusion rule information if both the first protocol type and the second protocol type are the second replacement protocol;
[0142] A third rule sub-module, configured to determine that the third rule information is fusion rule information if one of the first protocol type and the second protocol type is a first replacement protocol and the other is a second replacement protocol.
[0143] In an alternative embodiment of the present application, the first protocol type is a liquidity pool protocol with a uniformly distributed liquidity feature, and the second protocol type is a liquidity pool protocol with a concentrated liquidity feature.
[0144] In an alternative embodiment of the present application, the fusion feature information determination module 503 includes:
[0145] A first determination sub-module, configured to determine a first reserve amount of a first digital resource, a second reserve amount of a second digital resource, and first replacement fee information in a first sub-liquidity pool;
[0146] A second determination sub-module, configured to determine a third reserve amount of the second digital resource, a fourth reserve amount of a third digital resource, and second replacement fee information in a second sub-liquidity pool;
[0147] A third determination sub-module, configured to determine a fifth reserve amount of the first digital resource according to the first reserve amount, the second reserve amount, the third reserve amount, the first replacement fee information, and the second replacement fee information;
[0148] A fourth determination sub-module, configured to determine a sixth reserve amount of the third digital resource according to the second reserve amount, the third reserve amount, the fourth reserve amount, the first replacement fee information, and the second replacement fee information;
[0149] A fusion feature information first generation sub-module, configured to generate fusion feature information according to the fifth reserve amount and the sixth reserve amount.
[0150] In an alternative embodiment of the present application, the fusion feature information determination module 503 includes:
[0151] A first price range determination sub-module, configured to determine a first price range of the second digital resource;
[0152] A first price segmentation point sub-module, configured to determine a plurality of first price segmentation points based on the first price range;
[0153] A first replacement result determination sub-module, configured to perform virtual replacement according to each first price segmentation point to obtain a first replacement result;
[0154] The first feature result determination sub-module is used to determine the first feature result in the first permutation result according to a preset method; the first feature result includes a second price range composed of a price ceiling value and a price floor value, a first current price, and a liquidity value corresponding to the second price range;
[0155] The fifth determination sub-module is used to determine the fifth reserve quantity of the first digital resource according to the price ceiling value, the price floor value, and the first current price;
[0156] The sixth determination sub-module is used to determine the sixth reserve quantity of the third digital resource according to the price floor value, the first current price, and the liquidity value;
[0157] The first fusion feature information generation sub-module is used to generate fusion feature information according to the fifth reserve quantity and the sixth reserve quantity.
[0158] In an alternative embodiment of the present application, the fusion feature information determination module 503 further includes:
[0159] The first iteration information determination sub-module is used to determine the first iteration information corresponding to the first permutation result;
[0160] The first iteration control sub-module is used to update the first price range to which it belongs according to the first feature result and return to the step of determining a plurality of first price segmentation points based on the first price range when the first iteration information does not meet the preset first iteration condition.
[0161] In an alternative embodiment of the present application, the fusion feature information determination module 503 includes:
[0162] The second price determination sub-module is used to determine the second current price of the sub-liquidity pool corresponding to the first permutation protocol and the second price range of the sub-liquidity corresponding to the second permutation protocol;
[0163] The second permutation result generation sub-module is used to perform virtual permutation on the sub-liquidity pool corresponding to the first permutation to obtain a second permutation result;
[0164] The third permutation result generation sub-module is used to determine a plurality of second price segmentation points based on the second price range and perform virtual permutation according to each second price segmentation point to obtain a third permutation result;
[0165] The second feature result generation sub-module is used to generate a second feature result according to the second permutation result and the third permutation result;
[0166] The second fusion feature information generation sub-module is used to generate fusion feature information according to the second feature result.
[0167] In an alternative embodiment of the present application, before generating the fusion feature information based on the second feature result, the fusion feature information determination module 503 further includes:
[0168] A second iteration information determination sub-module, configured to determine second iteration information corresponding to the third permutation result;
[0169] A second iteration information control sub-module, configured to update the second price range according to the third feature result when the second iteration information does not meet a preset second iteration condition, and return the step of determining a plurality of second price segmentation points based on the second price range, and performing virtual permutation according to each second price segmentation point to obtain a third permutation result.
[0170] In an alternative embodiment of the present application, the second feature result includes a seventh reserve quantity corresponding to the second permutation result and corresponding to the third tradable resource group, an eighth reserve quantity corresponding to the third permutation result and corresponding to the third tradable resource group, and third permutation cost information; the eighth reserve quantity corresponds to the first tradable resource group; the fusion feature information second generation sub-module includes:
[0171] A first determination unit, configured to determine a fifth reserve quantity according to the seventh reserve quantity, the eighth reserve quantity, and the third permutation cost information;
[0172] A second determination unit, configured to determine a sixth reserve quantity according to the seventh reserve quantity, the eighth reserve quantity, and the third permutation cost information;
[0173] A fusion feature information generation unit, configured to generate fusion feature information according to the fifth reserve quantity and the sixth reserve quantity.
[0174] A liquidity pool fusion device provided by an embodiment of the present application. By applying this device, each step in the foregoing method embodiments can be implemented.
[0175] For the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple. For related parts, refer to the description in the method embodiment section.
[0176] Refer to Figure 6 , which shows a schematic diagram of an electronic device provided by an embodiment of the present application. As Figure 6As shown in the figure, the electronic device 600 in the embodiment of the present application includes: a processor 610, a memory 620, and a computer program 621 stored in the memory 620 and operable on the processor 610. When the processor 610 executes the computer program 621, it implements the steps in each embodiment of the above-mentioned liquidity pool fusion method, such as Figure 1 the steps 101 to 104 shown in the figure. Alternatively, when the processor 610 executes the computer program 621, it implements the functions of each module / unit in the above-mentioned device embodiments, such as Figure 5 the functions of the modules 501 to 504 shown in the figure.
[0177] Exemplarily, the computer program 621 can be divided into one or more modules / units. The one or more modules / units are stored in the memory 620 and executed by the processor 610 to complete the present application. The one or more modules / units can be a series of computer program instruction segments capable of performing specific functions, and these instruction segments can be used to describe the execution process of the computer program 621 in the electronic device 600. For example, the computer program 621 can be divided into a to-be-fused pool determination module, a protocol type determination module, a fusion feature information determination module, and a virtual liquidity pool generation module. The specific functions of each module are as follows:
[0178] The to-be-fused pool determination module is used to determine a first sub-liquidity pool and a second sub-liquidity pool to be fused; the first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource;
[0179] The protocol type determination module is used to determine a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool;
[0180] The fusion feature information determination module is used to determine fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type;
[0181] The virtual liquidity pool generation module is used to generate a virtual liquidity pool based on the fusion feature information; the virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource.
[0182] The electronic device 600 can be a computing device such as a desktop computer or a cloud server. The electronic device 600 may include, but is not limited to, a processor 610 and a memory 620. Those skilled in the art can understand, Figure 6This is only an example of the electronic device 600, and does not constitute a limitation on the electronic device 600. It may include more or fewer components than those shown, or combine certain components, or different components. For example, the electronic device 600 may also include input / output devices, network access devices, buses, etc.
[0183] The processor 610 may be a central processing unit (CPU), or may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0184] The memory 620 may be an internal storage unit of the electronic device 600, such as the hard disk or memory of the electronic device 600. The memory 620 may also be an external storage device of the electronic device 600, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc., equipped on the electronic device 600. Further, the memory 620 may also include both the internal storage unit and the external storage device of the electronic device 600. The memory 620 is used to store the computer program 621 and other programs and data required by the electronic device 600. The memory 620 may also be used to temporarily store data that has been output or is to be output.
[0185] The embodiments of the present application also disclose an electronic device, including a processor, a memory, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the electronic device implements the liquidity pool fusion method as described in the foregoing various embodiments.
[0186] The embodiments of the present application also disclose a computer-readable storage medium storing a computer program, which when executed by a processor implements the liquidity pool fusion method as described in the foregoing various embodiments.
[0187] The embodiment of the present application also discloses a computer program product, including a computer program, which, when run, causes the liquidity pool fusion method described in the foregoing various embodiments to be executed.
[0188] The foregoing embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: they can still modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements on some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the various embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A method for fusing liquidity pools, characterized in that, Including: Determine a first sub-liquidity pool and a second sub-liquidity pool to be fused; The first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource; Determine a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool; Determine fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type; Generate a virtual liquidity pool based on the fusion feature information; The virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource, and the fusion feature information is used to determine the replacement result after the replacement of the first digital resource and the third digital resource; The first protocol type is a first replacement protocol or a second replacement protocol; the second protocol type is a first replacement protocol or a second replacement protocol; The first replacement protocol is a liquidity pool protocol with a uniformly distributed liquidity feature, and the second replacement protocol is a liquidity pool protocol with a concentrated liquidity feature; If one of the first protocol type and the second protocol type is a first replacement protocol and the other is a second replacement protocol; the determining the fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type includes: Determine a second current price of the sub-liquidity pool corresponding to the first replacement protocol and a second price range of the sub-liquidity corresponding to the second replacement protocol; Perform a virtual replacement on the sub-liquidity pool corresponding to the first replacement protocol to obtain a second replacement result; Determine a plurality of second price segmentation points based on the second price range and perform virtual replacements according to each second price segmentation point to obtain a third replacement result; Generate a second feature result based on the second replacement result and the third replacement result; Generate fusion feature information based on the second feature result.
2. The method according to claim 1, wherein If both the first protocol type and the second protocol type are first replacement protocols; the determining the fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type includes: Determine a first reserve quantity of the first digital resource, a second reserve quantity of the second digital resource, and first replacement fee information in the first sub-liquidity pool; Determine a third reserve quantity of the second digital resource, a fourth reserve quantity of the third digital resource, and second replacement fee information in the second sub-liquidity pool; Determine a fifth reserve quantity of the first digital resource based on the first reserve quantity, the second reserve quantity, the third reserve quantity, the first replacement fee information, and the second replacement fee information; Determine a sixth reserve quantity of the third digital resource based on the second reserve quantity, the third reserve quantity, the fourth reserve quantity, the first replacement fee information, and the second replacement fee information; Generate fusion feature information based on the fifth reserve quantity and the sixth reserve quantity.
3. The method according to claim 1, characterized in that, If both the first protocol type and the second protocol type are the second replacement protocol; determining fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type includes: Determine the first price range of the second digital resource; Determine a plurality of first price segmentation points based on the first price range; Perform virtual replacement according to each first price segmentation point to obtain a first replacement result; Determine the first feature result in the first replacement result in a preset manner; the first feature result includes a second price range composed of a price upper limit value and a price lower limit value, a first current price, and a liquidity value corresponding to the second price range; Determine the fifth reserve quantity of the first digital resource based on the price upper limit value, the price lower limit value, and the first current price; Determine the sixth reserve quantity of the third digital resource based on the price lower limit value, the first current price, and the liquidity value; Generate fusion feature information based on the fifth reserve quantity and the sixth reserve quantity.
4. The method according to claim 3, wherein Before determining the first feature result in the replacement result in a preset manner, determining fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type further includes: Determine the first iteration information corresponding to the first replacement result; When the first iteration information does not meet the preset first iteration condition, update the first price range according to the first feature result, and return to the step of determining a plurality of first price segmentation points based on the first price range.
5. The method according to claim 1, characterized in that, Before generating fusion feature information based on the second feature result, determining fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type further includes: Determine the second iteration information corresponding to the third replacement result; When the second iteration information does not meet the preset second iteration condition, update the second price range according to the third feature result, and return to the step of determining a plurality of second price segmentation points based on the second price range and performing virtual replacement according to each second price segmentation point to obtain a third replacement result.
6. The method according to claim 1, wherein The second feature result includes a seventh reserve quantity corresponding to the second replacement result and corresponding to the third tradable resource group, an eighth reserve quantity corresponding to the third replacement result and corresponding to the third tradable resource group, and third replacement cost information; The eighth reserve quantity corresponds to the first tradable resource group; Generating fusion feature information based on the second feature result includes: Determine the fifth reserve quantity based on the seventh reserve quantity, the eighth reserve quantity, and the third replacement cost information; Determine the sixth reserve quantity based on the seventh reserve quantity, the eighth reserve quantity, and the third replacement cost information; Generate fusion feature information based on the fifth reserve quantity and the sixth reserve quantity.
7. A liquidity pool fusion device, characterized in that, Includes: A pending fusion pool determination module for determining a first sub-liquidity pool and a second sub-liquidity pool to be fused; The first sub-liquidity pool corresponds to at least one first tradable resource group composed of a first digital resource and a second digital resource, and the second sub-liquidity pool corresponds to at least one second tradable resource group composed of a second digital resource and a third digital resource; A protocol type determination module for determining a first protocol type of the first sub-liquidity pool and a second protocol type of the second sub-liquidity pool; A fusion feature information determination module for determining fusion feature information based on the first tradable resource group, the second tradable resource group, the first protocol type, and the second protocol type; A virtual liquidity pool generation module for generating a virtual liquidity pool based on the fusion feature information; The virtual liquidity pool corresponds to a third tradable resource group composed of the first digital resource and the third digital resource, and the fusion feature information is used to determine the replacement result after the replacement of the first digital resource and the third digital resource; The first protocol type is a first replacement protocol or a second replacement protocol; the second protocol type is a first replacement protocol or a second replacement protocol; The first replacement protocol is a liquidity pool protocol with a uniformly distributed liquidity feature, and the second replacement protocol is a liquidity pool protocol with a concentrated liquidity feature; The fusion feature information determination module includes: A second price determination sub-module for determining a second current price of the sub-liquidity pool corresponding to the first replacement protocol and a second price range of the sub-liquidity corresponding to the second replacement protocol; A second replacement result generation sub-module for performing virtual replacement on the sub-liquidity pool corresponding to the first replacement to obtain a second replacement result; A third replacement result generation sub-module for determining a plurality of second price segmentation points based on the second price range and performing virtual replacement according to each second price segmentation point to obtain a third replacement result; A second feature result generation sub-module for generating a second feature result based on the second replacement result and the third replacement result; A fusion feature information second generation sub-module for generating fusion feature information based on the second feature result.
8. An electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, the electronic device implements the method according to any one of claims 1-6.
9. A computer program product, characterized in that, Including a computer program, when the computer program is run, the method according to any one of claims 1-6 is executed.
Citation Information
Patent Citations
Resource processing method based on block chain and related equipment
CN117439727A