Projecting XRP price burst by correlation tensor spectra of transaction networks

Cryptoassets are becoming essential in the digital economy era. XRP is one of the large market cap cryptoassets. Here, we develop a novel method of correlation tensor spectra for the dynamical XRP networks, which can provide an early indication for XRP price. A weighed directed weekly transaction network among XRP wallets is constructed by aggregating all transactions for a week. A vector for each node is then obtained by embedding the weekly network in continuous vector space. From a set of weekly snapshots of node vectors, we construct a correlation tensor. A double singular value decomposition of the correlation tensors gives its singular values. The significance of the singular values is shown by comparing with its randomize counterpart. The evolution of singular values shows a distinctive behavior. The largest singular value shows a significant negative correlation with XRP/USD price. We observe the minimum of the largest singular values at the XRP/USD price peak during the first week of January 2018. The minimum of the largest singular value during January 2018 is explained by decomposing the correlation tensor in the signal and noise components and also by evolution of community structure.


Introduction
Cryptoassets represent value that one can transfer, store, or trade digitally.It uses cryptography to protect data and distributed ledger technology to record transactions.A blockchain technology, which is a form of secure digital ledger, is used to store the records of crypto transactions.Recently, cryptoassets have been very popular as an investment, but cryptoasset prices are extremely volatile and unpredictable.The cryptomarket experienced severe price fluctuations from 2017, December to 2018, January.The presence of bubbles i.e., explosive price behavior in this asset has attracted attention from the researchers.At present, there are many cryptoassets.Some well-known of them are Bitcoin (BTC), Ethereum (ETH) and XRP.For the last one decade complex network theory has been widely used to analyze cryptoasset transaction data.Among the cryptoassets, networks of BTC and ETH transactions have been studied extensively 1 , which include different structural properties 2,3 , temporal evolution 2,[4][5][6] and market effect [7][8][9] of these networks.In contrast, XRP transactions have been less explored.Ripple Labs Inc. created XRP as the native cryptocurrency for the Ripple network, which is designed to provide fast, efficient, and cost-effective financial transactions.The Ripple network is used for real-time gross settlement of financial transactions, currency exchange, and cross-border remittances.The goal of the Ripple network is to provide a stable and decentralized ledger system that can be used to facilitate cross-border transactions in a more efficient and cost-effective manner.XRP is used as a bridge currency in the network, helping to facilitate cross-border transfers and providing liquidity to the system.P. Moreno-Sanchez et al. uncovered community formation and clustering properties for the Ripple network 10 .Y. Ikeda studied the structural properties of XRP transaction network, which include the heavy tail nature of nodal strength distributions, low value of clustering coefficient and significant triangular motif 11 .More recently, the role of the most active nodes with respect to outgoing and incoming flows for a duration including bubble/crash period has been quantified for BTC and XRP transaction networks 12 .
Any statistical dependence between a pair of variables can be studied by cross correlation which is predictive and useful for empirical data.It can be measured in different ways: One of the simple and well-known methods is the Pearson correlation which represents the linear dependence between variables and is defined for a pair of variables x and y with n observations Here x, y, and σ x , σ y indicate mean and standard deviations of x and y.The cross correlation methodology armed with random matrix theory (RMT) is mostly applied to time series data.The aim of such method is to analyze high dimensional data to find key factors for the collective dynamics of many quantities.For example, it is used to study the daily returns of different stocks [13][14][15] and foreign exchange rates 16,17 , monthly macroeconomic data 18 , or different medical data such as electroencephalogram, magnetoencephalography data recording 19 .Also, D. Kondor et al. applied principal component analysis on the matrices obtained from the daily network snapshots to show the relationship between the price of bitcoin with structural changes in the transaction network 20 .The application of cross correlation on stock market data shows the relationship between stock price changes and liquidity or trading volume 21 .Note that these are time series of variables that emerge due to interactions of different entities of the system.In most cases, we lack detail information of the interactions at the micro level.For example, we do not have detail information about the interaction among the individuals in stock markets.
In the case of XRP, we know the information for all transactions between wallets.Using this high-quality micro level data, we develop a method of cross correlation tensor which can be applied on dynamical XRP transaction networks.Our method relates the structural properties of XRP networks to the XRP/USD price.To calculate the correlation tensor, nodes of the networks are converted to vectors using network embedding techniques 22,23 .We use the DeepWalk embedding technique 22 , which uses a set of truncated random walks to learn latent features.The latent features capture neighborhood information and community memberships of the nodes.Using a network as the input, the algorithm provides a latent representation in a continuous vector space as an output.A generalization of the DeepWalk algorithm is node2vec 23 , which uses biased random walks to learn features that encode more complex relations of nodes, such as functional relationships.Using the vector representation for a subset of nodes present in every weekly XRP transaction networks, we calculate correlation tensors for different time periods.We perform a double singular value decomposition on the correlation tensors to obtain its spectra.We compare the results with reference correlation tensors to understand the significance.As a reference correlation tensor, one usually uses the RMT method.However, as we are using a small time window to calculate the correlation tensor, RMT method will not be suitable as reference.We use randomized and reshuffled correlation tensors as reference correlation tensors.The largest few singular values capture the impact of the bubble period or crash in XRP price.The largest singular value is found to be significant and has a strong negative correlation with XRP/USD price.Furthermore, it provides an early indication for XRP/USD price, including bubble periods or crashes.

Results
The weekly network obtained from XRP transactions between wallets evolves with time.We focus our study on the duration 2017 October 02 to 2018 March for which covers a bubble period in XRP price.It indicates 22 weekly networks.The number of nodes for each weekly network is shown in Fig. 1 (a).We observe that the number of nodes of the weekly networks increases rapidly from 45, 169 during the week of 2017, November 27 -December 04 to the peak value 209, 143 during the week of 2018, January 01 -January 07 and later further falls to 27, 811 during the week of 2018, February 26 to March 04.Fig. 1 (b) shows the decline in the number of links per node indicating the average nodal in-or out-degree from 2.15 to 1.20 during 2017, October 02 -2018 March 04.The decline in the number of links per node indicates a reduction in the average frequency of transactions of a node with other distinct nodes.We note that XRP transaction volume was very high for three weeks between December 05 -December 24 and also for the week during 2018, January 22 -January 29, as shown in Fig. 1 (c) .The three weeks of extremely high XRP transaction volume may have contributed to the bubble formation in XRP/USD during 2017, December 25 to 2018 January 07.The daily XRP/USD price from October 2, 2017 to March 4, 2018 is shown in Fig. 1 (d).The XRP/USD price had an extraordinary rise and fall between December 2017 and January 2018.This indicates a bubble period for XRP.We consider this period for our study because this is the most significant bubble period for the cryptoasset market.The chart of XRP/USD prices for a more extended period is shown in SI Fig. S1.
We have embedded each of these weekly networks using the well-known DeepWalk algorithm on D = 32-dimensional space.For the details of the embedding technique, see Method section.This gives a D-dimensional vector V α i for each node of the networks.We use i, j as node indices and Greek letters α, β as components of the vectors on a D dimensional space.In weekly networks of XRP transactions, we found N = 71 nodes does at least one transaction every week.We call these N = 71 nodes, regular nodes.Each regular node of weekly networks in the embedding space is represented by a D-dimensional vector time series V α i (t), where i = 1, 2, 3, ...N, t = 1, 2, 3, ...T and α = 1, 2, 3, ...D. We have chosen D = 32 for our study.Other values of D give qualitatively similar results.Later, we provide the quantitative dependence on D in Eq. 11.

4/16
The correlation tensor between the different components of the regular nodes is defined as where ∑ is taken over 5 weekly {t − 2,t − 1,t,t + 1,t + 2} networks with ∆T = 2 for our analysis.The V α i and σ V α i represents mean and standard deviation of V α i over a time window of (2∆T + 1) = 5 weekly {t − 2,t − 1,t,t + 1,t + 2} networks.Note that lower the values of ∆T , more noise is present in the obtained correlation tensor.We also can not take ∆T too large as we are studying the dynamical evolution of the networks.We further discuss the dependence of the correlation tensor on the time window in the SI Text 2.
To understand the significance of the empirical correlation tensor, we consider the following two null hypotheses.The null hypothesis of the components of embedding vectors for regular nodes, V α i (randomize), are independent, uniformly distributed, random variables within [−1, 1].We obtained the randomized correlation tensor from V α i (randomize).Another method to randomize the empirical correlation tenor is to remove the correlation present between the different components of the embedding vectors, by reshuffling the positions of the components of embedding vectors V α i (reshuffle).We obtain the reshuffle correlation tensor from V α i (reshuffle).The distributions of the elements of empirical, randomize and reshuffle correlation tensor are shown in Fig. 2 for the week of 2017, November 06 -November 12.We have taken the average of the data for the distributions with 20 different runs of the embedding algorithm.The distributions from randomized and reshuffled correlation tensors are qualitatively identical.This is because the auto correlation for different components of the empirical embedding vectors vanishes when the lag is more than one week.These two distributions are symmetrical around zero, with an average value of the elements close to zero.The empirical correlation differs from the randomized and reshuffle correlation tensor.It is an asymmetric distribution having an average value of the elements 0.017.The correlation tensor has the dimension N × N × D × D. Since we have many elements in the correlation tensor, we uncover the crucial information by diagonalizing it using a double singular value decomposition (SVD) method.The double SVD is a natural extension of the single SVD for the correlation of standard non-embedded vectors V i .Since indices i and α correspond to the individual node and the embedding dimension, respectively, it is also natural to carry out SVD successively with the (i, j)-pair and with the (α, β )-pair separately as discussed in the section 'Data and methods'.3 for the week of 2017, November 06 -November 12.This shows that the largest singular value lies beyond the largest singular value of the randomized correlation tensor.Also, the spectral gap (ρ 1 1 − ρ 1 2 ) in the empirical correlation tensor is significantly large compared with its random counterpart.
The temporal variation of the largest singular values of empirical ρ γ k (t) and reshuffle ργ k (t) correlation tensor for different weeks is shown in Fig. 4. It is evident that the largest singular value ρ 1 1 is well above the largest singular values ρ1 1 of the randomized correlation tensor for all weeks.However, the second largest singular value ρ 1 2 lies below the randomized counterpart.Similar to the largest singular value ρ 1 1 , the spectral gap (ρ 1 1 − ρ 1 2 ) appears significantly higher than that of the randomized case.Moreover, we observe ργ k (t) remains approximately constant with time.In a stark contrast, the largest two empirical singular values and as well as a few more singular values (not shown) vary distinctively for different weeks.Note that normalizing the spectral gaps by their maximum value would make the spectral gaps of the empirical and randomized data comparable in scale, but it would not adequately demonstrate the difference in their magnitudes.
To investigate the relationship between singular values ρ γ k and XRP/USD price, we compare the variation of XRP/USD daily price with the largest singular value ρ 1 1 , the second largest singular value ρ 1 2 and the spectral gap (ρ 1 1 − ρ 1 2 ) in Fig. 5 (a)-(c).To quantify the dependence, we measure the correlation between the weekly XRP/USD price and the two largest singular values ρ 1 1 , ρ 1 2 respectively.The weekly XRP/USD price indicates the average daily closing price of XRP/USD for the week.Let us denote the weekly XRP/USD price as XRP/USD.The Pearson correlation between ρ 1 1 (t) and XRP/USD(t + 1) is found r = −0.908and p-value = 1.912 × 10 −7 .The Pearson correlation between ρ 1 2 and XRP/USD(t + 1) is found r = 0.847 and p-value = 9.22 × 10 −6 .Furthermore, we perform a multi-linear regression of XRP/USD(t + 1) ∼ C 0 + C 1 ρ 1 1 (t) + C 2 ρ 1 2 (t), gives C 0 = 27.91,C 1 = −0.033,C 2 = 0.008 and only the variable ρ 1 1 (t) is significant.We found R 2 = 0.8091 and p-value = 1.581 × 10 −6 , indicating that the 80% variation of XRP/USD(t + 1) can be explained by the largest singular value ρ 1 1 (t).We also observe there are significant correlation between singular values and weekly XRP/USD price with two weeks lead XRP/USD(t + 2) and three weeks lead XRP/USD(t + 3), which is described in detail in SI Text 3. Correlation between XRP/USD(t + 3) and ρ 1 1 (t) is found to be r = −0.68 and p-value = 0.001.This indicates that the largest singular value ρ 1 1 can give an early signal for XRP/USD price.This reflects the fact that the distribution for 2018, January 01-January 07 has a largest peak at zero and it is narrower than the other distributions, indicating that the dependence among the components of node vectors decreases during this time.The peakedness of each distribution can be quantified by its fourth moment, which is known as kurtosis.The different moments for the elements of the signal component of correlation tensor are tabulated in Table 1.Clearly, the peakedness and spread of the distribution during 2018, January 01-January 07 are relatively higher and thinner, respectively.As the average dependence among the components of the node vectors decreases during 2018, January 01-January 07, ρ 1 1 (t) has the minima during this period.To understand why the average dependence among the components of node vectors decreases during the bubble period, 2018, January 01-January 07, we investigate the change in community structure of the regular nodes.We use well known Infomap algorithm 24 to detect the communities in the entire weekly directed weighted networks.We observe the evolution of the number of communities of the XRP weekly network that contains at least one regular node in Fig. 7 (a).It is observed that the number of such communities decreases from around 40 to around 20 during the week 2017 December 04 -December 10 and the week 2017 December 18 -December 24.At the same duration, we observe that the maximum number of regular nodes in a community increases from around 10 to around 50, as shown in Fig. 7 (b).We further delve deeper into the community structure and observe the evolution of each regular node within the communities of the weekly networks.The evolution is shown in SI Fig. S3-S6.It shows that a big community of regular nodes forms during 2017, December 18 to December 24, as shown in SI Fig. S4-S5.This big community got fragmented in subsequent weeks.Moreover, the large community of the regular nodes remains almost intact during the non-bubble period.This distinctive change in the community structure might be related to the decrease in the average dependence among the components of node vectors or the appearance of minima for the largest singular value ρ 1 1 (t) during the bubble period compared with non-bubble period.Finally, using RMT [25][26][27][28] , we show the relationship between the largest singular value and the standard deviation for the   correlation tensor with normally distributed elements in Fig. 8.For the detail calculation, see the Method section.It also shows the deviation of the largest singular values for randomized correlation tensors calculated with different time windows.It is observed that as we increase the time window to measure the randomized correlation tensor, the largest singular value ρ 1 1 approaches the theoretical value ρ 1 1 = 2 √ NDσ .It reflects the fact that the noise arising from the smaller time window gradually decreases as we increase the window size.

Conclusion
In this work, we have used all the direct transactions between XRP wallets in a week to construct a weekly weighted directed network.Using the deep walk method, we have embedded weekly snapshots of the network in vector space.Deep walk encodes community information into nodal vectors using truncated random walks on the network.Once can explore other methods of embedding, such as node2vec, to study other regularities of the network.From the weekly snapshots of the regular nodal vector components, we calculate the correlation tensor at different time periods.We have used a double SVD to remove redundant information from the correlation tensor.The significance of our result is shown by comparing it with the results of a randomized counterpart.The evolution of the largest singular value ρ 1 1 shows distinctive behavior and it correlates significantly with the XRP/USD price.The decomposition of the correlation tensor into signal and noise components shows that correlation in the signal component decreases significantly during the bubble period.We explain this decrease in the correlation during the bubble period by the evolution of community structure that shows disruptive behavior during the bubble period.The disruptive behavior of community structure has also been observed in the foreign exchange market during economic downturns 17 .
In summary, we have developed a method of correlation tensor spectra from XRP transactions.The eigenvalue decomposition of cross correlation matrix is extensively used to analyze time series data, such as daily stock price, foreign exchange rate, etc. However interactions between the agents in these systems have not been considered.On the other hand, we construct the correlation tensor from the network structure of XRP transactions.Then the double singular value decomposition of the correlation tensor reveals a connection between the network structure and XRP price.The method also provides crucial insights into the bubble period of the XRP price.While the main focus of this study is to demonstrate the feasibility of the method, further comprehensive analysis on other bubble and non-bubble periods will be studied in the future.Overall, this method has the potential to contribute to a better understanding and detection of bubbles in financial markets.Moreover, this method is very general and can be used to analyze the transactions of other assets.

Data description
We collected all the direct transactions between different XRP wallets from October 2, 2017 to March 4, 2018, which were recorded as ledger data using the Ripple Transaction Protocol.We grouped these data into T = 22 weekly XRP networks where wallets are the nodes and a direct transaction from a source wallet to a destination wallet forms a directed link between them.The link weight between a pair of wallets is determined by the sum of XRP amounts for all transactions between them in a given week.See 11 for the structural properties of the XRP transaction network.

Network embedding
We embedded weighted directed weekly networks using well-known node2vec method 23 with parameters p = q = 1, which is a special case of the node2vec method and represents the DeepWalk method.Based on a natural language model, these embedding methods capture structural regularities in the network.Particularly, the DeepWalk method encodes the community structure in the vector representation of the nodes.It uses a truncated random walks to extract the neighborhood information of nodes by generating a sequence of nodes S = {V 1 ,V 2 ,V 3 , ...V S } that is equivalent to a sentence in natural language.Furthermore, it applies SkipGram algorithm 29 to map each node V j to its vector representation Φ(V j ) ∈ R D by maximizing the co-occurrence probability of its neighbours in the random walk.

Double singular value decomposition
To find the spectrum of the correlation tensor, we perform a double SVD in the following way: We conduct the diagonalization of M αβ i j in terms of (i j)-index and (αβ )-index successively by the bi-unitary transformation or equivalently SVD.
The first step is and the second step is Then, altogether we have Here ρ γ k is the N × D generalized singular values.Also, note that all singular values are real and positive because the correlation tensor M is real.

Reference correlation tensors
We examine the properties of the empirical correlation tensor by comparing the same quantity between the original correlation tensor and reference correlation tensors, which is analogous to random matrix theory.To get the reference correlation tensors, we have used two different techniques to obtain a reshuffled correlation tensor and a randomized correlation tensor in the following way:

Reshuffle correlation tensor
We reshuffle the components of embedding vectors V α i (t) within the time window (2∆T + 1).Then, calculate the correlation tensor using Eq. 1 with the reshuffled embedding vector components.

Randomize correlation tensor
We assign uniform random numbers between [−1, 1] to the components of embedding vectors and calculate the correlation tensor using Eq. 1.

Signal and noise components of the correlation tensor
Eq. 4 can be used for dimensionality reduction to capture important relationships in the data and it can be written as where and The signal component is calculated using the singular values that lie above the largest singular values of the randomized correlation tensor.In our study, we find that only ρ 1 1 lies above the largest singular values of the randomized correlation tensor and it provides the dominant contributions to the correlation tensor.

Singular values of the correlation tensor with normally distributed elements
Let us first consider the case of a p × q random matrix R, where the elements of R are normally distributed with zero mean and standard deviation σ R .The singular values s of such a matrix R follows the following distribution 25,26 for s min < s < s max and zero otherwise, where and When p = q = N and σ R = σ , s max = 2σ √ N. Now consider the case of the (N × N × D × D) random correlation tensor M ran , where its elements are normally distributed with zero mean and standard deviation σ .The random correlation tensor M ran contains D 2 number of (N × N) random matrix R. Analogous to Eq.2, SVD of the random correlation tensor will give We show how the largest singular values of randomized correlation tensors deviate from the largest singular values of correlation tensors where its elements are drawn from a normal distribution with mean zero and standard deviation σ in Fig. 8.

Figure 1 .
Figure 1.The variation of (a) total number of nodes (b) number of links per node and (c) total transaction volume in millions XRP for each weekly network.(d) The daily XRP/USD close price (source: https://www.marketwatch.com/investing/cryptocurrency/xrpusd).The dotted grey vertical lines represent the weekly windows.

Figure 2 .
Figure 2. The distributions of the elements of empirical, reshuffle and randomize correlation tensors calculated for the week, November 06 to November 12, 2017.The data are averaged over 20 uncorrelated embedding of the networks.

Figure 3 .
Figure 3. Sorted singular values ρ γ k of the empirical, reshuffle and randomize correlation tensor for the week, November 06 to November 12, 2017.The values represent average over 20 uncorrelated embeddings of the network.

Figure 4 .
Figure 4. Evolution of the singular values for empirical ρ γ k and reshuffled ργ k correlation tensors for different weeks.(a) Variation of the largest singular value for empirical ρ 1 1 and reshuffled ρ1 1 correlation tensors.(b) Variation of the second largest singular value for empirical ρ 1 2 , reshuffled ρ1 2 correlation tensors.(c) Variation of spectral gap for empirical (ρ 1 1 − ρ 1 2 ) and reshuffled ( ρ1 1 − ρ1 2 ) correlation tensors.The error bars indicate the standard deviation.The data are averaged over 20 uncorrelated embeddings of the networks.The dotted grey vertical lines represent the weekly windows.
A double SVD of the correlation tensor gives us N × D singular values ρ γ k , where i = 1, 2, 3, ...N and γ = 1, 2, 3, ...D.For the details, refer to the Method section.We compare the singular values ρ γ k of the empirical correlation tensor with the singular values of randomized correlation tensor ρ γ k (randomize) and reshuffled correlation tensor ρ γ k (reshuffle).The comparison is shown in Fig.

Figure 6 .
Figure 6.The decomposition of the correlation tensor in the signal component and noise component.(a) Distributions for the elements of the correlation tensor, signal component and noise component for 2017, November 06 -November 12.(b) Distributions for signal components of the correlation tensors before the bubble period ( 2017, November 06 -November 12), during the bubble period (2018, January 01-January 07) and after the bubble period (2018 February 12 -February 18).The legends indicate different components of correlation tensor in (a), and different periods in (b).

Figure 7 .
Figure 7. Evolution of regular nodes within the community structure.(a) Evolution of the number communities of the weekly XRP network that contains at least one regular node (blue curve).(b) Evolution of the maximum number of regular nodes in a community of the weekly XRP network (blue curve).The black curves in both the panels represent the daily XRP/USD price.The dotted grey vertical lines represent the weekly windows.

Figure 8 . 2 √
Figure 8. Plot for the largest singular value ρ 1 1 with standard deviation of the correlation tensor elements σ .Black circles represent singular values for the randomized correlation tensors with time window (2∆T + 1) = 5, 15, 30 and 50 (from right to left).Red triangles represent the largest singular values for correlation tensors, where the elements are drawn from a normal distribution with mean zero and standard deviation σ .The blue line represents ρ 1 1 = 2 √ NDσ which is the analytical expression for the singular values as given in Eq. 11.

Table 1 .
The mean (for the absolute values of the elements), standard deviation and kurtosis of the signal components of correlation tensors for three different weeks.The values within the brackets indicate standard deviations of the quantities.