Author [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] [EN] [ZH] [ES] [PT] [IT] [DE] [FR] [NL] [TR] [SR] [AR] [RU] Topic: Probability Density Curves for BitAsset feed, bid and ask vs. market price  (Read 1151 times)

Offline wasthatawolf

  • Full Member
  • ***
  • Posts: 188
    • View Profile
  • BTS: loon3

I setup a site to analyze the USD and BTC price pegs by comparing the asset feed, bid and ask prices to the market price of BTS on Coinmarketcap.  The price variance mean and standard deviation are calculated to produce Probability Density Curves.  Data is recorded every fifteen minutes.

http://delegate.ninja/assets/?t=bitbtc

http://delegate.ninja/assets/?t=bitusd

Offline arhag

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #1 on: December 21, 2014, 11:32:25 PM »
Wow, this is great stuff.

I find it interesting that the mean of the feed price curve for both BitAssets is shifted to the right. I'm speculating this has to do with the asymmetry in how quickly delegates update feed prices depending on whether it is going up vs going down. If cmc_bts value drops (which means the price of BTS relative to the BitAsset, such as BitUSD, goes up) the bts_feed value can lag a bit without any worry. While if cmc_bts value increases, the lag until the bts_feed value updates should be much shorter so that the correct price information can be quickly updated in the blockchain to properly handle margin calls when the price is falling quickly. Anyone see a mistake with this interpretation or perhaps a different explanation for the data?

Having the bid and ask curves peak to the left of the feed mean in the case of BitUSD also makes sense to me. People selling actual BitUSD to get back into BTS need to compete with the superbulls short sellling BitUSD at the price feed by offering better asks. But the bid and ask curves for BitBTC are pretty surprising, although it is consistent with the order book I usually see in the BTS/BitBTC market (barely anyone shorting, and the actual BitBTC holders only willing to sell for an overvalued price). Perhaps that market is just too small currently to make any meaningful interpretations from the data.

And finally, the variance difference between the various curve peaks is still so high for the BitUSD market. It shows how bad the liquidity is currently in even our most liquid BitAsset. Can't wait to see those curves squeeze sharper, the peaks get closer together, and the peaks all move closer to zero.


Edit: By the way, do you think you could calculate these statistics in a moving window of the data and use it to generate an animated plot (or a live generated plot using Javascript that can adjust the plots using a slider representing time)? It would be interesting to see how these curves evolve with time.
« Last Edit: December 21, 2014, 11:45:27 PM by arhag »

Offline davidpbrown

Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #2 on: December 21, 2014, 11:41:53 PM »
Very interesting.. it would be useful to see CNY and perhaps Gold.. and later any other markets of consequence.
฿://1CBxm54Ah5hiYxiUtD7JGYRXykT5Z6ZuMc

Offline wasthatawolf

  • Full Member
  • ***
  • Posts: 188
    • View Profile
  • BTS: loon3
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #3 on: December 22, 2014, 02:12:21 AM »
Edit: By the way, do you think you could calculate these statistics in a moving window of the data and use it to generate an animated plot (or a live generated plot using Javascript that can adjust the plots using a slider representing time)? It would be interesting to see how these curves evolve with time.

Interesting idea, an animation or slider would be a great way to visualize how the data changes over time.  An easier way might be to create line charts of each variance vs time and use the standard deviation to create confidence bands.

Once I've collected enough data, my plan is to generate these plots with the most recent 672 data points (one week's worth of data).  This will help to keep the probability functions relevant when evaluating the current market.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #4 on: December 23, 2014, 04:18:54 AM »
I built the visualization tools I was talking about. Check it out here: http://jsfiddle.net/wb45otcd/3.

It scrapes the data off your website by the way, hope you don't mind.
« Last Edit: December 23, 2014, 04:17:36 PM by arhag »

Offline wasthatawolf

  • Full Member
  • ***
  • Posts: 188
    • View Profile
  • BTS: loon3
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #5 on: December 23, 2014, 04:45:29 AM »
I built the visualization tools I was talking about. Check it out here: http://jsfiddle.net/wb45otcd/.

It scrapes the data off your website by the way, hope you don't mind.

Awesome!  This is great.  No need for a fixed window. 

Feel free to scrape, I'll put together a json API to make the data more accessible.

Offline arhag

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #6 on: December 23, 2014, 03:38:06 PM »
@wasthatawolf, there is a problem with item 563 in the data (for both BitUSD and BitBTC). The feed/bid/ask prices are given as 0. This throws off the calculation of the mean and standard deviation.

I fixed the problem on my end by filtering out the erroneous data. You can compare the change by comparing http://jsfiddle.net/wb45otcd/2/ to http://jsfiddle.net/wb45otcd/3/.

Offline wasthatawolf

  • Full Member
  • ***
  • Posts: 188
    • View Profile
  • BTS: loon3
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #7 on: December 23, 2014, 04:12:20 PM »
I just removed the bad row of data.  Modifying the script to try and prevent that from happening again.

Offline wasthatawolf

  • Full Member
  • ***
  • Posts: 188
    • View Profile
  • BTS: loon3

Offline arhag

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #9 on: December 23, 2014, 05:04:19 PM »
@arhag

Full data set in JSON

http://delegate.ninja/assets/functions/alldata.php?t=bitusd

Nice. Could you also enable callbacks so that people could use JSONP directly from a static page rather than needing a proxy?

Offline clayop

Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #10 on: December 23, 2014, 05:16:08 PM »
Here is paired t test results

Code: [Select]

> t.test(data$feed, data$bid, paired=TRUE)

        Paired t-test

data:  data$feed and data$bid
t = 39.863, df = 588, p-value < 2.2e-16
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 2.752576 3.037864
sample estimates:
mean of the differences
                2.89522

> t.test(data$feed, data$ask, paired=TRUE)

        Paired t-test

data:  data$feed and data$ask
t = 1.6808, df = 588, p-value = 0.09333
alternative hypothesis: true difference in means is not equal to 0
95 percent confidence interval:
 -0.03797046  0.48868061
sample estimates:
mean of the differences
              0.2253551


According to the results, feed price and ask price shows no statistical difference, that is pegging greatly works for bitUSD buyers.
However, between bid and feed price, there is a significant difference (2.895) at 1% level. This implies we need improvements for bitUSD sellers.
Bitshares Korea - http://www.bitshares.kr
Vote for me and see Korean Bitshares community grows
delegate-clayop

Offline arhag

  • Hero Member
  • *****
  • Posts: 1213
    • View Profile
    • My posts on Steem
  • BTS: arhag
  • GitHub: arhag
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #11 on: December 23, 2014, 05:52:50 PM »
However, between bid and feed price, there is a significant difference (2.895) at 1% level. This implies we need improvements for bitUSD sellers.

I wonder how much this has to do with grandfathered shorts who aren't forced to cover in 30 days. Anyone know what fraction of the BitUSD supply is owed by grandfathered short positions?

I would also love to see statistics on the grandfathered short positions such as:
  • Fraction of grandfathered short positions (weighted by BitUSD debt owed) that would be margin called as a function of BTS price.
  • Fraction of grandfathered short positions (weighted by BitUSD debt owed) that would gain a {0%, 1%, 5%, 10%} profit by covering their short as a function of BTS price.
  • Historical data on grandfathered short positions (existing right after the 30 day market change, denoted the "original grandfathered set") that have already covered since then, including: the distribution of the profit/loss percentages that they covered at; fraction of grandfathered short positions remaining (weighted by BitUSD debt owed) relative to the "original grandfathered set" plotted over time along with the price of BTS.
« Last Edit: December 23, 2014, 06:10:46 PM by arhag »

Offline wasthatawolf

  • Full Member
  • ***
  • Posts: 188
    • View Profile
  • BTS: loon3
Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #12 on: December 23, 2014, 06:16:38 PM »
@arhag

Full data set in JSON

http://delegate.ninja/assets/functions/alldata.php?t=bitusd

Nice. Could you also enable callbacks so that people could use JSONP directly from a static page rather than needing a proxy?

Try this:  http://delegate.ninja/assets/functions/alldata_callback.php?t=bitusd

I used the example here:  https://gist.github.com/mathiasbynens/5547352


Offline vikram

Re: Probability Density Curves for BitAsset feed, bid and ask vs. market price
« Reply #14 on: December 23, 2014, 10:40:04 PM »
 +5% This is awesome. Keep up the good work guys.

 

Google+