In the second part of the article, we saw how to spot anomalous price movements and how to profit from the divergence between futures and spot prices in the crypto market. Moreover, we showed the key indicator on which we should always be focused on.

In this third part, which is the last one in this mini-series related to Bitcoin, we will focus on another exchange and see how market participants can easily distort information when liquidity is low.

The exchange is Poloniex.com, which has a peer-to-peer financing system which is similar to the one on the OKC. The users of the exchange have the possibility to use their deposited funds and lend them to other users at a pre-defined interest rate. The lending offer is placed as a limit order in the “Lending Book” for a customizable amount of time. This pool of liquidity allows the use of leverage for other users, who can increase their exposure without a centralized counterparty through a margin lending.

The pros of this system are spontaneous determination of the market interest rate through the laws of supply and demand. In addition, the peer-to-peer financing system is also available in other cryptocurrencies and on other exchanges (OKC) even USD and CNY. For the main currencies (USD, CNY, BTC) the daily interest rate has been on average around 0.06% in the last 30 days. The fact that it is so high should not come as a surprise given that the peer to peer lending is exposed to:

  • Exchange default risk.
  • Risk of loss of an unpaid principal if the borrower defaults on a loan and liquidation of the borrower’s account fails to raise sufficient funds to cover his debt.
  • The position can be closed at any time, and this risk is even bigger when the market interest rate becomes lower than the one at which you agreed to lend.

photo1Source: BSIC

The table above shows the order book for loans. In the “LOAN OFFERS” table liquidity providers are showing the rate at which they are willing to lend. On the other hand, in the “LOAN DEMANDS” table, traders are showing the rate at which they are willing to borrow. There is a clear imbalance between demand and supply, because in the most cases margin traders want to execute their order as soon as possible and do not care about the rate at which they are borrowing. Indeed, the daily default rate is set to 2% and if in “LOAN OFFERS” there are orders for less than 2% they are executed immediately. Liquidity providers are mainly makers and margin traders are mainly takers.

This can easily be exploitable, and we will show how to do that. We will not include the full code but just the relevant passages.

To start, we need to define some fundamental functions such that the algo that will “cycle” through the order book and take liquidity away. Firstly, we need to find out the current bid and ask.

  1. def returnOrderBook (self, currencyPair):
  2. return self.api_query(“returnOrderBook”, {‘currencyPair’: currencyPair})

For example, the output for the currency pair BTC_ETH returns the following:

“Ask” = [“0.01704792”,171.48]

“Bid” = [“0.01700274”,156.62774379]

That is the code equivalent to an order book like this:

BID PRICE

SIZE

ASK PRICE

SIZE

0.01700274

156.62774379

0.01704792

171.48

Source: BSIC

Now, we write the function to insert a limit order:

  1. def marginBuy(self,currencyPair,rate,amount,lendingRate):
  2.                return                                                                  self.api_query(‘marginBuy’,{“currencyPair”:currencyPair,”rate”:rate,”amount”:amount, “lendingRate”:lendingRate})

Where currencyPair can be any of those supported, rate is the price we use for out limit order, amount is the number of units we want to purchase and lendingRate is the maximum rate we are willing to pay to borrow funds. We can run our algo on any order book, but we need to pay attention to the rate because we do not want the order to be executed (e.g. we do not make a market order, instead we use a limit order at a price which is substantially far from the current market price).

We now define a new variable limit_price = highest_bid * k (where k < 1 because the limit order will be under the highest bid, sufficiently under that it will not be executed, we assume 0.6 < k <0.8) and a variable total which is the size of our order (for maximum effectiveness we use the whole amount on our available balance).

  1. limit_price = highest_bid * 0.75
  2. total = available_balance / limit_price
  3. marginBuy(self,BTC_ETH,limit_price,total,0.2):

Finally, the output is as following:

{“orderNumber”:1234567,”resultingTrades”:[{}]}

The resultingTrades is empty because our limit order is parked in the book far from the current market price. The last function we use is to cancel the order we have just created:

  1. def cancel(self,currencyPair,orderNumber):
  2.                return                                                   self.api_query(‘cancelOrder’,{“currencyPair”:currencyPair,”orderNumber”:orderNumber})

We run cancel using as the parameters the currency pair BTC_ETH and the order number we obtained previously:

cancel(self,BTC_ETH,orderNumber):

Now our limit order is completely cancelled from the order books. A simple loop cycle is enough to run the algo many times. So, what did we accomplish by utilising the functions above?

Every time we were creating a limit order we were also taking liquidity away from the “Lending Book”, which results in the higher interest rates. A higher interest rate, in a certain way, implies the asymmetric information. As a matter of fact, other market participants think that someone is overleveraged when she is not, and we can now enter the lending market and lend at artificially higher rate.

Does the law of one price apply to Bitcoin?

In the past a multitude of exchanges have not been subject to regulation from National Institutions. However, after the extraordinary collapse of Mt.Gox and the mysterious disappearance of 300 million USD the situation changed and regulatory framework – like the US BitLicense – have been put in place. The bitcoin market is far from being centralized; of course, its pseudo anonymity and its independence from any central authority helped shaping this framework. Still, the market structure offer to fastest and smartest players the opportunity to arbitrage between pairs of currency on different exchanges.

See the two order books below, it might seem that we spotted an arbitrage opportunity since the lowest ask on exchange A is lower than the highest bid on exchange B.

photo3Source: BSIC

However, this is not the case as not all arbitrage opportunities are feasible due to external circumstances; we are going to analyse the transaction cost for a sample transaction that we will call Example 1 in order to give an idea of the costs involved. Precise cost analysis is fundamental, transaction costs exist and they are very relevant, each exchange has its own requirements and cost structure.

photo4Source: BSIC

Let’s have a visual breakdown of the constituent costs for Example1. These are summarized in the following table:

photo5Source: BSIC

*The spread between the moment when we decide to buy and the actual execution

**Depends on the exchange

***(The bid-ask spread)/2

As evident from the data, fees associated with the transaction void any profit and arbitrage is therefore not possible. As we could imagine the law of one price, even if it does not seem applicable at the first glance, it is valid.

[edmc id= 4212]Download as PDF[/edmc]


0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *