Bitcoin Forum
March 29, 2024, 08:04:56 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Seeking Feedback on Prototype Multi-Exchange Bitcoin Market Data API  (Read 2214 times)
BitcoinATS.com (OP)
Newbie
*
Offline Offline

Activity: 30
Merit: 0


View Profile
December 15, 2013, 01:31:11 AM
 #1

This document is also available at http://bitcoinats.com/help .

The objective was to build a market data API that leverages the consolidated order book of a user-specified subset of major exchanges and exposes key functionality through a JSON API.  I would appreciate your feedback, suggestions for new API endpoints that leverage the full order book, etc.  Performance was a key consideration as we wanted these algorithms to work against a real-time feed.  Please feel free to contact me at support@bitcoinats.com with any questions.  If there is sufficient interest, we will continue development.

NOTE: This prototype JSON API will only be public for a limited time. To sign up for the API key waitlist, go to http://signup.bitcoinats.com

Since most exchanges don't have real-time feeds, this prototype API pulls the full depth from MtGox, Bitstamp, btc-e, and CampBX every 20 minutes and analyzes the cached data.   Obviously, a production version will need to maintain the full order books using streaming APIs.  We already handle exchange-specific commissions, and reflect the effect of commissions in all data we return.  Rounding of commission-adjusted amounts needs to be better handled in a production version, however.  Orders are described as they would be sent to the exchanges, but the proceeds of transactions reflect the cost of commissions.

You can select a subset of these exchanges by passing "exchanges" to the API containing a subset of:

M = MtGox
B = Bitstamp
E = btc-e
C = CampBX

The calls are:

ARBITRAGE -- Find all arbitrage opportunities across selected exchanges (including cost of commissions), calculate the total profits, and generate a list of pair trades to execute the arbitrage strategy

http://bitcoinats.com/arbitrage?exchanges=MBEC

returns an object:

"profits" is the excess (commission adjusted) USD generated by executing
"trades" is an array of pair-trades of the type:

[BUY, exchange, BTC price in USD, # of BTC, commission, BTC purchased]
OR
[SELL, exchange, BTC price in USD, # of BTC, commission, commission adjusted USD proceeds]


BUY -- commission-adjusted optimal buy order routing to multiple exchanges

http://bitcoinats.com/buy?amount=100000&exchanges=BEC

"amount" is the USD to buy BTC with.
Returns:
"totalspent" in USD
"totalpurchased" is BTC purchased after commissions
"transactions" is sorted array of "BUY" orders with routing to purchase maximum BTC.

SELL -- commission-adjusted optimal sell order routing to multiple exchanges

http://bitcoinats.com/sell?amount=100&exchanges=BEC

"amount" is the BTC to sell for USD.
Returns:
"totalsold" in BTC
"totalproceeds" is the USD proceeds after commissions.
"transactions" is a sorted array of "SELL" orders with routing that maximizes proceeds.

QUOTE -- get a commission-adjusted best bid and ask in the marketplace

http://bitcoinats.com/quote?exchanges=BEC

Returns the best commission-adjusted bid/ask across the selected exchanges. "bestbid" and "bestask" are arrays of the type:

[exchange, BTC price in USD, commission, commission adjusted BTC price in USD, size in BTC]

DEPTH -- returns the consolidated market depth of the selected exchanges, including the effect of commissions on orders

http://bitcoinats.com/depth?exchanges=BEC

Returns the consolidated order book of the selected exchanges. The return object contains "bids" and "asks". Each bid or ask is an array of arrays, sorted by best bid/ask, containing:

[exchange, BTC price in USD, commission, commission adjusted BTC price in USD, size in BTC]
1711699496
Hero Member
*
Offline Offline

Posts: 1711699496

View Profile Personal Message (Offline)

Ignore
1711699496
Reply with quote  #2

1711699496
Report to moderator
1711699496
Hero Member
*
Offline Offline

Posts: 1711699496

View Profile Personal Message (Offline)

Ignore
1711699496
Reply with quote  #2

1711699496
Report to moderator
1711699496
Hero Member
*
Offline Offline

Posts: 1711699496

View Profile Personal Message (Offline)

Ignore
1711699496
Reply with quote  #2

1711699496
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1711699496
Hero Member
*
Offline Offline

Posts: 1711699496

View Profile Personal Message (Offline)

Ignore
1711699496
Reply with quote  #2

1711699496
Report to moderator
empoweoqwj
Hero Member
*****
Offline Offline

Activity: 518
Merit: 500


View Profile
December 15, 2013, 04:24:13 AM
 #2

Sounds great. I've signed up for the API.

I do have problems with arbitrage "opportunities" though, simply because of the time to move money between exchanges. I've been waiting 2 months to receive a wire from gox. The market has kind of "moved on" since then ;-)
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!