首页 > > 详细

辅导留学生asp设计、asp辅导、调试Artificial Financial Market

Using an Artificial Financial Market for studying a
Cryptocurrency Market
Luisanna Cocco, Giulio Concas and Michele Marchesi
University of Cagliari, Italy
Dipartimento Ingegneria Elettrica ed Elettronica
Email: [luisanna.cocco, concas, michele]@diee.unica.it
Abstract—This paper presents an agent-based artificial cryp-
tocurrency market in which heterogeneous agents buy or sell
cryptocurrencies, in particular Bitcoins. In this market, there
are two typologies of agents, Random Traders and Chartists,
which interact with each other by trading Bitcoins. Each agent
is initially endowed with a finite amount of crypto and/or fiat
cash and issues buy and sell orders, according to her strategy
and resources. The number of Bitcoins increases over time with
a rate proportional to the real one, even if the mining process is
not explicitly modelled.
The model proposed is able to reproduce some of the real
statistical properties of the price absolute returns observed in
the Bitcoin real market. In particular, it is able to reproduce
the autocorrelation of the absolute returns, and their cumulative
distribution function. The simulator has been implemented using
object-oriented technology, and could be considered a valid
starting point to study and analyse the cryptocurrency market
and its future evolutions.
Index Terms—Artificial Financial Market, Cryptocurrency,
Bitcoin, Heterogeneous Agents, Market Simulation
I. INTRODUCTION
Cryptocurrencies are digital currencies alternative to the
legal ones. A cryptocurrency is a computer currency whose
implementation is based on the principles of cryptography,
used both to validate the transactions and to generate new cur-
rency. The cryptocurrency implementation often use a proof-
of-work scheme recording all transactions in a public ledger in
order to protect sellers from fraud. Most of cryptocurrencies
are designed to gradually introduce new currency, placing a
ceiling on the total amount of money in circulation, to avoid
the inflation phenomena as often happens for ”fiat” currencies.
The most popular cryptocurrency is undoubtedly Bitcoin.
It was created by a computer scientist known as ”Satoshi
Nakamoto” whose real identity is still unknown [20]. Like the
other cryptocurrencies, Bitcoins use cryptographic techniques,
and thanks to an open source system anyone is allowed to
control and modify the source code of the Bitcoin software.
The Bitcoin network is a peer-to-peer network that checks and
monitors both the generation of new Bitcoins, (aka ”mining”)
and the transactions in Bitcoins. This network includes a
high number of computers connected to each other through
the Internet. It performs complex mathematical procedures
which give life to the mining and verify the correctness and
truthfulness of the Bitcoin transactions.
The Bitcoin system provides a ceiling on the amount of
money in circulation, equal to 21 million of Bitcoins, conse-
quently there is not the risk that the number of coins increases
too much, devaluating the currency.
Bitcoin has several attractive properties for consumers. At
first, it does not rely on a central bank or a government
to regulate the money supply. It enables quasi- anonymous
transactions, providing a greater anonymity than traditional
electronic payments. In addition, Bitcoin transactions are
irreversible and can also be very small. Indeed, a Bitcoin
transaction can involve only one ”Satoshi”, a subunit equal
to 10 8 of a Bitcoin.
The Bitcoin can be purchased on appropriate websites
such as Crypto Trade CoinMKT, BTC-and Vircurex, Cryptsy,
Coinbase, UpBit and Vault of Satoshi, that allow to change fiat
cash in Bitcoins. Other sites offer online services, or goods
exchange for goods, and accept payments in Bitcoins. The
Bitcoin allow everyone to send cryptocurrency internationally
at a very small expense.
Over the past years, interest in digital currencies has in-
creased. Indeed, Bitcoin had a rapid growth, both in value
and in the number of transactions since its beginning in early
2009. The BlockChain 1 Web site provides different graphs
and statistical analysis about Bitcoins. In particular, we can
observe the time trend of the Bitcoin price.
Between January 2009 and January 2010 there were no
exchanges on the market. Between February 2010 and May
2010 two consumers made the first real-world transactions.
One bought 2 pizzas for 10,000 BTC, and another auctioned
10,000 BTC for $50.
In June 2010, the price grew from $0.008 to $0.08 for 1
bitcoin. Thereafter, the price slowly rose until a peak of $1,150
was reached in December 2013. In the same month, the Bitcoin
price crashed to $600, rebounded to $1,000, then crashed again
to the $500 range. In January 2014 the price settled in the
$800-$900 range and in February and March it fell following
the shutdown of historical MTGOX exchange site and reports
regarding Bitcoin ban in China. As of April 2014, one Bitcoin
is priced at about $400.
The recent attention given to Bitcoin and in general to the
1BlockChain is a web site which displays detailed information about all
transactions and Bitcoin blocks, providing graphs and statistics on different
data, (https://blockchain.info/). We used this web site for extracting the
empirical data (such as daily data about price, unique address number and
bitcoin number, in the period between January 1, 2012 and April 10, 2014)
used in this work.
cryptocurrencies shows that many consumers are turning their
attention toward new trading means to simplify their financial
lives. Online purchases performed with cryptocurrency are
anonymous, faster and simpler than the traditional credit cards
ones.
While the popularity of cryptocurrencis has grown quickly,
they still face important argument because of their unconven-
tional way of working.
A lively debate is ongoing about promise, perils and risks
of digital currencies and in particular of Bitcoin. Several
papers appeared on these topics, but the attempts to study
the cryptocurrency market as a whole are very few. In this
work, we propose an agent-based model aimed to study and
analyse the Bitcoin market as a whole. We try to reproduce
the main stylized facts present in the real Bitcoin market, such
as the autocorrelation and the cumulative distribution function
of the price absolute returns. The model proposed simulates
the Bitcoin transactions, by implementing a mechanism for the
formation of the Bitcoin price, and a specific behavior. for each
typology of trader. The paper is organized in the following.
In Section II we discuss other works related to this paper, in
Section III we present our model in detail; Section IV deals
with the calibration of the model, and with the values given to
several parameters of the model. Section V presents the results
of the simulations, including an analysis of Bitcoin real prices.
The conclusions of the paper are reported in Section VI.
II. RELATED WORK
The study and analysis of the cryptocurrency market is a
relatively new field. In the last years, several papers appeared
on this topic given its potential interest, and the many issues
related to it.
Androulaki et al. [2] studied the privacy guarantees of
Bitcoin when Bitcoin is used as a primary currency for the
daily transactions. Moore [19], Hout et al. [13], Eyal et al. [10],
Brezo et al. [6] and Hanley [12] analysed promise, perils, risks
and issues of digital currencies. Bergstra et al. [4] investigated
technical issues about protocols and security, and issues about
legal, ethical and phychological aspects of cryptocurrencies.
Singh et al. [29] proposed an additional layer of mutual trust
between the payer and the paye,e in order to enhance the
security associated with fast transactions for the real Bitcoin
transaction network.
Only very few attempts have been made so far in order
to model the cryptocurrency market as a whole. Luther [17]
studied why cryptocurrencies failed to gain widespread accep-
tance using a simple agent model. The proposed a model in
which crypto-anarchists, computer gamers, tech savy and black
market agents derive a specific utility by using the fiat currency
or the crypto currency. The utility’s value varies with the typol-
ogy of currency and traders. It takes into account the network
related benefits from using the same money as other agents,
the benefits unrelated to networks, and the switching costs that
incur to switch to the alternative currency. The author showed
that cryptocurrencies like Bitcoins cannot generate widespread
acceptance in absence of significant monetary instability, or of
government support, because of the high switching costs and
of the importance of the network effects.
Considering that hundreds of cryptocurrencies have be al-
ready proposed on the Internet, and that most of them are
waiting for acceptance, Bornholdt and Sneppen [5] proposed
a model based on Moran process to study the cryptocurrencies
able to emerge. This model simulate the interchange between
several markets where different cryptocurrencies are traded.
In particular, the authors simulate the agent trading, and the
mining of new coins at a constant rate, and the commu-
nications among traders. They showed that all the crypto-
currencies are innately interchangeable, and that the Bitcoin
currency in itself is not special, but may rather be understood
as the contemporary dominating crypto-currency that might be
replaced by other currencies.
Since very few works have been made to model the crypto
market, in this paper we propose a complex agent-based
model to study the cryptocurrencies market as a whole and
to reproduce the main stylized facts present in this market,
such as autocorrelation and distribution function of the price
absolute returns. Our model is inspired by artificial financial
market models. These models are stylized heterogeneous agent
models (HAMs) and reproduce the real functioning of markets,
trying to explain the main stylised facts observed in financial
markets, such as the fat-tailed distribution of returns, the
volatility clustering, and the unit-root property. Many works
have been published on this topic.
LeBaron [14] offered a first review of the work appeared in
this field. More recently, Chakraborti et al. [7], and Chen et
al. [8] offered other, updated reviews.
Palmer et al. [23] and Arthur et al. [3] proposed an artificial
markets combining market trading mechanisms with inductive
agent learning. In the 2000s, researchers at the University
of Genoa and Cagliari developed the Genoa Artificial Stock
Market (GASM). In particular, Raberto et al. [26] proposed an
agent-based artificial financial market that, through a realistic
trading mechanism for price formation, is able to reproduce
some of the main stylised facts observed in real financial
markets. Raberto et al. [27], and Cincotti et al. [9] studied the
long-run wealth of traders characterized by different trading
strategies. Moreover, Raberto et al [28] presented an extension
of the GASM including a limit order book mechanism for
price formation. They demonstrated that the main stylized
facts in financial market can be reproduced as a consequence
of the limit order book, not introducing any assumption on
agents behavior. Alfarano et al. [1], starting from the study
of relatively complicated agent-based models which do not
allow for analytical solutions, proposed a closed-form. model
that gives rise to realistic behavior. of the resulting time series,
like fat tails of returns and temporal dependence of volatility.
Liua et al. [16] developed two simple models to investigate
important statistical features of stock price series. With the first
model, the authors found that the clearing house microstructure
can explain fat tail, excess volatility and autocorrelation phe-
nomena of high-frequency returns. With the second model the
authors investigated the effects of agents’ behavioral assump-
tions on daily returns. Ponta et al. [24] studied the statistical
properties of prices and returns by using a heterogeneous agent
model. They simulate an artificial stock market where agents
are modelled as nodes of sparsely connected graphs. The
agents own an amount of cash and stocks, share information
by means of interactions determined by graphs and trade risky
assets; whereas a central market maker determines the price at
the intersection of the demand and supply curves. Ponta et al.
[25] proposed a heterogeneous agent model for the simulation
of high-frequency market data by using the Genoa Artificial
Stock Market. In this market, agents have zero intelligence
and trade a risky asset, the price being cleared by means
of a limit order book in which the waiting-time distribution
between consecutive orders follows a Weibull distribution. The
authors demonstrated that this mechanism is able to reproduce
fat-tailed distributions of returns without ad-hoc behavioral
assumptions on agents.
Recently, Feng et al. [11] combine the agent-based approach
with the stochastic process approach and propose a model
based on the empirically proven behavior. of individual market
participants that quantitatively reproduces fat-tailed return
distributions and long-term memory properties. Westerhoff and
Franke [31] propose a model using three groups of traders:
chartists, fundamentalists and investors, demonstrateing that
this combination, together with a simple asset pricing model,
can contribute to explaining the stylized facts of the daily
returns of financial markets.
III. THE MODEL
The proposed model presents an agent-based artificial cryp-
tocurrency market in which heterogeneous agents buy or sell
cryptocurrency. In particular, we used the Bitcoin market as
a reference to calibrate the model and to compare the results.
For the same reason, the fiat currency is referred as ”dollars”,
or ”$”.
The features of the model that deserve special mention are:
the trading mechanism is based on a realistic order book
that keeps sorted lists of buy and sell orders, and matches
them allowing to fullfill compatible orders and to set the
price;
traders have typically limited financial resources, initially
distributed following a power law;
the number of agents engaged in trading at each moment
is a fraction of the total number of agents;
either a number of new traders, endowed only with cash,
enter the market every day, or a number of traders quit
any trading activity; they represent people who decided
to start trading in Bitcoins, or people who decides to quit
trading in Bitcoins;
to account for the mining of new Bitcoins, from time to
time some traders are randomly chosen and their Bitcoin
amount is increased.
The trading mechanism gives rise to a demand-supply
schedule, whose imbalance between demand and supply
causes price fluctuations. The limited financial resources of the
agents pose significant constraints on the trading of each agent.
The engagement in trading of a small fraction of population
makes the trading mechanism realistic, given also the fact that
the Bitcoin exchange mechanism do not allow high-frequency
trading.
The entering the market of new traders interested in buying
Bitcoins is an empirical fact, that is reflected in the increasing
number of IP addresses registered in the Blockchain. This
continuous inflow of traders fits empirical data, and makes the
whole market open. These new traders are endowed only of
cash, because they represent newcomers to the Bitcoin market,
wishing to buy Bitcoins for the first time. We also account
for the ever increasing number of Bitcoins due to mining by
increasing proportionally the amount of Bitcoins owned by
randomly selected traders who already own Bitcoins, and who
act as ”miners” in the model.
As regards trading strategies, it is worth noting that traders
operate in the market either for real needs, or for speculative
reasons. In fact, it is misleading to claim that the agents
trade only for speculative reasons, so in the proposed model
two populations of traders are defined. One population issues
orders for real needs and the other for speculative reasons,
hence each of them follows specific trading strategies.
In the next subsections we described in detail the model,
which simulates the Bitcoin transactions and the related mech-
anism of price formation.
A. The Traders
At every generic time step, t, i-th trader holds and amount
ci(t) of fiat currency (cash, in dollars), and an amount bi(t) of
crypto-currecy (Bitcoins). Traders are divided into ”historic”
ones - who are in the market since its beginning and own
both cash and Bitcoins - and new traders - who enter the
market in a second time and are endowed only with cash. The
wealth distribution of both kinds of traders follows an inverse
power-law. This is a realistic assumption because the financial
”power” of traders hugely varies. More detailed explanations
of this property can be found in [15].
The set of traders entering the market at times > 0 are
generated in the beginning of the simulation with a Pareto
distribution of fiat cash, and then are randomly extracted from
the set, when a given number of them must enter the market
at a given time step. More details on how wealth is actually
given to traders is given in Section IV-A.
At each time t, an active trader can issue only one order,
which can be a sell order or a buy order. Orders already
placed but not yet satisfied or withdrawn are accounted for
when determining the amount of Bitcoins a trader can buy or
sell. A buy order implies that a trader buys Bitcoin currency
in exchange of a given amount of dollars. Consequenty, the
amount of Bitcoins to be bought is given by the ratio between
the amount of dollars to be traded and the Bitcoin unitary
price.
As regard the trading strategy, traders are divided into two
populations: Random traders and Chartists.
1) Random Traders represent persons who entered the
crypto-currency market for various reasons, but not
for speculative purposes. They issue orders for reasons
linked to their needs, for instance they invest in Bitcoins
to diversify their portfolio, or they disinvest to satisfy a
need for cash. In the model, this is represented by the
fact that they issue orders in a random way, compatibly
with their available resources. Buy or a sell orders are
always issued by these agents with the same probability.
Random traders’ behavior. gives stability to the system.
They can be considered as a ”thermal bath” where other
strategies can be introduced.
 

联系我们
  • QQ:99515681
  • 邮箱:99515681@qq.com
  • 工作时间:8:00-21:00
  • 微信:codinghelp
热点标签

联系我们 - QQ: 99515681 微信:codinghelp
程序辅导网!