Yu Zhang, Tao Yan, Jianhong Lin, Benjamin Kraner, Claudio Tessone
{"title":"An Improved Algorithm to Identify More Arbitrage Opportunities on Decentralized Exchanges","authors":"Yu Zhang, Tao Yan, Jianhong Lin, Benjamin Kraner, Claudio Tessone","doi":"arxiv-2406.16573","DOIUrl":null,"url":null,"abstract":"In decentralized exchanges (DEXs), the arbitrage paths exist abundantly in\nthe form of both arbitrage loops (e.g. the arbitrage path starts from token A\nand back to token A again in the end, A, B,..., A) and non-loops (e.g. the\narbitrage path starts from token A and stops at a different token N, A, B,...,\nN). The Moore-Bellman-Ford algorithm, often coupled with the ``walk to the\nroot\" technique, is commonly employed for detecting arbitrage loops in the\ntoken graph of decentralized exchanges (DEXs) such as Uniswap. However, a\nlimitation of this algorithm is its ability to recognize only a limited number\nof arbitrage loops in each run. Additionally, it cannot specify the starting\ntoken of the detected arbitrage loops, further constraining its effectiveness\nin certain scenarios. Another limitation of this algorithm is its incapacity to\ndetect non-loop arbitrage paths between any specified pairs of tokens. In this\npaper, we develop a new method to solve these problems by combining the line\ngraph and a modified Moore-Bellman-Ford algorithm (MMBF). This method can help\nto find more arbitrage loops by detecting at least one arbitrage loop starting\nfrom any specified tokens in the DEXs and can detect the non-loop arbitrage\npaths between any pair of tokens. Then, we applied our algorithm to Uniswap V2\nand found more arbitrage loops and non-loops indeed compared with applying the\nMoore-Bellman-Ford (MBF) combined algorithm. The found arbitrage profit by our\nmethod in some arbitrage paths can be even as high as one million dollars, far\nlarger than that found by the MBF combined algorithm. Finally, we statistically\ncompare the distribution of arbitrage path lengths and the arbitrage profit\ndetected by both our method and the MBF combined algorithm, and depict how\npotential arbitrage opportunities change with time by our method.","PeriodicalId":501294,"journal":{"name":"arXiv - QuantFin - Computational Finance","volume":"36 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2024-06-24","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"arXiv - QuantFin - Computational Finance","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/arxiv-2406.16573","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
In decentralized exchanges (DEXs), the arbitrage paths exist abundantly in
the form of both arbitrage loops (e.g. the arbitrage path starts from token A
and back to token A again in the end, A, B,..., A) and non-loops (e.g. the
arbitrage path starts from token A and stops at a different token N, A, B,...,
N). The Moore-Bellman-Ford algorithm, often coupled with the ``walk to the
root" technique, is commonly employed for detecting arbitrage loops in the
token graph of decentralized exchanges (DEXs) such as Uniswap. However, a
limitation of this algorithm is its ability to recognize only a limited number
of arbitrage loops in each run. Additionally, it cannot specify the starting
token of the detected arbitrage loops, further constraining its effectiveness
in certain scenarios. Another limitation of this algorithm is its incapacity to
detect non-loop arbitrage paths between any specified pairs of tokens. In this
paper, we develop a new method to solve these problems by combining the line
graph and a modified Moore-Bellman-Ford algorithm (MMBF). This method can help
to find more arbitrage loops by detecting at least one arbitrage loop starting
from any specified tokens in the DEXs and can detect the non-loop arbitrage
paths between any pair of tokens. Then, we applied our algorithm to Uniswap V2
and found more arbitrage loops and non-loops indeed compared with applying the
Moore-Bellman-Ford (MBF) combined algorithm. The found arbitrage profit by our
method in some arbitrage paths can be even as high as one million dollars, far
larger than that found by the MBF combined algorithm. Finally, we statistically
compare the distribution of arbitrage path lengths and the arbitrage profit
detected by both our method and the MBF combined algorithm, and depict how
potential arbitrage opportunities change with time by our method.