Bitsquare-proxy

I would like to introduce bitsquare-proxy project.

from https://github.com/metabit/bitsquare-proxy
bitsquare-proxy is a python framework that communicates with a local java based bitsquare client using py4j and with a remote bitcore server over https in order to enable an extended set of features.

The early features are planned to be API for ticker, price/volume history, order book, and statistics of the bitsquare network. Since bitsquare is decentralised, API infrastructure would be offered by volunteers and the trust could be achieved using reputation, so automatic signature on the API is included. It is also clear that different nodes may see a different picture of the network.

Further features would be trading bots and protocol hardening tests :slight_smile:

For now, you can already enjoy some snapshot results:

https://raw.githubusercontent.com/metabit/bitsquare-proxy/master/snapshots/ticker
[epoch, price, currency, buy/sell, txid]

https://raw.githubusercontent.com/metabit/bitsquare-proxy/master/snapshots/sorted_history_trades.txt
[block, date, txid, escrow_txid, trade details from the contract]

Looking forward for your comments/questions & thank you for your kind donations:
https://btc.blockr.io/address/info/1MetabitMKKGcYZy8YieDHenjjoMxHNAgW

yours,
metabit

3 Likes

Calculation of the ticker price:
If the contract has a fixed price - then it is trivial.
For a contract with useMarketBasedPrice=True, the timestamp of the escrow transaction is taken, and it is matched with bitcoinaverage listings.
For immediate price, the ask or bid are taken for buy or sell.
For non realtime (tx older than 1h), the hourly monthly-sliding-window api is consulted, and the last round hour price is taken.
In all cases marketPriceMargin is taken into account.

First of all congratilations and a big thanks!!!

The price at what the trade was executed (% based) is a bit tricky and I think there is no better solution than the one you are using. We must not sacfrifice privacy so I think that is a good compromise to get a reasonable idea about the market activity without exposing private trade details.
I use for the buy side and sell side the bid and ask values of the price providers. There is also a check for a max. deviation between the prices the 2 peers are receiving, so even the price feed is not synced it must be in a close window, otherwise the take offer attemt fails.

Btw.: I run a second arbitrator now (address is 19xdeiQM2Hn2M2wbpT5imcYWzqhiSDHPy4). So if you use those addresses for statistics you need to add up both.

I just added the second arbitrator address for statistics, and one can see that 5 trades were added:

For normal (non-stop) operation, a list of arbitrator addresses is not required, as bitsquare_proxy.py takes the data from the bitsquare network where all contracts exist.

Hi metabit, would you get in contact with CoinMarketCap support in order to utilize the API and get Bitsquare added to their website. Thanks.

Best, Alf

Their response to the earlier request:

On 13.06.2016, at 17:12, CoinMarketCap support@coinmarketcap.com wrote:

Bitsquare is an application that provides a decentralized p2p exchange network for Fiat<=>BTC and various crypto<=>crypto coins (Bitsquare.io) . One of Bitsquare’s features is that it protects the privacy of interacting parties. Available cryptos: Bitcoin Litcoin Ethereum Monero Siacoin DAO Namecoin Dash ShadowCash Nubits Nushares Peercoin Primecoin Faircoin Storjcoinx Gemz Dogecoin Maker Blackcoin Factom NXT Steems Bitshares Counterparty Ripple Nem Anti Vpncoin Maidsafecoin YbCoin Cloakcoin Evergreencoin Vericoin Espers Verge Myriadcoin Martexcoin Groestlcoin i/OCoin Sibcoin Creditbit Bigup Platinumbar Jumbucks Pinkcoin OKCash Gridcoin Moin Solarcoin Shift Europecoin Postcoin Availabe Fiat currencies: All major (G20) and most of the rest (not yet Iran and North Korea). Pleas add Bitsquare as available platform to the above mentioned currency pairs. Kind regards, Alf Werrmann

Hi,

We’d like to integrate Bitsquare’s data. Can you please send API documentation? Thanks!


CoinMarketCap Support

Hi alf!

Thanks for your comment.
First bitsquare-proxy has to be really functional and go through some reasonable testing.
I think showing the latest trades on market.bitsquare.io would be a good start.
Once we see that bitsquare-proxy works well (e.g. that it really gets all trades and correct), I could create API according to the ones that coinmarketcap (and other) want.

I am supplying prices (with the calculation method described before) only for fiat, as I use bitcoinaverage.com.
There are no prices for alt coins, so if there is some reliable source of price history of alt coins, I could gladly use that as well.

I just ran now the statistics module that follows all trades that involve the 2 arbitrator address Manfred gave me.
The results are here:

Is this really everything we had?
I must have missed trades …

Would it be possible to run an instance on the bitsquare.io VM (with market.bitsquare.io DNS) ?

For altcoins market price we use Poloniex in Bitsquare.

I checked a bit the entries of the trade history and it does not match very well with my statistics from my arbitrators. I will send you a csv from it.

To run that on market.bitsquare.io would be good, but I don’t have time for setting that up atm.
A web interface to get the relevant data displayed in a user friendly way would be good.

@metabit:
FYI: