• 沒有找到結果。

3.3 The Model

3.3.1 The Bitcoin Market

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

outweighs the connected costs. This constraint is expressed as follows:

ei,u(t) < ri,u(t)

rT ot(t)bT ot(t)p(t) (10) where ri,u(t) is the hashing power and ei,u(t) the electricity consumption of hardware u of miner i. If s/he decided against the investment, s/he will issue a sell order equal to

γi(t)

2 bi(t) to cover his/her electricity expenses.

Additionally, every miner is able to divest his/her hardware for the price of R(t). S/he will do so, if the electricity expenses are 20% larger than the revenue associated with that specific hardware. That means a miner keeps track of all his/her hardware individ-ually. The constraint for divest is fulfilled if:

1.2ei,u(t) ≥ ri,u(t)

rT ot(t)bT ot(t)p(t) (11)

3.3 The Model

The model used in this thesis has two main components:

• A Bitcoin market which is similar to a real life cryptocurrency exchange, where traders can place buy and sell orders.

• A transaction system, which allows users to send Bitcoins to other users and attach a transaction fee to it.

The following sections will explain these components in greater detail.

3.3.1 The Bitcoin Market

The first main component of the model is the Bitcoin market. It is modeled after real life Bitcoins exchanges or other trading exchanges in general. More specifically, an order book is created. This approach has also been used previously in Raberto et al. (2005) and Cocco & Marchesi (2016).

Order Book

The order book keeps record of all the buy and sell orders with their respective amount in Bitcoin, the remainder of the transaction for partial transactions, the corresponding

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

limit prices and the expiration time of an order. The following will explain these terms in more detail.

Buy Order: The amount of a buy order is proportional to the available fiat cash ci(t) of a trader i. That excludes any fiat cash that is currently used in pending orders. The amount of a buy order is defined as:

buyi(t) = ci(t) · β (12)

where β is a variable pulled from a log normal distribution with average 0.25 and stan-dard deviation of 0.2. In the case that β > 1, β is set to 1, since a trader is not able to take any credit.

Sell Order:Similar to equation (12) is the amount for a sell order determined.

selli(t) = bi(t) · β (13)

β is the same as in equation (12), bi(t) is the Bitcoin held by agent i. Short selling is also not possible.

Limit Prices: The limit price is a price at which a trader wishes to perform his/her order. This mechanism works similar to a limit price from a real world exchange plat-form. A limit price can also have a value of zero, in which case it is regarded as the market price, meaning that a trader wishes to perform his/her order with the best avail-able price. Each agent category has their own probability to issue an order with a market price. 0.2 for users, 0.7 for chartists and 1 for miners. These numbers are chosen and picked by Cocco & Marchesi (2016), who argue, that chartists and miners are the types of agent who have the greatest desire to trade at the best price, chartists for profit and miners for liquidity reasons.

An agent is willing to perform his/her buy order only if the sell limit is below or equal to his/her buy limit. The limit price for a buy order is given as:

buylimi(t) = p(t) · Ni(1.05, σi) (14)

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

Similarly, an agent is only willing to perform his/her sell order if the buy limit is greater or equal to his/her sell limit. The limit price for a sell order is given as:

selllimi(t) = p(t)/Ni(1.05, σi) (15)

For both equations (14) and (15), p(t) is the current Bitcoin price and Ni(µ, σi) is a Gaussian distribution with a mean of 1.05. This distribution with this mean is supposed to represent limit prices, that are not fully rational. Additionally, agents are on average willing to pay a small amount more than the market price would suggest. σiis supposed to represent the volatility of the price in the model. This approach has been used in Raberto et al. (2001). The standard deviation of the Gaussian distribution is given by:

σi = Kσ(ϕi) (16)

where K is a constant set to 2.5 and σ(ϕi) is the standard deviation of the price in the time window ϕ which is set to 20. Furthermore, σi has the following constraint:

σmin = 0.003 ≤ σi ≤ 0.01 = σmax (17)

where the same values as in Cocco & Marchesi (2016) for σ have been used.

Expiration Time: Every order has an associated expiration time. It has the following form:

Expi(t) = Round(t + pati) (18)

where t is the day of the order and patiis the patience of the ordering agent i. It is 0 for chartists, meaning their order will expire if not performed in that time step. This is the case since chartists wish to follow market trends. Users have a log normal distribution from which they retrieve their patience for each time they issue an order. It has a mean of 3 and a standard deviation of 1. Miners who always issue market price orders, have an infinite patience, meaning their order will stay in the market until it is executed and can not be cancelled (even though the investment decision would be different at a later time). Round is a function that always rounds the expiration to the nearest integer.

Price Clearing

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

The price clearing mechanism used in this model is similar to the one from Raberto et al. (2005).

In every simulation step, after all agents were able to issue their order, the order book is sorted in respect to the limit prices. For buy orders, the list is sorted in descending order, and for sell orders in ascending order. The model now compares the two top or-ders from the buy and the sell order list. A match occurs if at least one of the following conditions is fulfilled:

buyi(t) ≥ sellj(t) (19)

sellj(t) ≡ ”0” (20)

buyi(t) ≡ ”0” (21)

where buyi(t) is the limit price of the buy order and sellj(t) is the limit price of the sell order.

Paraphrased, this means that either the buy limit price needs to be greater or equal to the sell limit price and/or at least one of the orders is a market price order.

In case that the amount of Bitcoins in the buy and sell order does not match, the order with the smaller amount is fully executed. The fully executed order will be removed from the order book and the non-fully executed one will remain with the remainder of that transaction. This process will be repeated until the top orders of the two order books do not match anymore. After the last match has occurred, all expired orders will be removed.

Price Formation:the price for a matched transaction pT is formed by the following four rules:

1. If both sides are taking a limit order:

pT = buyi(t) + sellj(t)

2 (22)

2. If only buyi(t) ≡ ”0”:

pT = max(sellj(t), p(t)) (23)

立 政 治 大 學

N a tio na

l C h engchi U ni ve rs it y

3. If buyi(t) > 0 and sellj(t) ≡ ”0”:

pT = min(buyi(t), p(t)) (24)

4. If buyi(t) ≡ ”0” and sellj(t) ≡ ”0”:

pT = p(t) (25)

where p(t) is the current Bitcoin price. Every time pT has been determined, it is hence-forth used as the new p(t).

相關文件