Empirical Analysis of Indirect Internal Conversions in Cryptocurrency Exchanges
EEmpirical Analysis of Indirect Internal Conversionsin Cryptocurrency Exchanges
Paz Grimberg, Tobias Lauinger, Damon McCoyNew York University
I. A
BSTRACT
Algorithmic trading is well studied in traditional financialmarkets. However, it has received less attention in centralizedcryptocurrency exchanges. The Commodity Futures TradingCommission (CFTC) attributed the flash crash, one ofthe most turbulent periods in the history of financial marketsthat saw the Dow Jones Industrial Average lose of its valuewithin minutes, to automated order “spoofing” algorithms. Inthis paper, we build a set of methodologies to characterize andempirically measure different algorithmic trading strategies inBinance, a large centralized cryptocurrency exchange, usinga complete data set of historical trades. We find that a sub-strategy of triangular arbitrage is widespread, where botsconvert between two coins through an intermediary coin, andobtain a favorable exchange rate compared to the direct one.We measure the profitability of this strategy, characterize itsrisks, and outline two strategies that algorithmic trading botsuse to mitigate their losses. We find that this strategy yieldsan exchange ratio that is . , or . basis points (bps)better than the direct exchange ratio. . of all trades onBinance are attributable to this strategy.II. I NTRODUCTION
Cryptocurrency exchanges today handle more than $50bin daily trade volume [5]. Most of it occurs on centralized exchanges, which hold assets and settle trades on behalfof their customers. Traders on these exchanges can convertdifferent coins at certain exchange ratios, just like traditionalforeign exchange (FX) markets. The ability to convert betweencoins creates potential arbitrage opportunities, where traderscan make a profit through a series of conversions. The caseinvolving three conversions, coin c converted to coin c ,which is then converted to coin c and back to c , is called triangular arbitrage if the proceeds of the conversions aregreater than the initial quantity. The existence of triangulararbitrage in foreign exchange markets is well documented [14][19] [18] [26]. The characteristics of cryptocurrency exchangesand their relationship to traditional foreign exchange marketshave been studied as well [17]. However, to the best of ourknowledge, triangular arbitrage has never been studied withinthe context of a centralized cryptocurrency exchange.In this paper, we measure arbitrage activity in Binance, acentralized cryptocurrency exchanges, by empirically explor-ing its complete historical trade data. Since different traderscannot be identified from trade data, we cluster sequences ofconsecutive trades that match in their quantities and timing and attribute them to the same trader. To the best of our knowledge,we are the firsts to employ a clustering methodology foridentifying triangular arbitrage traders, based on trade-by-tradedata.We find that triangular arbitrage is rarely accomplished.Participants predominantly engage in an alternative strategy,which we call indirect internal conversions , where coin A is converted to coin B through an intermediary coin x , at afavorable exchange ratio compared to directly converting A to B . This activity accounts for . % of the total daily volume,and offers an exchange ratio that is . bps better on average.We believe that the fee structure in cryptocurrency ex-changes makes it unprofitable for participants to engage intriangular arbitrage. Instead, participants turn to indirect con-versions as an efficient way to rebalance their holdings.III. B ACKGROUND
A. Exchanges
An exchange is an organized market where tradable se-curities, commodities, foreign exchange/cryptocurrencies (or“coins”) and derivatives are sold and bought (collectivelyreferred to as instruments ). In a centralized exchange, thedeposits and assets of participants are held and settled bythe exchange. In decentralized exchanges (or “DEXes”), asmart contract (a program executing on a blockchain) or otherform of peer-to-peer network executes exchange functionality.In DEXes, funds cannot be stolen by the exchange operator,because their custody and exchange logic is processed andguaranteed by the smart contract.In centralized cryptocurrency exchanges, different cryp-tocurrencies can be exchanged to others, such as Bitcoin andEthereum. In addition, some exchanges list ERC20 tokens, orsimply “tokens,” that can also be exchanged to cryptocurren-cies. Tokens are essentially smart contracts that make use ofthe Ethereum blockchain [13].Participants can place orders on an exchange. An order isan instruction to buy or sell some traded instrument. Theseinstructions can be simple or complicated, and can be sent toeither a broker or directly to an exchange via direct marketaccess. There are some standard instructions for such orders.For example, a market order is a buy or sell order to beexecuted immediately at the current market prices, i.e., buyat the lowest asking price or sell to the highest bidding price.Market orders are typically used when certainty of executionis a priority over the price of execution. A limit order is anorder to buy an instrument at no more than a specific price, a r X i v : . [ q -f i n . T R ] F e b r to sell at no less than a specific price (called “or better”for either direction). This gives the trader control over theprice at which the trade is executed; however, the order maynever be executed (“filled”). Limit orders are typically usedwhen the trader wishes to control price rather than certaintyof execution.Each instrument traded on an exchange has an order book .The order book refers to an electronic list of buy and sellorders for a specific security or financial instrument organizedby price level. An order book lists the number of shares beingbid on or offered at each price point, or market depth [7]. B. Arbitrage
The traditional financial industry has settled on three maintypes of quantitative strategies that are sustainable becausethey provide real economic value to the market: arbitrage,market-making and market-taking [8]. In market-taking strate-gies, traders post both buy and sell orders in the same financialinstrument, hoping to make a profit on the bid-ask spread[25]. In market-taking strategies, traders engage in longer-term trading, subject to some rules-based investment method-ology. Market-taking strategies on centralized cryptocurrencyexchanges have been studied in [23].Arbitrage and its economic benefits have been well under-stood for quite some time and documented by academia [27][15]. Competitive arbitrageurs on centralized exchanges haveat least one of three advantages.1)
Scale: participants who trade large volumes are oftencompensated in the form of kickbacks, rebates, and low(or zero) trading fees, which provide such participantsthe opportunity to make profits in cases where otherswith less scale cannot.2)
Speed: the ability to access order book information andtrade faster than others provides an opportunity to gainfrom mispricings. For example, triangular arbitrage onFX products is a major impetus for the Go West and Hi-bernia microwave telecommunications projects [9] [1],where multi-million dollar network infrastructure wasdeveloped for the purpose of shaving off millisecondsin electronic trading latency.3)
Queue position: being able to enter one leg of anarbitrage trade by placing orders ahead of time, withoutcrossing the spreads, i.e., placing orders that executeimmediately without being queued in the order book,significantly reduces fees, which enables profitable com-pletion of triangular arbitrage trades. Participants arecompensated for the risk of queuing orders in the orderbook.Arbitrage strategies involving multiple centralized cryptocur-rency exchanges, exploiting different prices of same assets,have been studied [22] [21] [24] [20].Arbitrage strategies on decentralized exchanges are executedby bots who pay high transaction fees and optimize theirnetwork latency to front-run ordinary users’ trades [16].At time of writing, the vast majority of cryptocurrenciestrading volume (over ) is done in centralized exchanges[5], therefore in this paper, we focus on triangular arbitrage
Figure 1. Number of monthly trades, in millions, executed on Binance, basedon Kaiko’s data set. in a single centralized cryptocurrency exchange (Binance).Triangular arbitrage is an arbitrage strategy resulting froma discrepancy between three coins that occurs when theirexchange rates give rise to a profitable sequence of trades, i.e.,trades of the form c (cid:55)→ c (cid:55)→ c (cid:55)→ c , where c , c , c arecoins, and the ending balance of c is greater than the initialbalance. We call c the base coin , c and c intermediarycoins , and the sequence a cycle [10].To the best of our knowledge, we are the firsts to employa clustering methodology for identifying triangular arbitragetraders. IV. D ATASET
We use historical cryptocurrency trade data and order bookdata provided by Kaiko from Nov th, through Aug th, [6]. We conducted our measurements on Binance’sexchange data, as it is the largest centralized exchange bydaily volume and has the highest number of listed symbols (the “ticker” of an exchange pair). Kaiko’s data consists oftrade-by-trade data and market depth data for all cryptocur-rencies and ERC20 tokens traded on Binance. There are , , , trades. Figure 1 shows the monthly numberof trades executed on Binance.Every coin in Binance is denominated by at least one ofthe following coins: BNB (Binance’s native token), Bitcoin,ALTS (Etheruem, Ripple, Tron) and stable coins. Stable coinsare fiat-pegged cryptocurrencies designed to minimize thevolatility of price fluctuations. We call these coins anchorcoins , as these coins can be directly exchanged to many othercoins and have historically had the greatest market value (inUS dollar terms) [3].There are different coins and different possibleconversions. We denote such conversions by c ⇔ c , where c and c are two different coins. We call c ⇔ c , a pair . Forexample, if c = BTC and c = ETH, then the pair is denotedBTC ⇔ ETH. Traders can exchange their BTC to ETH (orvice versa) using this conversion. We write c (cid:55)→ c whenconsidering the side of the c holder.There are 6,534 possible cycles in Binance, i.e., sequencesof the form c (cid:55)→ c (cid:55)→ c (cid:55)→ c . In , of them, oneof c and c is an anchor. In , of them, both c and c are anchors. There are no cases where both c and c arenon-anchors. c can be anchor or non-anchor.Cycle statistics in Binance are summarized in Table I. Thereare , cycles with a non-anchor coin as the base coin. ase coin Number of cyclesBTC 986BNB 818ALTS 908Stable coins 1,840Other coins 1,982Total 6,534Table IN UMBER OF CYCLES IN B INANCE BY BASE COIN . BTC,BNB,ALTS
ANDSTABLE COINS REPRESENT OVER
OF THE TOTAL MARKET VALUE OFALL LISTED COINS AND HISTORICALLY HAD LOWER VOLATILITY .T HEREFORE , WE OMIT OTHER CYCLES IN THIS STUDY .Field Descriptionid Incremental trade idexchange Exchange idsymbol Pair symboldate Time (in epoch) when the trade took placeprice Trade priceamount Trade quantity (quoted in base asset)sell Binary. If TRUE, then theholder of c , swapping to c ,was a liquidity taker, and c is thebase asset in the pairlisted on the exchangeTable IIK AIKO ’ S TRADE DATA FIELDS . These cycles have the potential to create arbitrage gains innon-anchor coins. However, anchor coins represent over of the total market value of all listed coins and historicallyhad lower volatility, compared to non-anchor coins. Therefore,we focus on cycles with anchor base coins. As future work,we could explore cycles with no-anchor base coins. However,we note that there is inherent risk in operating in non-anchorcoins, due to volatility.
A. Data Fields
Kaiko’s historical trade data fields are described in Table II.The granularity of the date field is in ms. Since multiple tradescan execute within the same ms, we use the monotonicallyincreasing trade ids as a way to order the trades.Kaiko’s historical order book data is given on a 60-secondbasis, that is, for every pair listed, its entire order book is givenin 60 second increments of the date field. Note that the quotes’depth are not given and need to be reconstructed separately.The data fields are described in Table III.
Field Descriptionsymbol Pair symboldate Time (in epoch) when the order was placedtype Bid or askamount Order quantity (quoted in base asset)Table IIIK
AIKO ’ S ORDER BOOK DATA FIELDS . B. Data Limitations
Kaiko’s order book data is given on a -second intervalbasis and Binance’s API does not provide historical order-bookdata [4]. Complete order book data could reveal all arbitrage opportunities, not just the ones executed with actual trades,as it would accurately paint the traders’ view of the marketat any point in time. When merging Kaiko’s historical tradedata with its order book, only about of the trade data hasmatching order book data available within a ms interval.(During our measurements, we used smaller time intervals than ms .) For profitability measurements, about . of thetime, we were able to use the order book’s bid/ask directly.For the remainder, we approximated the bid/ask price with thevolume-weighted average price of that time interval, based onthe trade data. In addition, Kaiko does not include trade feesor historical fee schedules, so we had to reconstruct Binance’shistorical fee time series. C. Binance Trading Fees
An important data point for our analysis are the trading feescollected by Binance [2]. For every trade executed, Binancecollects a fee from the proceeds of the trade. The fees arecollected either in the currency of the proceeds or in Binance’snative ERC20 token, BNB, depending on the trader’s BNBbalance. If the trader has enough BNB balance, Binance willcalculate the conversion rate between the proceeds and BNB,and withdraw the fees from the BNB balance. In general,Binance rewards participants who trade large volumes bycharging them a lower fee. In addition, for high-volumetraders, Binance distinguishes between liquidity-taking trades,i.e., market order trades or limit order trades that were matchedimmediately at the best bid/ask level, and market-makingtrades, which are trades that were placed somewhere in the or-der book but were not executed immediately. Binance chargesless fees for market-making trades, as they wish to encourageparticipants to “fill up” the order book, thereby narrowingthe bid/ask spread and increasing liqudity. This is a commonpractice; however, in traditional financial exchanges, market-makers pay zero or even negative fees (rebates, kickbacks).We assume that arbitrageurs are operating at the lowestfee level. To track Binance’s fee schedule, we used theWayback Machine [12], a digital archive of the World WideWeb, to view Binance’s fee web page historically. In ouranalysis time span, Binance’s fee web page changed times.However, the lowest fee level remained constant at . bps formakers and . bps for takers.V. M ETHODOLOGY
In this section, we describe our methodology for discoveringtriangular arbitrage trade sequences in Binance by examiningthe trade data. During our analysis, we discovered that asub-strategy of triangular arbitrage, involving only the firsttwo conversions, is widely deployed. We refined our originalmethodology to identify such conversions. These conversionsexhibit some risks, one of them is the scenario where multipletraders compete for the same intermediary coin, potentiallyharming laggards’ profitability. We identify these risks andoutline a methodology for clustering competing events. Lastly,we observe different strategies traders take to mitigate this riskand describe a methodology to detect it. . Discovering Triangular Arbitrage Trading Sequences
To discern triangular arbitrage trading sequences, we designa methodology to identify likely arbitrage trading sequences.We look for trading sequences of the form c (cid:55)→ c (cid:55)→ c (cid:55)→ c , where c is an anchor coin (BTC, BNB, ALTS,Stable coins). Arbitrageurs start with some quantity Q of c ,exchange it to c at price p , resulting in Q units of c . Inpractice, Binance deducts the fee upon conversion, therefore Q will be slightly lower than the conversion price. Next, Q units of c are converted to c , resulting in Q units, minusfees. Lastly, Q units of c are converted back to c , minusfees, resulting in Q (cid:48) units of c . If Q (cid:48) > Q , then the arbitragesequence is profitable.To successfully profit from this opportunity, arbitrageursneed to execute trades, c (cid:55)→ c , c (cid:55)→ c and c (cid:55)→ c . First,an arbitrageur needs to calculate the initial quantity Q of c ,such that during conversions, fee payments and other tradingconstraints will leave no or minimal residue in the intermediarycoins. Second, since Binance does not support batch trading,i.e., grouping multiple orders in a single request, arbitrageursneed to ensure correct timing of their trades. For example,if the order c (cid:55)→ c arrives before c (cid:55)→ c , then it willfail as the arbitrageur does not hold c yet. Furthermore, thearbitrageur competes with other arbitrageurs for these trades,so speed is an important factor.In order to identify triangular arbitrage sequences, we firstneed to ensure that the same quantity is flowing through dif-ferent coins, ending at the base coin. Binance quotes quantitiesbased on how the pair is listed. Different pairs have differentquantity/price restrictions, namely, minimum, maximum andincrement size. Since quantities and prices change in discretesteps, a small quantity might not be converted, leaving aresidue. These small residues need to be accounted for whenidentifying trades with equal quantities. While these residueshave a (small) value, in practice, they cannot be convertedimmediately to anchor coins, due to minimum size restric-tions. As residue accumulates beyond the exchange threshold,arbitrageurs can convert it back to anchor coins. We foundthat less than . of the time, the profitability was decidedby the residue. Therefore, in our detection process we ignorethe residue value. To illustrate coin exchanges, we follow anactual trade example from Binance.
1) BTC ⇔ ETH Exchange Example:
Consider the conver-sion between BTC and ETH. It is listed as ETH/BTC inBinance. ETH is called base asset and BTC is called the quoteasset . The quantity is always given in base asset terms. Thispair has a . minimum quantity (base asset), , max-imum quantity, . quantity increments, . minimumprice (quote asset), , maximum price and − priceincrements. At the time of writing, the last trade of ETH/BTCwas executed at a price of . and quantity . . The“sell” flag was on, meaning that the holder of ETH was theone to initiate the trade and met the buyer at the buyer’s bidprice. Assume both participants are at the cheapest fee level,currently at . bps for takers and . bps for makers.From the ETH holder’s perspective: Since ETH is thebase asset and the “sell” flag is on, this means the ETH Binance listing Matching condition c /c , c /c q p − q = fee + residue c /c , c /c q − q = fee + residue c /c , c /c q p − q p = fee + residue c /c , c /c q − q p = fee + residueTable IVM ATCHING EQUAL QUANTITIES IN CONVERSIONS WITH COMMON COIN . q ij AND p ij ARE THE QUANTITIES AND PRICES QUOTED IN THE TRADEDATA . holder initiated the trade and met the buyer at the buyer’sbid price, therefore paying a liquidity taking fee of . bps.The holder exchanged . units of his ETH at a price of . BTC per ETH. This means the holder ended with . · . · . . units of BTC.Note that if . BTC are to be exchanged forsome other coin, only . could be converted, leaving . BTC residue.From the BTC holder’s perspective: Since BTC is the quoteasset and the “sell” flag is on, this means the BTC holderprovided the liquidity for the trade and his price was met bythe seller, thus paying a liquidity making fee of . bps. TheBTC holder exchanged . · . . unitsof BTC at a price of . BTC per ETH, while paying . bps fee, resulting in (0 . / . · . . ETH.From Binance’s perspective: They collect . bps of the BTCproceeds from the ETH holder, i.e., . · . ≈ . · − units of BTC. If the ETH holder also holds BNB,then this amount is actually converted to BNB terms (usingan average of recent exchange ratios between BTC and BNB),and deducted from the BNB balance. If the ETH holder doesnot own BNB, then . · − BTC are deducted from theproceeds. In addition, Binance also collect . bps of the ETHproceeds from the BTC holder, i.e., . · . ≈ . · − units of ETH. If the BTC holder also holds BNB, thisamount is collected in BNB terms as well. Note that if theseller/buyer did not hold BNB, the fee would have been higher.In our analysis, we assumed arbitrageurs operate at the lowestfee level.
2) Identifying Equal Quantities in Triangular ArbitrageSequences:
We identify sequences of trades, c (cid:55)→ c (cid:55)→ c (cid:55)→ c , where the same quantity is passed. The quantity is quotedin the base asset and depends on whether c /c or c /c islisted, whether c /c or c /c is listed and whether c /c or c /c is listed. When matching quantities between trades oftwo pairs, having a common coin, c (cid:55)→ c and c (cid:55)→ c , wetranslate the quantities to the common coin’s terms, c , andcheck if they are equal, up to fees and residue resulting fromthe trade. In Table IV, we describe the translation process,based on different listing scenarios in Binance.
3) Identifying Trade Latency in Triangular Arbitrage Se-quences:
When a triangular arbitrage opportunity presentsitself, arbitrageurs compete amongst each other to be the firstto execute the trade sequences. There are three trades to beexecuted, c (cid:55)→ c , c (cid:55)→ c and c (cid:55)→ c . Since Binancedoes not support batch trading, an arbitrageur will have tosend three limit orders with prices p , p , p and quantities , q , q . These quantities are equal in the conversionprocess, in the sense explained previously and the prices matchthe prices quoted in the order book. To ensure that tradesare received in their original order, the arbitrageur will takeinto account network latency and wait a small amount of timebetween sending consecutive orders. Analysis of the trade datasuggests that the average latency between consecutive tradesis ms with a standard deviation of ms. Around of trades with matching quantities are executed within ms- ms of each other. Therefore, clustering trades using longerlatency does not have material impact on the number of tradesidentified. We find that using ∆ t ≈ ms as an approximationfor arbitrage latency between consecutive trades maximizesprecision and minimizes recall.We found that less than . of triangular arbitragesequences contain a liquidity-making trade. We believe thisbehavior is caused by Binance’s fee model, which chargestraders a commission even for liquidity making trades. Iftraders used liquidity-making orders, they would need to paythe fee in case they were filled. At that point, it is notguaranteed that an arbitrage opportunity will exist, while thefee is already paid and exposure to what is mostly an illiquidcoin is already established. To further enhance our precision,we require arbitrage trade sequences to be all liquidity-taking.Furthermore, we found a surprisingly low number of trian-gular arbitrage trades, 1,381,928 in total, accounting for . of total number of trades. However, in the course of clusteringtriangular arbitrage trades, we witnessed a much larger numberof partial arbitrage sequences, 20,892,825, or . of totaltrades, where traders executed the first two trades, c (cid:55)→ c and c (cid:55)→ c , but did not execute the third trade, c (cid:55)→ c .Executing the first two trades effectively converts c to c at an exchange ratio of p · p , minus fees and residue.Interestingly, of the time these trades resulted in anexchange ratio that was favorable to the exchange ratio ofthe direct trade c (cid:55)→ c . We call this trading strategy indirectinternal conversions and explain below in more details whatis means to have a “favorable” rate.We refine our methodology to identify indirect internalconversions and study the root cause of unprofitable instances.We elaborate on the risks associated with this trading strategyin the discussion section. B. Discovering Indirect Internal Conversion Attempts
We refined our original methodology for discovering trian-gular arbitrage sequences by relaxing the constraint for thethird trade to be executed. We identify equal quantities inthe first two trades in the same way as before. To determinethe trade latency, we empirically explored different time con-straints. of trades with equal quantities have a latencybetween ms and ms. Latency lower than ms givespoor recall, with less than of total attempts. Latency greaterthan ms only accounts for of all attempts. The averagelatency is ms with a standard deviation of ms. We findthat, as before, ∆ t ≈ ms is an approximation that likelyprovides both high precision and recall for identifying indirectconversion trading sequences. However, we lack ground truthto definitively evaluate this part of our methodology.
1) Determining Profitability of Internal Conversions:
Thefirst two trades of a triangular arbitrage sequence, c (cid:55)→ c (cid:55)→ c (cid:55)→ c are c (cid:55)→ c and c (cid:55)→ c . Executing these twotrades gives an indirect exchange ratio between c and c . Ifthis exchange ratio, net of fees and residue, is greater thanthe exchange ratio of c (cid:55)→ c , then this conversion offersa favorable exchange ratio to the direct one. We call suchfavorable conversions indirect internal conversions . Since theexchange ratio between c and c fluctuates, it is important todefine the time it is taken. We wish to approximate the trader’sview of the market upon executing the internal conversion.Therefore, we take the exchange ratio at a short period of timeprior to the first trade’s execution time. As discussed above, ms is a good delay approximation for the trader’s view.Kaiko’s order book data is given on a -second basis, so it isunlikely that this ms time window falls within Kaiko’s dataintervals. To approximate the order book’s best bid/ask price atthe time, we take the volume weighted average price (VWAP)[11] of c (cid:55)→ c , over the period of ms, prior to the executiontime of the first trade. These trades tell us the best bid/ask levelat that time, and taking an average, weighted by volume, is agood approximation of the trader’s view of the order book.However, it is possible that within that time period, otherparticipants posted bids and asks and then cancelled them,giving the trader a completely different view of c (cid:55)→ c . Inour analysis, we assume that this did not occur. If there wereno trades during that period and order book data is unavailable,we cannot determine if the conversion is profitable and did notinclude such conversions in our profitability analysis.We found , , indirect conversions, which is . of the total number of trades. of the indirect conversionsresulted in a favorable exchange ratio. We hypothesized thatunprofitable conversions occur when multiple traders obtainthe same intermediary coin c , and simultaneously attempt toconvert it to c . For example, one trader is looking to convert c (cid:55)→ c (cid:55)→ c for a favorable exchange ratio to c (cid:55)→ c , and asecond trader is looking to convert y (cid:55)→ c (cid:55)→ c at a favorableexchange ratio to y (cid:55)→ c ( y could be the same coin as c ).When both traders obtain c , there could be a scenario whereonly one trader is able to convert c to c at the best bid/asklevel. This happens when the first one to execute c (cid:55)→ c consumes the entire quantity of the best bid/ask and causesthe order book to change. The laggard in this case engages ina loss mitigating strategy. One option is to convert c to c at a worse exchange ratio than originally intended, potentiallyresulting in a conversion that is worse than the direct one.Another option is to convert c to several other coins, withthe goal of minimizing the potential losses from unfavorableexchange ratios. We call the former strategy a full-exit strategy and the latter partial-exit strategy .To corroborate our hypothesis with the trade data, we refineour methodology to cluster competing conversions and identifyloss-mitigating exit strategies. C. Clustering Competing Indirect Internal Conversion At-tempts
Using our methodology to discover indirect conversions, weidentified conversions that were initiated around the same timend had an overlapping intermediary coin. This is becausecompeting conversions try to complete the same second trade.Therefore, for a given second trade c (cid:55)→ c , we look atindirect conversions attempts of the form x (cid:55)→ c (cid:55)→ c thatstarted within ms of each other.Every cluster of competing conversions can have winningconversions , i.e., indirect conversions that were completed ata favorable rate to the direct rate and losing conversions ,conversions that completed at an unfavorable rate to the directrate.Losing conversions can have many causes, such as mistim-ing or an inaccurate view of the order book. We believe thatone of those reasons is that traders who successfully completedthe first trade, and failed to complete the second trade, areunloading their c coin at an unfavorable rate to avoid havingdirectional exposure to c .
1) Identifying Loss-Mitigating Trading Strategies:
For los-ing conversions, we wanted to see if the loss was the result ofa competing winning conversion that utilized all the capacityof c (cid:55)→ c . Determining whether a conversion utilized allcapacity is impossible without knowing the order book atthat time. However, we can approximate it by observing thenext trade of c (cid:55)→ c . Since we have the trade id , which ismonotonically increasing with the trades, we can tell whetherthe next trade of c (cid:55)→ c was completed at the same price ornot. If it was not completed at the same price, it is likely thatthe previous trade used up the capacity of the previous level.This is only a heuristic, as traders can post and cancel ordersat any time.Loss-mitigating conversions are losing conversions where awinning conversion in the same cluster used up the interme-diary’s coin capacity.By analyzing the trade data, we found that . of alllosing conversions corresponded to loss-mitigating traders.We identified two sub-strategies of loss-mitigating traders.
2) Full-Exit Loss Mitigating Strategy:
These are conver-sions that converted an equal quantity Q from x (cid:55)→ c and c (cid:55)→ c , i.e., these are traders who converted all their c intoone coin.
3) Partial-Exit Loss Mitigating Strategy:
These are con-versions that converted a quantity Q from x (cid:55)→ c at price p , but converted a lower quantity Q < Q from c (cid:55)→ c ,i.e., these are traders who unloaded some, but not all of their c into one coin. This strategy can be attributed to traderssolving the following minimization problem: Find a set of k coins { d , d , . . . d k } having exchange ratios { p , p , . . . p k } ,and a set of k quantities { q , q , . . . q k } , where (cid:80) kj =1 q j = Q such that the following loss function is minimized: Loss = k (cid:88) j =1 q j (cid:18) p p p j (cid:19) where p is the direct exchange ratio of x (cid:55)→ c . To detectpartial exits, we iterate over all different combinations of tradesfrom c (cid:55)→ c having quantities less than Q , such that theysum exactly to Q , up to fees and residue.We found that of loss-mitigating strategies are partialexits and are full exits. It also turns out that solving a loss minimization problems is effective, as the average partial-exitloss is bps while the full-exit average loss is bps.VI. R ESULTS
A. Volume
We found , , indirect conversions, which is . of total trades. We found , , triangular arbitragesequences, accounting for . of total trades.The time series of the number of favorable indirect conver-sion attempts as a percentage of number of direct conversions,on a daily basis, is shown in Figure 2. The number of favorableindirect conversion attempts, on a daily basis, in shown inFigure 3. The number of triangular arbitrage attempts, on adaily basis, in shown in Figure 4. Figure 2. Percentage of daily volume of direct conversions trades that is alsodone indirectly. Typically, − of the daily volume of a direct conversionpair is also executed via indirect conversion sequences.Figure 3. Daily number of indirect conversion attempts. From October - October , the number of indirect conversions has been trending downand since October has been trending up. B. Latency
We found that indirect conversion sequences have, onaverage, . ms of delay between the first trade and thesecond, with a standard deviation of . ms. . havea latency of ms or less. Triangular arbitrage sequences arefaster than indirect conversions. This could be an indicationthat this space is more competitive. We found that triangular igure 4. Daily number of triangular arbitrage attempts. From October - April , the number of triangular arbitrage attempts has been trendingdown and since April has been trending up, with a sharp spike in July arbitrage sequences have, on average, . ms of delay betweenconsecutive trades, with a standard deviation of . ms. . have a latency of ms or less. The latency statisticsof triangular arbitrage sequences and indirect conversions areshown in Table V. The latency distribution, in ms, of indirect Type Metric ValueTriangular Arbitrage Latency Average . msTriangular Arbitrage Latency Stdev . msTriangular Arbitrage % Below ms . Indirect Conversion Latency Average . msIndirect Conversion Latency Stdev . msIndirect Conversion % Below ms . Table VL
ATENCY STATISTICS FOR TRIANGULAR ARBITRAGE AND INDIRECTCONVERSIONS . T
HE TRIANGULAR ARBITRAGE STRATEGY EXHIBITSLOWER LATENCY THAN INDIRECT CONVERSIONS , POSSIBLY A SIGN THATTHIS STRATEGY IS MORE COMPETITIVE conversions and triangular arbitrage is shown in Figure 5.
Figure 5. Left: Latency distribution, in ms, of indirect conversion tradesequences. Right: Latency distribution, in ms, of triangular arbitrage tradesequences. Indirect conversion trades exhibit higher latency with a fatter tail,indicating that triangular arbitrage is more competitive.
C. Profitability
We calculate the equal-weighted return and the return oncapital for triangular arbitrage trades and indirect conversions.The equal-weighted return is the average of returns. The returnon capital is the arithmetic average of returns, weighted by quantity of base coin committed to the trade, i.e., larger tradesreceive higher weight.Indirect conversion attempts were profitable . of thetime with an equal-weighted net return of . bps. The returnon capital for indirect conversions is greater, at . bps,which means that traders efficiently commit more coins tomore profitable opportunities.Triangular arbitrage trades were profitable . of thetime with an equal-weighted net return of . bps. The returnon capital for triangular arbitrage sequences is greater, at . bps, which is slightly higher than the equal-weighted return,but not significantly.It appears that triangular arbitrage traders are unable to sig-nificantly allocate more coins to more profitable opportunities.One potential explanation is that the space is more crowded,or “arb-ed out,” than the indirect conversions strategy. D. Loss-Mitigating Strategies
We saw , , instances of indirect conversion com-pleted at an unfavorable rate compared to the direct rate, or . of the total number of indirect conversions. . ofsuch conversions were loss-mitigating trades, triggered by acompeting indirect conversion that used all the intermediarycoin’s capacity. When this happened, there were . compet-ing conversions on average. The highest number of competingconversions we saw in one cluster was .In of such cases, the entire base quantity was unloadedinto another coin, i.e., they were full exits. The return oncapital for the full exit strategy was − . bps. of thetime, the base coin quantity was unloaded to several othercoins, i.e., they were partial exits. On average, the numberof coins used to exit was . , and the return on capitalwas − . bps. Intuitively, this shows that solving a lossminimization problem mitigates losses by . bps comparedto a full exit. Note, however, that a full exit could potentiallybe the solution to the minimization problem as well.VII. D ISCUSSION
The existence of triangular arbitrage in traditional foreignexchange markets is well documented and studied in academia.In centralized cryptocurrency exchanges such as Binance,triangular arbitrage happens at a small scale. However, wefound that a different strategy is taking place, which convertstwo coins through an intermediary coin, at a favorable rateto the direct conversion rate. This strategy comes with arisk, however, that multiple competing conversions occur atthe same time, preventing slower ones from completing theirconversions. We saw that when this happens, traders engagein a loss-mitigating strategy. We believe that the rationale forthis strategy stems from Binance’s fee structure, where thereis a fee for market-making, thus creating frictions for thetriangular arbitrage strategy. We believe arbitrageurs adaptedto the fee structure by executing the indirect conversionsstrategy. While triangular arbitrage increases the arbitrageur’sholding in the base asset, indirect conversions simply providea more favorable ratio to the direct one. Participants whoalready have a stake in the cryptocurrency ecosystem and wisho rebalance their portfolio might choose to engage in thisstrategy. VIII. C
ONCLUSION
We found that . of daily trades on Binance can beattributed to triangular arbitrage trades. We found that adifferent strategy is times more prevalent, at . ofdaily trades, which involves exchanging coins through anintermediary coin at a favorable rate to the direct exchangerate. We designed a methodology to measure such events anddiscovered that . of the time the rate obtained fromthese conversions is . bps better than the direct one. Whenit is not, . of the time traders engage in loss-mitigatingstrategies, and we identified two of them.A CKNOWLEDGEMENTS
The authors would like to thank Andrew Papanicolaou andDavid Yermack for their feedback and suggestions to improvethe quality of our manuscript. We acknowledge funding sup-port under National Science Foundation award 1844753.R
PhysicaA: Statistical Mechanics and its Applications , 310(3):467–479, 2002.[15] T. Bj¨ork.
Arbitrage theory in continuous time . Oxford university press,2009.[16] P. Daian, S. Goldfeder, T. Kell, Y. Li, X. Zhao, I. Bentov, L. Brei-denbach, and A. Juels. Flash boys 2.0: Frontrunning, transactionreordering, and consensus instability in decentralized exchanges.
CoRR ,abs/1904.05234, 2019.[17] S. Drozdz, L. Minati, P. Oswiecimka, M. Stanuszek, and M. Watorek.Signatures of the crypto-currency market decoupling from the Forex.
Future Internet , 11:154, 2019.[18] Feng Wang, Yuanxiang Li, Li Liang, and Kangshun Li. Triangulararbitrage in foreign exchange rate forecasting markets. In , pages 2365–2371, June 2008.[19] D. Fenn, S. Howison, M. McDonald, S. Williams, and N. Johnson.The mirage of triangular arbitrage in the spot foreign exchange market.
International Journal of Theoretical and Applied Finance , 12(8):1105–1123, 12 2009. [20] T. G. Fischer, C. Krauss, and A. Deinert. Statistical arbitrage incryptocurrency markets.
Journal of Risk and Financial Management ,12(1):31, 2019.[21] A. Kroeger and A. Sarkar. Law of one bitcoin price?
Federal ReserveBank of Philadelphia , 2017.[22] S. Kr¨uckeberg and P. Scholz. Decentralized efficiency? Arbitrage inBitcoin markets.
Arbitrage in Bitcoin Markets (March 29, 2018) , 2018.[23] S. Krueger, M. M¨uller, A. Betzer, and C. Rokitta. Event-driven strategiesin crypto assets.
Available at SSRN 3363589 , 2019.[24] I. Makarov and A. Schoar. Trading and arbitrage in cryptocurrencymarkets.
Journal of Financial Economics , 135(2):293 – 319, 2020.[25] R. Radcliffe.
Investment: Concepts, Analysis, Strategy.
Addison-WesleyEducational Publishers, Inc., 1997.[26] G. Robert, O. Pawel, W. Marcin, and D. Stanislaw. Detecting corre-lations and triangular arbitrage opportunities in the Forex by means ofmultifractal detrended cross-correlations analysis.
Nonlinear Dynamics ,98(3):2349–2364, Nov 2019.[27] A. Shleifer and R. W. Vishny. The limits of arbitrage.
The Journal offinance , 52(1):35–55, 1997.
IX. A
PPENDIX
In this appendix, we define notations that are specific tothe market microstructure of Binance and formally definetriangular arbitrage and indirect conversions.Let P be the set of all pairs x/y traded on Binance. Everypair facilitates two conversions; from x to y and from y to x ,denoted by ( x (cid:55)→ y ) and ( y (cid:55)→ x ) , respectively. Definition IX.1. (exchange ratio)
Let ψ ij be the proceeds ofconverting 1 unit of coin c i to c j . We call ψ ij the exchangeratio and it is given by ψ ij = p askcj/ci if c j /c i ∈ P p bidc i /c j if c i /c j ∈ P Definition IX.2. (pair capacity)
Denote η ij the maximumquantity c i that can be converted to c j . We call η ij the capacityof ( c i (cid:55)→ c j ) and it is given by η ij = (cid:40) p askc j /c i q askc j /c i if c j /c i ∈ P q bidc i /c j if c i /c j ∈ P Definition IX.3. (bid-ask spread)
We write ∆ ij = (cid:40) p askc j /c i − p bidc j /c i if c j /c i ∈ P p askc i /c j − p bidc i /c j if c i /c j ∈ P the bid ask spread of pair ( c i (cid:55)→ c j ) Definition IX.4. (trade quantity) suppose we wish to convert q units of c i to c j . The trade quantity passed to the exchangeas a parameter is denoted T ( q ) and is given by T ij ( q ) = qp askcj/ci if c j /c i ∈ P q if c i /c j ∈ P Definition IX.5. (minimum trade lot size)
Let m ij be theminimum amount of c i that must be converted to c j in ( c i (cid:55)→ c j ) , i.e., when converting q units of c i to c j , m ij ≤ q Definition IX.6. (high-level parameters) the h -th order bookexchange ratio and capacity are denoted ψ hij and η hij , respec-tively. Definition IX.7. (minimum price increment)
Denote dx ij thethe minimum order book price increments of ( c i (cid:55)→ c j ) . emark. It holds that dx ij = dx ji . In practice, when converting q units of c i to c j , the tradequantity passed to the exchange as a parameter has to be amultiple of dx ij , therefore only (cid:106) T ( q ) dx ij (cid:107) dx ij units are passed.Denote (cid:98) x (cid:99) y := (cid:106) xy (cid:107) y the rounding operation of x to thenearest multiple of y . Definition IX.8. (residuals)
Let r ij ( q ) be the quantity of c i left when converting q units of c i to c j . We write r ij ( q ) = (cid:40)(cid:16) T ( q ) − (cid:98) T ( q ) (cid:99) dx ij (cid:17) p askc j /c i if c j /c i ∈ P T ( q ) − (cid:98) T ( q ) (cid:99) dx ij if c i /c j ∈ P Therefore, converting x units of c i yields ψ ij [ x − r ij ( x )] units of c j and r ij ( x ) residual units of c i A. Cycle Arbitrage
The set of pairs C = { ( c (cid:55)→ c ) , ( c (cid:55)→ c ) , . . . , ( c n (cid:55)→ c n +1 ) } is called a cycle , if c n +1 = c and c j (cid:54)∈ { c , . . . c j − } for < j ≤ n . In the context of cycles, we use the shortenednotation ψ i , η i , dx i , r i when referring to pairs of the form ( c i (cid:55)→ c i +1 ) . A cycle with n = 3 is called a triangularsequence . Definition IX.9.
The capacity of cycle C = { ( c (cid:55)→ c ) , . . . , ( c n (cid:55)→ c n +1 ) } is the maximum quantity of c thatcan be converted through its pairs. The capacity of a cycle is given by Q = min ≤ i ≤ n η i (cid:32) i − (cid:89) k =1 ψ k (cid:33) − (1)The balance of c i , denoted q i , is given by the recurrencerelation q = Q − r ( Q ) q i +1 = ψ i [ q i − r i ( q i )] , ≤ i ≤ n Remark. r i (cid:16) x − r i ( x ) (cid:17) = 0 B. Binance Fee Structure
The fees paid on ( c i (cid:55)→ c i +1 ) are f q i +1 b i +1 where f =5 · − and b i +1 is the last traded price of ( c i +1 (cid:55)→ BNB ) b i = (cid:40) p BNB /ci if BNB /c i ∈ P p c i / BNB if c i / BNB ∈ P The gain/loss in c terms is given by G = ( q n +1 − q ) + n (cid:88) i =1 r i ( q i ) ψ i (cid:124) (cid:123)(cid:122) (cid:125) residuals c value − f n (cid:88) i =1 q i +1 b i +1 ψ B (cid:124) (cid:123)(cid:122) (cid:125) fees c value (2)Note that G is a function of { ψ , . . . , ψ n , ψ B , b , . . . , b n +1 } as well as ψ , . . . ψ n . Definition IX.10. a cycle is called an arbitrage free cycle if G ≤ Definition IX.11. a cycle is called an open cycle if G > Remark.
One can argue that there are additional costs forconverting the residuals to c and purchasing BNB tokensahead of time to be able to pay fees, which are not accountedfor in (2) . However, this can be done in infrequent bulk trades.We make the assumption that small directional exposure toBNB and residuals is negligible compared to the accumulatedgains over a period of time. Remark 1.
If we assume zero residuals, i.e., ∀ i : r i = 0 , then q i +1 = Q (cid:81) i − j =1 ψ j and (2) reduces to G = Q ( (cid:81) ni =1 ψ i − − f (cid:80) ni =1 Q (cid:16)(cid:81) ij =1 ψ j (cid:17) b i +1 ψ B C. Indirect Internal Conversions
The set of pairs V = { ( c (cid:55)→ c ) , ( c (cid:55)→ c ) , . . . , ( c n (cid:55)→ c n +1 ) } is called a conversion if c j (cid:54)∈ { c , . . . c j − } for The capacity of conversion V = { ( c (cid:55)→ c ) , . . . , ( c n (cid:55)→ c n +1 ) } is the maximum quantity of c thatcan be converted through its pairs and is defined similarly tothe capacity of a cycle. Definition IX.13. (conversion proceeds) Let c V (cid:32) c n +1 be aconversion from c to c n +1 with capacity Q . The conversionproceeds of q ≤ Q units of c is the quantity of c n +1 thatresults from converting through the pairs of V , accounting forresiduals and fees, i.e., P r ( q, V ) = q n +1 + n (cid:88) i =1 r i ( q i ) ψ i ( n +1) (cid:124) (cid:123)(cid:122) (cid:125) residuals c n +1 value − f n (cid:88) i =1 q i +1 b i +1 ψ B ( n +1) (cid:124) (cid:123)(cid:122) (cid:125) fees c n +1 value Definition IX.14. (profitable conversions) Let x V (cid:32) y and x V (cid:32) y be two conversions from x to y , with capacities Q and Q , respectively. Let Q = min { Q , Q } . We saythat V is a profitable conversion w.r.t. V if the proceeds ofconversion V are greater than the proceeds of conversion V ,i.e., P r ( Q, V ) > P r ( Q, V ) D. Binance Order Types Binance supports the following order types:1) LIMIT - an order to buy/sell a pair at a specified priceand can only be executed at that price (or better). Notguaranteed to execute2) MARKET - an order to buy/sell a pair at the best currentmarket price, i.e., lowest ask or highest bid.3) STOP_LOSS_LIMIT - an order to buy (sell) a pair,once its price exceeds (drops below) the specified price.In contrast to a LIMIT order, the price should be above(below) the lowest ask (highest bid). The execution priceis guaranteed to be the specified price.) STOP_LOSS - same as STOP_LOSS_LIMIT , but whenthe price threshold is breached, a MARKET order isexecuted and the execution price is not guaranteed.5) TAKE_PROFIT_LIMIT - equivalent to a LIMIT order6) TAKE_PROFIT - automatically places a MARKET orderwhen the specified price level is met7) LIMIT_MAKER - LIMIT orders that will be rejected ifthey would immediately match and trade as a taker.8) ICEBERG - an order used for large quantities as itautomatically breaks down to multiple