**CoinGecko API: Accurate & Reliable Crypto Data**

1,164 reads

by Gayatri SarkarJanuary 25th, 2018

Before me, Nick Tomaino discerned cryptoeconomics 101 as the study of economic interaction in adversarial environments. This article will try to venture little deeper into the economics of cryptography.

— The speculative market valuation of cryptoassets must factor behavioral economics and game theory to find the crypto market demand signals from the past years of crypto financial data. I tried to put a perspective to the velocity in the equation of exchange MV=PQ through sigmoid curve which is a bounded real function with non-negative derivative.

— The token economy is creating disequilibrium in the active traditional market by pushing various perfect and imperfect information that have stochastic outcomes through traditional analysis.

— In this article, I also develop and analyze how crypto market’s user behavior is the use case of Richard Thaler’s theory of ‘endowment effect’.

— But we will first look into the consensus model that brought the major identifiable breakthrough in the decentralized economy to quantify the reliability factor in a trust less environment.

I’m not sure if Satoshi was a neo-classical economist. But an economy where spending decisions were led by legislatures of elected officials and bailouts for the top heavy asserts conflicts of interest, he(she/they) was(were) a concerned citizen(s). The influence in our economy by the centralized system has distorted the market long enough leading to a top heavy status quo. Satoshi’s peer to peer electronic digital ledger has not only thrived in the market economy but also created a whole new generation of cryptocurrencies, infrastructures, protocols, applications and services. Cryptography and its economics dwelled well beyond RSA, hashcash, ecash, torrent, proof of work and baked into an economic model that has instigated the very social basis of human behavior through an adoptive incentive structure.

**The Consensus, the invisible hand**

In neo-classical economics, individual decisions are mutually compatible and can be implemented by everyone, a solution to the distorting impact monopolies had on competition. That may be the building block of decentralized economic model where multitude of synergy among decentralized agents is corollary to socially distributed knowledge ensuing to elicit private knowledge for collective welfare and outcomes. Economist Adam Smith referred the unobservable market force to reach equilibrium automatically guiding the demand and supply of free market goods as the ‘invisible hand’. He posited that the self interested traders in a free market would compete with each other, pushing market towards positive output of reliability in the face of market inefficiency with the help of an invisible hand.

An invisible hand produces the outcome in a decentralized way, with no explicit agreements between the economic agents. The essentiality of such component behavior is the unintentional nature, which is non coordinated nor identical with the actual outcome, hence byproducts of the behavior. The acknowledgement of such process conduits without the agents’ knowledge, hence it is invisible. Such process forces people to think what is good for them as well as others.

Reflecting on Adam Smith ‘invisible hand’, the autonomous and independent decision center like the computing nodes in blockchain is a self-auditing ecosystem creating financial incentive for participation. The cryptocurrencies will reach mature equilibrium with distributed financial incentives when they co-operate with consensus while building the most vested valued interests in an interoperable environment. Satoshi’s core innovation is the consensus protocol that tried to solve the computational puzzle of the invisible hand in an egalitarian Laissez-faire system of economy.

**The Puzzle :** The practical byzantine fault tolerance algorithm (PBFT) posits — *“This situation can be expressed abstractly in terms of a group of generals of the Byzantine army camped with their troops around an enemy city. Communicating only by messenger, the generals must agree upon a common battle plan. However, one or more of them may be traitors who will try to confuse the others. The problem is to find an algorithm to ensure that the loyal generals will reach agreement. It is shown that, using only oral messages, this problem is solvable if and only if more than two-thirds of the generals are loyal; so a single traitor can confound two loyal generals. With unforgeable written messages, the problem is solvable for any number of generals and possible traitors. Applications of the solutions to reliable computer systems are then discussed* *here*.”

‘Achieving reliability in the face of arbitrary malfunctioning is a difficult problem, and its solution seems to be inherently expensive.’ What was unsolvable before, in byzantine fault tolerance algorithm (PBFT), Satoshi has tried to solve. The computational puzzle randomizes the process so that no agent can consistently solve it better than anyone else. The payoffs for good behavior make them disinclined to damage this consensus. Any miner to add a new block or a set of transactions need to provide the computationally expensive cryptographic proof, where data of arbitrary length gets transformed into alphanumeric string called hash and the system demands that they start with certain number of zeroes. The probability nightmare curated in a ledger with the validation of ownership of public and private key brought an interesting synergy where we may not touch the money and it can still be exchanged and transacted across borders through an identifiable and verifiable trustless system. Nakamoto consensus are guided by the set of simple and persuasive algorithms like the ‘invisible hand’ to get the best outcome of the decentralized system without the interference from the central authority.

In ‘Shelling Out:The origins of Money’ Nick Szabo’s quotes “Collectibles augmented our large brains and language as solutions to the Prisoner’s Dilemma that keeps almost all animals from cooperating via delayed reciprocation with nonkin.”

*The consensus model difference between full node and lightweight node is out of scope for this article. POW, POS, POA, DPosare also out of scope for discussion of this article.*

**The Velocity**

*I’m very skeptical to release this part of my thought process and I think there may be lot of criticism on my way.*

‘Every cryptoassets serves within its native protocol economy as a store of value, means of exchange, unit of account’ where users are mentally and financially invested in it. The price dynamic is basic market supply and demand controlled by the network effects.

Network effect, the term first introduced by Theodore Vail and later exemplified in Metcalf’s Law. “The network effect describes the value of a service to a user that arises from the number of people using the service. At its core, it captures that the value increases as the number of users increases, because the potential links increase for every user as a new person joins.” “The number of unique connections in a network of a number of nodes (*n*) can be mathematically expressed as the triangular number *n*(*n* − 1)/2, which is proportional to _n_2 asymptotically (that is, an element of *Θ(n2)*).” “Harvard Business Review, Reed (2001) claimed that network value can propagate exponentially in the number of connections. In a largely connected network suppose blockchain, the value is in the creation of subgroups like alt coins, tokens and other platforms and the number of these subgroups (i.e. the subnetworks) can grows exponentially with n. It is clear that the network effect is quite real, and even the most pessimistic view still provides for significant value as the number of connections in the network grows.”

**n log(n) :**

‘When problem is divided recursive into half in each iteration and costing of each level is n, then tree can be drawn in this manner :

image courtsey stackoverflow

In the above recursion tree, each level has cost *cn*.

- The top level has cost
*cn*. - The next level down has 2 subproblems, each contributing cost
*cn*/2. - The next level has 4 subproblems, each contributing cost
*cn*/4. - Each time we go down one level, the number of subproblems doubles but the cost per subproblem halves. Therefore, cost per level stays the same.

The height of this recursion tree is lg *n* and there are lg *n* + 1 levels

Total cost is sum of costs at each level of the tree. Since we have lg *n* +1 levels, each costing *cn*, the total cost is*cn* lg n + *cn*.

Ignoring lower order term n, we can say the complexity is **n log (n)****’**The fundamental fallacy of Metcalfe Law’s initial deduction is in the assumption that all nodes are equally valuable.

If you have attended any undergrad economics class you may have solved multiple variations of Equation of Exchange MV=PQ problem. Chris Burniske has done an incredible job of quantifying the hybrid velocity. He chose hybrid velocity as a weighted linear equation. I think we need to include the bias in the equation, to get the full value of the velocity. (I’m trying to figure out that if a simple game theory can suffice that)

We will use three key assumptions from Metcalf’s network effect to define cryptocurrency network effect :

i) Each additional nodes adds value to the network

ii) the ability to communicate within the network is proportionally affected by increasing the number of nodes.

iii) There exist a threshold beyond which increasing number of nodes leads to a decline in the value of network due to noise.

A sigmoid function has S curve, normally used in the artificial neural network to introduce non-linearity in the model.

A simple sigmoid function

The S curve consists of bubbles and bursts but we need to smoothen it out to derive the actual value of the asset.

*I define ‘the velocity of a cryptoasset as a function of the number of fully functioning nodes that has the core client on a machine instance with complete blockchain of that cryptocurrency and the function of the lightweight nodes. If the nodes weaken(the number of nodes decrease) it will weaken the transaction hence the velocity of that cryptoasset. Similarly if the number of the full nodes increase beyond the threshold velocity, the cryptoasset velocity will flatten like the sigmoid curve and eventually collapse.’*

A full node validates transactions and blocks, and relays them to other nodes.

A miner is a full node that is extending the block chain by creating new blocks with the new transactions relayed from other nodes.

The velocity of the network is the sigmoid function, where velocity is the function of nodes, v=f(n)

f(n)= Pmax/[1+e^{-(n*-n”)B}] , where n=transaction of the nodes

where B(Beta) is steepness of the S curve, Beta is large when the S curve steepens and Beta is small when the change is gradual.

n* is the velocity at a certain time t*and n” is the threshold velocity , it reaches threshold velocity at n*=n”, so n*-n”=0, that means when there is no transaction in the network, coins are hodled e⁰=1

Putting that valuation, f(n)= P/1+1,

So f(n)=P/2, then the velocity is at 0.5, two vertical dotted grid lines output.

It is assumed that for Pmax velocity is 1 and Pmin velocity is considered 0

To put the equation in simpler format we have considered that B(beta) is too small since the network is at nascent stage.

n”-n*=n

To simplify the equation of velocity v=f(n)= 1/(1+e^n) here Beta is ignored.

So the velocity of the cryptoasset is v= 1/ (1+e^n), where n is the transactions of the nodes in the network

For hodlers n=1, because there is no transaction other than occupying the node, but velocity is not equal to zero, because by holding some position they add value to the network.

Sigmoid Function = f(n)= Pmax/[1+e^{-(n*-n”)B}]

The dotted verticals give the equation of weighted average formula with bias.

We need to consider the bias to get the complete value.

Using Chris Burniske problem — 54% of Coinbase users approached bitcoin “Strictly as an Investment,” as hodlers

46% actually used bitcoin as a “Transactional Medium,” resulting in some velocity that we have to infer.

Below are the assumptions use to solve the equation

Let the nodes of the transactional medium be n’ of the lightweight clients

Let the nodes of the investment medium be n of the full node clients

Taking the equation in the coinbase token economy model using the data given by Chris Burniske,

v = 0.54 {1/(1+e¹)} + 0.46 {1/(1+e^n’)} where e¹= 2.71828

v= 0.54{ 1/3.718} +0.46 {1/(1+e^n’)}

v= 0.14523 +0.46 {1/(1+e^n’)}

Now if we try to solve this weighted average formula for reaching v=0.5

0.5 - 0.14523= 0.46 {1/(1+e^n’)}

0.35477/ 0.46= {1/(1+e^n’)}

1+e^n’= 1/0.7712

e^n’= 0.2966

n’= -1.215

The value lies in between the dotted vertical lines between 0<n’>-5

Though I tried to use the coinbase data I think we should try to solve this problem for a small token economy, by designing a small game. The wallets and exchanges are not nodes, hence their effect should not be factored in.

Now, I do not have the enough data to solve MV=PQ equation, I’m working on the technical paper.

In my equation, the velocity of a full node hodler is higher than velocity of the lightweight transaction node network, because the more full nodes are added in the system, the more faster we will reach the threshold. But the velocity of lightweight node is smaller hence adding to the increase in network effect

This equation holds multiple demerits. Though it works in a neural network for value 0 and 1 , in token economy of multi-player multi-game, it is too simple. I also could not quantify the unit of nodes transaction and how to qualify the negative value of the transaction of the node. It does question some of fundamentals of blockchain.

*Node and Block- ‘Every node verifies every transaction that it receives through every block before relaying the block to any other node. If the transaction/ block is invalid, then it is ignored and not shared with other nodes. If the transaction /block is valid(consensus reached), then it is stored by the node and relayed to all other nodes that are connected to it. Thus every node enforces the set of rules that makes consensus and prevents anyone whether it is node, user, wallet, or miner from sending anything on the network that does not follow the consensus.*

Though I tried to establish the velocity through sigmoid function, it will be very difficult to consider the equation in large scale token economy where token dynamics are interoperable.

**Mixed Strategy Game**

This network effects reflects human biases, heuristics and game theory that are being played across various cryptocurrency groups. The price dynamics among multiple cryptocurrency is a corollary to mixed strategy design game of asymmetry. (The game design is out of scope for this article).

The market is not a zero sum game, its about the conflict and co-operation between the intelligent rational decision makers. Bitcoin was hatched as an antidote, more like a parallel currency that would compete with the centralized institutions or even may try to dismantle it. Bitcoin’s unofficial catch phrase is “In cryptography we trust”. Now we are seeing how consortia like R3, enterprise ethereum alliance etc have formed among financial institutions developing new generation of infrastructure and protocols of permissioned ledgers and zero knowledge proof . We are in a mixed strategy co-operative game where instead of abolishing the bank we are analyzing the optimal strategies by which we can enforce agreements between the crypto groups and the banks.

**Endowment Effect**

Story of wine loving economist — “A wine-loving economist we know purchased some nice Bordeaux wines years ago at low prices. The wines have greatly appreciated in value, so that a bottle that cost only $10 when purchased would now fetch $200 at auction. This economist now drinks some of this wine occasionally, but would neither be willing to sell the wine at the auction price nor buy an additional bottle at that price. Thaler (1980) called this pattern-the fact that people often demand much more to give up an object than they would be willing to pay to acquire it-** the endowment effect.** The example also illustrates what Samuelson and Zeckhauser (1988) call a status quo bias, a preference for the current state that biases the economist against both buying and selling his wine. These anomalies are a manifestation of an asymmetry of value that Kahneman and Tversky (1984) call loss aversion-the disutility of giving up an object is greater that the utility associated with acquiring it. This column documents the evidence supporting endowment effects and status quo biases, and discusses their relation to loss aversion….One implication of loss aversion is that individuals have a strong tendency to remain at the status quo, because the disadvantages of leaving it loom larger than advantages. Samuelson and Zeckhauser (1988) have demonstrated this effect, which they term the status quo bias….A central conclusion of the study of risky choice has been that such choices are best explained by assuming that the significant carriers of utility are not states of wealth or welfare, but changes relative to a neutral reference point. Another central result is that changes that make things worse (losses) loom larger than improvements or gains. ”

Retail investors have shown similar behaviors in the crypto market by hodling the coins. The term ‘hodling- hold on for dear life’ was first introduced by a (drunk) reddit user :-)

There have been lot of controversies whether hodling skews the market behavior towards its valuation as unit of exchange or store of value. I’m keeping this discussion out of scope of this article. But Michael J Casey, Chairman of coindesk has written an article on this. For opposing view you can read this.

The other risky choice of hodling is storing coins in crypto exchanges, where the investment is susceptible to risks in infrastructure changes, hacking, transaction fees for uninsured coins. There is an art to hodl, you can read the details here. The psychological ownership tempers the hodlers endowment status by weighing and processing information differently. Such examples are evident in crypto verbal wars in twitter, reddit, github through biases of information processing, forming cults like approach in and outside of social media.

The collection of reasons and stories that makes up the bias processing sometimes limit the rational behavior to various events and understanding. One such bold precedent is covered in this article. Such anomalies in each token economy play an important role in their market prices and returns and exemplifies the token community’s asymmetry attitude towards risk tolerance. Though intrinsically rational agents, these economic actors place higher values in their cryptos, hence the hodl.

This paper tried to understand the novel technology through various economics legacy.

The market should not hold novel technologies like blockchain to an unrealistic perfect rigid standard in compared to our legacy system. Perfect future is not the solution, our focus should be a technology that is flexible, agile and inclusive. This technology will push for fundamental restructuring of financial economy model before artificial intelligence does that to human society.

L O A D I N G

. . . comments & more!

. . . comments & more!