Ethereum arbitrage transaction detection method and system
By constructing a transaction directed graph and iteratively updating the graph structure to identify arbitrage transactions, it solves the problems of difficulty in identifying decentralized exchange addresses and inaccurate identification of Swap behaviors in the existing technology, and achieves higher arbitrage transaction detection accuracy.
Patent Information
- Application Number
- CN202410430114.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-10
- Publication Date
- 2024-08-27
AI Technical Summary
The existing arbitrage trading detection method cannot accurately identify the decentralized exchange address in the transaction in the decentralized exchange, resulting in a large follow-up screening time cost, and the recognition accuracy of Swap behavior is not high, and there are obvious problems. problems of false positives and false negatives.
By obtaining the currency exchange information in the transaction log, a transaction directed graph is constructed, the directed graph loop algorithm is used to determine whether there is a loop, and the profit value of the currency node is calculated, and the graph structure is updated combined with the threshold and iteration to identify arbitrage transactions.
It improves the accuracy of arbitrage trade identification, reduces false positive and false negative judgments, and improves the accuracy of identification.
Smart Images

Figure CN118552307A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of arbitrage transaction detection, and in particular to an Ethereum arbitrage transaction detection method and system. Background Art
[0002] Decentralized Exchanges (DEX) are exchanges on Ethereum that use smart contracts to enable currency transactions between parties in an open trading logic and decentralized trust. The most common implementation of DEX is the automatic market maker (AMM). In the AMM model, market makers are provided by third-party financial participants, and the transaction price of the currency is calculated by Ethereum smart contracts, realizing the transparent and fair trading needs of market makers, buyers and sellers.
[0003] The existing arbitrage judgment for transactions is mainly to judge the currency Swap behavior by the currency transfer information in the transaction log or the currency swap information and contract status information of the exchange, and judge whether the transaction is an arbitrage transaction through a certain pattern. For the judgment and identification method for Transfer information, the existing method cannot accurately identify the decentralized exchange address in the transaction, requires a large subsequent screening time cost, and will have the problem of misjudgment and omission for decentralized exchanges with special patterns. For the judgment and identification of Swap information and contract status information of decentralized exchanges, the existing methods target fewer types of decentralized exchanges, and after obtaining the Swap behavior information, the recognition pattern for Swap behavior is relatively rough, with a significant number of false positives and false negatives, so the recognition accuracy is not high. Summary of the invention
[0004] The present invention achieves the technical effect of improving the accuracy of arbitrage transaction identification by providing an Ethereum arbitrage transaction detection method and system.
[0005] The present invention provides an Ethereum arbitrage transaction detection method, comprising:
[0006] Get transaction logs;
[0007] Extracting currency exchange information from the transaction log; the currency exchange information includes: purchased currency, sold currency, purchased currency amount and sold currency amount;
[0008] A directed transaction graph is constructed according to the currency exchange information; each node in the directed transaction graph represents a currency, and each edge corresponds to a tuple, named (S, B); wherein S represents the amount of the currency sold, and B represents the amount of the currency bought;
[0009] Determine whether the transaction directed graph has a loop; if there is no loop, the transaction is not an arbitrage transaction;
[0010] The difference between the sum of the number of bought currencies and the sum of the number of sold currencies of each currency node in the transaction directed graph is calculated to obtain the profit value of each currency node; if the profit value of each currency node is less than or equal to 0, the transaction is not an arbitrage transaction; if the profit value of each currency node is greater than 0, the transaction is an arbitrage transaction.
[0011] Specifically, determining whether the transaction directed graph has a loop includes:
[0012] A directed graph cycle algorithm is used to determine whether the transaction directed graph has a cycle.
[0013] Specifically, it also includes:
[0014] If the transaction directed graph contains currency nodes with profit values greater than 0 and less than 0 at the same time, and there is a node among the currency nodes with profit values less than 0 that does not satisfy:
[0015] ∑S c ≤∑B c ×ε
[0016] Among them, S c represents the total amount of currency sold for currency c, B c represents the total number of currencies bought by currency c, ε is a threshold, representing the scaling ratio; the currency nodes in the transaction directed graph are sorted according to the profit value; the sorting order is profit value equal to 0, greater than 0 and less than 0;
[0017] According to the order of the sorting, the node with the highest sorting order is deleted from the transaction directed graph, and the values of S and B are recalculated for the edge connected to the node, so as to obtain an iteratively updated transaction directed graph;
[0018] Calculating the profit value of each currency node in the iteratively updated transaction directed graph;
[0019] If the profit value of each currency node is greater than or equal to 0, the transaction is an arbitrage transaction, otherwise the transaction is not an arbitrage transaction.
[0020] An embodiment of the present invention provides an Ethereum arbitrage transaction detection system, comprising:
[0021] A transaction log acquisition module is used to acquire transaction logs;
[0022] A currency exchange information extraction module, used to extract currency exchange information from the transaction log; the currency exchange information includes: purchased currency, sold currency, purchased currency amount and sold currency amount;
[0023] A transaction directed graph construction module is used to construct a transaction directed graph according to the currency exchange information; each node in the transaction directed graph represents a currency, and each edge corresponds to a tuple, named (S, B); wherein S represents the amount of the sold currency, and B represents the amount of the bought currency;
[0024] A first arbitrage transaction detection module is used to determine whether the transaction directed graph has a loop; if there is no loop, the transaction is not an arbitrage transaction;
[0025] The second arbitrage transaction detection module is used to calculate the difference between the total number of bought currencies and the total number of sold currencies of each currency node in the transaction directed graph to obtain the profit value of each currency node; if the profit value of each currency node is less than or equal to 0, the transaction is not an arbitrage transaction; if the profit value of each currency node is greater than 0, the transaction is an arbitrage transaction.
[0026] Specifically, the first arbitrage transaction detection module is specifically used to use a directed graph loop algorithm to determine whether the transaction directed graph has a loop; if there is no loop, the transaction is not an arbitrage transaction.
[0027] Specifically, it also includes:
[0028] The node sorting module is used for if the transaction directed graph contains currency nodes with profit values greater than 0 and less than 0 at the same time and there is a node in the currency nodes less than 0 that does not satisfy: ∑S c ≤∑B c ×ε, where S c represents the total amount of currency sold for currency c, B c represents the total number of currencies bought by currency c, ε is a threshold, representing the scaling ratio; the currency nodes in the transaction directed graph are sorted according to the profit value; the sorting order is profit value equal to 0, greater than 0 and less than 0;
[0029] A graph structure iterative update module, used to delete the top-ranked node from the transaction directed graph according to the order of the sorting, and recalculate the values of S and B for the edge connected to the node to obtain an iteratively updated transaction directed graph;
[0030] A profit value calculation module, used to calculate the profit value of each currency node in the iteratively updated transaction directed graph;
[0031] The third arbitrage transaction detection module is used to determine that if the profit value of each currency node is greater than or equal to 0, the transaction is an arbitrage transaction, otherwise the transaction is not an arbitrage transaction.
[0032] One or more technical solutions provided in the present invention have at least the following technical effects or advantages:
[0033] The currency exchange information in the transaction is obtained by extracting information based on decentralized exchange information and opportunity transaction logs. After obtaining the currency exchange information, the graph structure of the currency transaction information is constructed and the nodes in the graph are deleted, and the edges are reconstructed, which can better judge and identify false positives and false negatives, and improve the accuracy of Ethereum arbitrage transaction identification. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 A schematic diagram of an Ethereum arbitrage transaction detection method provided by an embodiment of the present invention;
[0035] Figure 2 A flow chart of an Ethereum arbitrage transaction detection method provided by an embodiment of the present invention;
[0036] Figure 3 This is an example of a Swap transaction log in an embodiment of the present invention;
[0037] Figure 4 This is an example of obtaining currency exchange information through the smart contract ABI in an embodiment of the present invention;
[0038] Figure 5 A directed transaction graph constructed in an embodiment of the present invention;
[0039] Figure 6 For Figure 5 The graph structure after iterative update;
[0040] Figure 7 A module diagram of an Ethereum arbitrage transaction detection system provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0041] The embodiments of the present invention provide an Ethereum arbitrage transaction detection method and system, thereby achieving the technical effect of improving the accuracy of arbitrage transaction identification.
[0042] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0043] See also Figure 1 and Figure 2 , the Ethereum arbitrage transaction detection method provided by the embodiment of the present invention includes:
[0044] Step S110: Obtain transaction log;
[0045] This step is explained in detail to obtain the transaction log, including:
[0046] Get the transaction log through the Ethereum client. The transaction log is a collection of multiple events in the transaction, and each event contains topics and data. Topics contain feature events and indexed content, and Data contains relevant information about event records. The indexed content and Data record the internal information of the transaction.
[0047] Step S120: extracting currency exchange information from the transaction log; the currency exchange information includes: the currency bought, the currency sold, the amount of the currency bought, and the amount of the currency sold;
[0048] This step is explained in detail to extract the currency exchange information from the transaction log, including:
[0049] By manually checking the code and historical transaction information of Ethereum exchanges, we obtain the characteristic events corresponding to the Swap of each exchange, and then match the characteristic events in each event in each transaction to identify the Swap information of decentralized exchanges, including: uniswap, kyberSwap, curve, bancor, balancer, 1inch, aave, blackholeswap, clipper, cofixswap, compound, dfxFinance, dodo, defiplaza, hashflow, mstable, mooniswap, psm, saddleFinance, smothyFi, zeroX, beholder, oneswap, primitiveEngine, monoXswap, Helix and its multiple versions and forked exchanges. After locating the Swap characteristic event, we use the indexed content and Data information in the event log to extract the information of the Swap, including the four pieces of information: buy currency, sell currency, buy currency amount and sell currency amount.
[0050] like Figure 3As shown, this is a transaction log generated after a Swap, which contains two parts: Topics and Data. Among them, Topics 0 represents the characteristic event. By reading the code of uniswap V2, it is known that the characteristic event is a Swap event generated by uniswap V2. In this embodiment, the characteristic event will be located and identified. Topics 1 and 2 are indexed parts, where Topics 1 represents the address of the initiator of the Swap, and Topics 2 represents the address of the recipient of the currency swapped out by the Swap. In Data, there are four pieces of information, where amount0In represents the number of currency 0 invested in DEX in the Swap, amount1In represents the number of currency 1 invested in DEX in the Swap, amount0Out represents the number of currency 0 obtained from DEX in the Swap, and amount1Out represents the number of currency 1 obtained from DEX in the Swap. In this event log, amount0In and amount1Out are both 0, while amount1In and amount0Out are non-0, indicating that the Swap is a certain number of currency 1 exchanged for a certain number of currency 0. Since the currency information corresponding to currency 0 and currency 1 cannot be obtained from the event log, it is necessary to obtain the address information corresponding to currency 0 and currency 1 through the uniswap smart contract ABI. The call result is as follows Figure 4 As shown, the two currency addresses and their numbers corresponding to the Swap event are obtained, thereby obtaining the four pieces of information corresponding to the complete Swap event.
[0051] Step S130: construct a transaction directed graph based on the currency exchange information; each node in the transaction directed graph represents a currency, and each edge corresponds to a tuple, named (S, B); where S represents the number of currencies sold, and B represents the number of currencies bought, such as Figure 4 As shown;
[0052] Step S140: Arbitrage transaction detection; specifically including:
[0053] Determine whether there is a loop in the transaction directed graph; if there is no loop, the transaction is not an arbitrage transaction;
[0054] Specifically, judging whether there is a loop in the directed transaction graph includes:
[0055] Use the directed graph cycle algorithm to determine whether there is a cycle in the transaction directed graph.
[0056] Calculate the difference between the sum of the number of bought currencies and the sum of the number of sold currencies for each currency node in the transaction directed graph to obtain the profit value of each currency node; for example: through the formula P c =∑B c -∑S cCalculate the profit value P of each node c in the graph c . Among them, ∑B c is the total amount of currency purchased, ∑S c is the total amount of currency sold, Figure 5 In,∑B c =B ac +B bc ,∑S c =S cd +S ce .
[0057] If the profit value of each currency node is less than or equal to 0, the transaction is not an arbitrage transaction; if the profit value of each currency node is greater than 0, the transaction is an arbitrage transaction.
[0058] If all nodes in the graph meet the threshold, the transaction type needs to be further determined by iteratively updating the graph structure until there are no nodes available for processing. The process of iteratively updating the graph structure includes:
[0059] If the transaction directed graph contains currency nodes with profit values greater than 0 and less than 0 at the same time, and there is a node in the currency node with profit value less than 0 that does not satisfy:
[0060] ∑S c ≤∑B c ×ε
[0061] Among them, S c represents the total number of currencies sold for currency c, B c Represents the total number of currencies bought for currency c, and ε is a threshold representing the scaling ratio. Sort the currency nodes in the transaction directed graph according to the profit value; the sorting order is profit value equal to 0, greater than 0, and less than 0;
[0062] According to the sorting order, delete the top-ranked node from the transaction directed graph, and recalculate the values of S and B for the edges connected to the node to obtain the iteratively updated transaction directed graph;
[0063] Calculate the profit value of each currency node in the iteratively updated transaction directed graph;
[0064] If the profit value of each currency node is greater than or equal to 0, the transaction is an arbitrage transaction, otherwise the transaction is not an arbitrage transaction.
[0065] For example: Figure 6 As shown in the figure, assuming that node c is the first node in the sorting, the node c is popped out, node c and its connected edges are removed, and four new directed edges are established, including from node a to node d and node e, and from node b to node d and node e. At the same time, the parameters of the newly generated edges are calculated: S ad , Bad , S ae , B ae , S bd , B bd , S be and B be Among them, S ad Indicates the amount of currency a spent in a currency exchange from a to d, B ad It indicates the amount of currency d obtained in a currency exchange from a to d.
[0066] If S cd +S ce ≠B ac +B bc , it means that the amount of the currency has changed during the transaction and needs to be converted as follows cd , S ce , B cd and B ce , so that after transformation S cd +S ce =B ac +B bc , and then perform numerical calculations on the newly generated directed edges. The following are the conversion methods for the two cases.
[0067] When S cd +S ce >B ac +B bc When , it means that the amount of currency C exchange expenditure is greater than the purchase amount, and S cd , B cd and S ce , B ce The calculation formula is as follows:
[0068]
[0069] When S cd +S ce <B ac +B bc When , it means that the amount of currency C exchange expenditure is less than the purchase amount, and S ac , B ac and S bc , B bc At the same time, the remaining S ac and S bc Recorded as B aa With B bb The calculation formula is as follows:
[0070]
[0071]
[0072] B aa =S ac -S ac 'B bb =S bc -S bc '
[0073] At this point, the conversion is completed, making S cd '+S ce '=B ac '+B bc ', calculate the value of the newly generated directed edge:
[0074]
[0075]
[0076] At this time, the node c in the graph can be deleted, and the graph structure after deletion is as follows Figure 6 As shown. The iterative process for other nodes is the same as the iterative process for node c.
[0077] See also Figure 7 , the Ethereum arbitrage transaction detection system provided by the embodiment of the present invention includes:
[0078] The transaction log acquisition module 100 is used to acquire the transaction log;
[0079] Specifically, the transaction log acquisition module 100 is specifically used to obtain the transaction log through the Ethereum client. The transaction log is a collection of multiple events in the transaction, and each event contains topics and data. Topics contain feature events and indexed content, and Data contains relevant information of event records. The indexed content and Data record the internal information of the transaction.
[0080] The currency exchange information extraction module 200 is used to extract currency exchange information from the transaction log; the currency exchange information includes: the currency bought, the currency sold, the amount of the currency bought and the amount of the currency sold;
[0081] The transaction directed graph construction module 300 is used to construct a transaction directed graph according to the currency exchange information; each node in the transaction directed graph represents a currency, and each edge corresponds to a tuple, named (S, B); wherein S represents the number of currencies sold, and B represents the number of currencies bought;
[0082] The first arbitrage transaction detection module 400 is used to determine whether there is a loop in the transaction directed graph; if there is no loop, the transaction is not an arbitrage transaction;
[0083] Specifically, the first arbitrage transaction detection module 400 is specifically used to use a directed graph loop algorithm to determine whether there is a loop in the transaction directed graph; if there is no loop, the transaction is not an arbitrage transaction.
[0084] The second arbitrage transaction detection module 500 is used to calculate the difference between the total number of bought currencies and the total number of sold currencies of each currency node in the transaction directed graph to obtain the profit value of each currency node; if the profit value of each currency node is less than or equal to 0, the transaction is not an arbitrage transaction; if the profit value of each currency node is greater than 0, the transaction is an arbitrage transaction.
[0085] The embodiment of the present invention is further described, and further includes:
[0086] The node sorting module is used to sort the currency nodes with profit values greater than 0 and less than 0 in the transaction directed graph, and if there are nodes in the currency nodes with profit values less than 0 that do not satisfy: ∑S c ≤∑B c ×ε; where S c represents the total amount of currency sold for currency c, B c Represents the total number of currencies bought for currency c, and ε is a threshold representing the scaling ratio. Sort the currency nodes in the transaction directed graph according to the profit value; the sorting order is profit value equal to 0, greater than 0, and less than 0;
[0087] The graph structure iterative update module is used to delete the top-ranked node from the transaction directed graph according to the sorting order, and recalculate the values of S and B for the edges connected to the node to obtain the iteratively updated transaction directed graph;
[0088] The profit value calculation module is used to calculate the profit value of each currency node in the iteratively updated transaction directed graph;
[0089] The third arbitrage transaction detection module is used to determine that if the profit value of each currency node is greater than or equal to 0, the transaction is an arbitrage transaction, otherwise the transaction is not an arbitrage transaction.
[0090] The graph structure is updated iteratively until there are no more nodes available for processing.
[0091] The detection of arbitrage transactions in the embodiment of the present invention is compared with the existing method as follows:
[0092] Comparison Method Start and end blocks Number of comparisons Number of inventions Increase ratio Based on Transfer 9569113 15111876 3876997 4652195 20.0% Based on Swap 10000000 14444725 3462648 4130815 19.2%
[0093] It can be seen that the embodiment of the present invention realizes arbitrage transaction detection with better effect than previous solutions by constructing a transaction graph structure and taking into account the Swap paths that need to be scaled in the actual ecology.
[0094] In summary, the embodiment of the present invention proposes an Ethereum arbitrage transaction detection scheme. Based on the Ethereum transaction log and the contract status information of multiple decentralized exchanges, the embodiment of the present invention extracts the currency transaction information inside the Ethereum transaction, and constructs a graph structure of the currency transaction information and deletes the nodes in the graph, and reconstructs the edges in the graph, thereby achieving a more accurate judgment on whether the Ethereum transaction is an arbitrage transaction.
[0095] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0096] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0097] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0098] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process in the computer or other programmable device. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0099] The parts not described in detail in the embodiments of the present invention are all known technologies to those skilled in the art. Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention is described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solutions of the present invention, which should be included in the scope of the claims of the present invention.
Claims
1. A method for detecting Ethereum arbitrage transactions, characterized in that: include: Get transaction logs; Extracting currency exchange information from the transaction log; The currency exchange information includes: the currency bought, the currency sold, the amount of the currency bought and the amount of the currency sold; A directed transaction graph is constructed according to the currency exchange information; each node in the directed transaction graph represents a currency, and each edge corresponds to a tuple, named (S, B); wherein S represents the amount of the currency sold, and B represents the amount of the currency bought; Determine whether the transaction directed graph has a loop; if there is no loop, the transaction is not an arbitrage transaction; The difference between the sum of the number of bought currencies and the sum of the number of sold currencies of each currency node in the transaction directed graph is calculated to obtain the profit value of each currency node; if the profit value of each currency node is less than or equal to 0, the transaction is not an arbitrage transaction; if the profit value of each currency node is greater than 0, the transaction is an arbitrage transaction.
2. The Ethereum arbitrage transaction detection method according to claim 1, characterized in that: The determining whether the transaction directed graph has a loop includes: A directed graph cycle algorithm is used to determine whether the transaction directed graph has a cycle.
3. The Ethereum arbitrage transaction detection method according to claim 1 or 2, characterized in that: Also includes: If the transaction directed graph contains currency nodes with profit values greater than 0 and less than 0 at the same time, and there is a node among the currency nodes with profit values less than 0 that does not satisfy: ∑S c ≤∑B c ×ε Among them, S c represents the total amount of currency sold for currency c, B c represents the total number of currencies bought by currency c, ε is a threshold, representing the scaling ratio; the currency nodes in the transaction directed graph are sorted according to the profit value; the sorting order is profit value equal to 0, greater than 0 and less than 0; According to the order of the sorting, the node with the highest sorting order is deleted from the transaction directed graph, and the values of S and B are recalculated for the edge connected to the node, so as to obtain an iteratively updated transaction directed graph; Calculating the profit value of each currency node in the iteratively updated transaction directed graph; If the profit value of each currency node is greater than or equal to 0, the transaction is an arbitrage transaction, otherwise the transaction is not an arbitrage transaction.
4. An Ethereum arbitrage transaction detection system, characterized in that: include: A transaction log acquisition module is used to acquire transaction logs; A currency exchange information extraction module, used to extract currency exchange information from the transaction log; The currency exchange information includes: the currency bought, the currency sold, the amount of the currency bought and the amount of the currency sold; A transaction directed graph construction module is used to construct a transaction directed graph according to the currency exchange information; each node in the transaction directed graph represents a currency, and each edge corresponds to a tuple, named (S, B); wherein S represents the amount of the sold currency, and B represents the amount of the bought currency; A first arbitrage transaction detection module is used to determine whether the transaction directed graph has a loop; if there is no loop, the transaction is not an arbitrage transaction; The second arbitrage transaction detection module is used to calculate the difference between the total number of bought currencies and the total number of sold currencies of each currency node in the transaction directed graph to obtain the profit value of each currency node; if the profit value of each currency node is less than or equal to 0, the transaction is not an arbitrage transaction; if the profit value of each currency node is greater than 0, the transaction is an arbitrage transaction.
5. The Ethereum arbitrage transaction detection system as claimed in claim 4, characterized in that: The first arbitrage transaction detection module is specifically used to use a directed graph loop algorithm to determine whether the transaction directed graph has a loop; if there is no loop, the transaction is not an arbitrage transaction.
6. The Ethereum arbitrage transaction detection system according to claim 4 or 5, characterized in that: Also includes: The node sorting module is used for if the transaction directed graph contains currency nodes with profit values greater than 0 and less than 0 at the same time and there is a node in the currency nodes less than 0 that does not satisfy: ∑S c ≤∑B c ×ε, where S c represents the total amount of currency sold for currency c, B c represents the total number of currencies bought by currency c, ε is a threshold, representing the scaling ratio; the currency nodes in the transaction directed graph are sorted according to the profit value; the sorting order is profit value equal to 0, greater than 0 and less than 0; A graph structure iterative update module, used to delete the top-ranked node from the transaction directed graph according to the order of the sorting, and recalculate the values of S and B for the edge connected to the node to obtain an iteratively updated transaction directed graph; A profit value calculation module, used to calculate the profit value of each currency node in the iteratively updated transaction directed graph; The third arbitrage transaction detection module is used to determine that if the profit value of each currency node is greater than or equal to 0, the transaction is an arbitrage transaction, otherwise the transaction is not an arbitrage transaction.
